Hreflang
Technical & InfrastructureAn HTML attribute telling search engines which language version of a page to show in each region.
Definition
Hreflang is an HTML attribute used within `<link>` tags to tell search engines that multiple language or regional versions of a page exist and which version should appear in search results for users in each locale. The attribute follows the format `hreflang="xx"` for language-only targeting (e.g., `hreflang="en"` for English) or `hreflang="xx-YY"` for language-plus-region targeting (e.g., `hreflang="pt-BR"` for Brazilian Portuguese). Every page in a multilingual set must reference all other versions, including itself, creating a complete bidirectional map that search engines can crawl. A special `hreflang="x-default"` value designates the fallback page for users whose language or region does not match any specified version.
Why It Matters
Without hreflang tags, search engines face two problems with multilingual sites. First, they may display the wrong language version to users — showing an English page to a German speaker, for example — which hurts user experience and increases bounce rates. Second, search engines may treat translated pages as duplicate content and apply ranking penalties, since the pages share similar structure and intent. Correct hreflang implementation solves both issues: it directs each user to the right language version and tells search engines that the translated pages are intentional alternatives, not duplicates. For publishers with international audiences, proper hreflang configuration can significantly improve organic traffic from non-English search markets.
How It Works in FlipLink
FlipLink's marketing site at fliplink.me implements hreflang tags across all localized pages — including the blog, glossary, feature pages, tool pages, and comparison pages — through its [localization](/features/localization) infrastructure powered by next-intl. Each page automatically includes `<link rel="alternate" hreflang="...">` elements pointing to all eight available language versions (English, Italian, Spanish, German, Japanese, Portuguese-BR, Russian, and Dutch), plus an `x-default` pointing to the English version. This ensures that search engines index each translation correctly and serve the right version based on the searcher's language and location. For your own published flipbooks and documents, hreflang applies to your hosting pages rather than the flipbook viewer itself — if you embed a FlipLink publication on a multilingual website, adding hreflang tags to your embedding pages ensures visitors arrive at the correct language version from search results.
Technical Details
Hreflang can be implemented in three ways: as HTML `<link>` tags in the `<head>` section, as HTTP headers (useful for non-HTML files like PDFs), or within an XML sitemap using `xhtml:link` elements. Each approach has trade-offs:
- **HTML link tags** are the most common method and easiest to debug using browser developer tools. They work well for sites with a manageable number of language versions.
- **HTTP headers** are necessary when the content itself is not HTML (e.g., serving a PDF in multiple languages).
- **XML sitemap** entries scale better for sites with hundreds of pages and many language versions, since they avoid bloating the HTML `<head>` section.
Regardless of implementation method, every hreflang annotation must be reciprocal — if page A declares page B as its Spanish alternate, page B must declare page A as its English alternate. Missing reciprocal links cause search engines to ignore the hreflang signals entirely. Language codes must follow ISO 639-1 (two-letter language codes), and region codes must follow ISO 3166-1 Alpha 2 (two-letter country codes).
Common Misconceptions
- **"Hreflang controls which page Google indexes."** It does not. Hreflang influences which version appears in search results for a given locale, but all versions can still be indexed. It is a serving hint, not an indexing directive.
- **"I only need hreflang if I target different countries."** Language-only hreflang (`hreflang="de"` for German) is valid and useful even if you are not targeting specific countries. Use language-plus-region only when you have distinct content for regional variants (e.g., `pt-BR` vs. `pt-PT`).
- **"Hreflang replaces the need for a sitemap."** It does not. Hreflang and sitemaps serve different purposes. Your sitemap tells search engines which pages exist; hreflang tells them how those pages relate across languages.
- **"Machine-translated pages should use hreflang."** Technically they can, but search engines may devalue low-quality translations. Hreflang works best when each language version provides genuinely useful, natural-sounding content.
Frequently Asked Questions
**What happens if hreflang tags have errors?**
Search engines silently ignore invalid hreflang annotations. Common errors include missing reciprocal links, incorrect language codes, and self-referencing pages that omit their own hreflang tag. Use Google Search Console's International Targeting report to identify hreflang errors on your site.
**Do hreflang tags affect page load speed?**
The impact is negligible. Each hreflang `<link>` tag adds roughly 80-120 bytes to the HTML. Even with eight language versions, the total overhead is under 1 KB — far less than a single image.
**Should I use hreflang with canonical tags?**
Yes. Each language version should have a self-referencing canonical tag pointing to itself and hreflang tags pointing to all versions. The canonical tag tells search engines "this is the primary URL for this language version," while hreflang tags connect the versions together.
Related Terms
HTTPS
A secure version of HTTP that encrypts data between the browser and server using SSL/TLS.
iFrame
An HTML element that embeds one web page inside another, commonly used for flipbook embedding.
Internal Linking
Connecting pages within the same website to improve navigation and distribute SEO authority.
JSON-LD
A structured data format using JSON that helps search engines understand page content better.
Lazy Loading
A technique that delays loading page content until it's needed, improving initial load speed.
Available in other languages
Ready to Transform
Your PDFs?
Join thousands of businesses using FlipLink to create engaging, interactive content from their PDFs. Start free — no credit card required.