hreflang International SEO Guide: Tag Language and Region

When your site offers multiple versions of the same content for different languages or regions, you need to tell search engines that these pages are localized variants of each other. Otherwise Google may treat translated versions as duplicates or serve users the wrong language. The hreflang attribute is the official way to annotate language and region variants. Note that Google does not use hreflang or the lang attribute to detect page language — it uses algorithms — but hreflang still helps route the right version to the right user.

In other words, hreflang solves a "distribution" problem, not a "detection" problem: it will not make a page rank better in another language, it only helps search engines pick the more appropriate language version when a user searches. Understanding this avoids unrealistic expectations about what hreflang can do.

When to Use hreflang

Google recommends explicitly annotating alternate versions in these common situations:

  • The main content is in a single language but the template (navigation, footer) is translated, such as forums dominated by user-generated content;
  • The page serves similar content in one language to different regions with subtle regional differences, such as English content aimed at users in the US, UK, and Ireland;
  • The site is fully translated into multiple languages, for example every page has both German and English versions.

Note an important caveat: if the main content is not genuinely translated, the localized version is treated only as a duplicate, and hreflang annotations cannot fix that — a point directly tied to duplicate content management.

Three Ways to Annotate

Google provides three equivalent methods; pick the one that best fits your architecture:

  • HTML <link> tags: add a set of rel="alternate" hreflang="..." links in the <head> of each page.
  • HTTP response headers: effective for non-HTML files such as PDFs, returning all language variants via the Link: header.
  • XML sitemaps: declare all variants of each URL in <xhtml:link> entries, ideal for large sites. See the XML sitemap guide for sitemap syntax.

The trade-offs are straightforward: HTML tags fit template-controlled small-to-medium sites — easy to edit and instantly visible; HTTP headers suit static files or server-generated responses such as PDFs and whitepapers; sitemaps fit multilingual sites with thousands of pages, centralized for batch generation. In practice many teams use "HTML first, sitemap as backup" as a double safety net.

Core Guidelines

Whichever method you choose, follow these rules:

  • Bidirectional links: each language version must list itself and all other versions; if page X links to Y, Y must link back to X, or the annotations may be ignored. This mirrors the logic in the canonical and duplicate content guide.
  • Use fully qualified URLs: include the protocol, such as https://example.com/foo, never relative paths.
  • Use supported codes: language codes follow ISO 639-1 (for example en), region codes follow ISO 3166-1 Alpha 2 (for example US), forming values like en-US. You cannot specify a region alone (be is Belarusian, not Belgium), and reserved codes such as EU or UK are ignored.
  • Provide x-default: when a user's language matches none of your variants, x-default points to a fallback page, ideal for language selector pages.

A Typical Implementation Example

For a site with generic English, British English, US English, and German versions, every page <head> should include:

<link rel="alternate" hreflang="en" href="https://en.example.com/page.html" />
<link rel="alternate" hreflang="en-gb" href="https://en-gb.example.com/page.html" />
<link rel="alternate" hreflang="en-us" href="https://en-us.example.com/page.html" />
<link rel="alternate" hreflang="de" href="https://de.example.com/page.html" />
<link rel="alternate" hreflang="x-default" href="https://www.example.com/" />

If your content is mainly distributed as PDFs, switch to HTTP response headers instead:

Link: <https://en.example.com/file.pdf>; rel="alternate"; hreflang="en",
      <https://de.example.com/file.pdf>; rel="alternate"; hreflang="de",
      <https://www.example.com/file.pdf>; rel="alternate"; hreflang="x-default"

For large sites, declare everything centrally in the sitemap:

<url>
  <loc>https://en.example.com/page.html</loc>
  <xhtml:link rel="alternate" hreflang="en" href="https://en.example.com/page.html" />
  <xhtml:link rel="alternate" hreflang="de" href="https://de.example.com/page.html" />
  <xhtml:link rel="alternate" hreflang="x-default" href="https://www.example.com/" />
</url>

Note that hreflang does not change language detection, and you should only annotate pages whose main content is genuinely translated; if only the template is translated, the localized version is treated as a duplicate.

A troubleshooting case

Suppose a German site launched but Google kept serving users the English version. A check with the Merkle hreflang tester revealed that the German pages listed the English pages, but the English pages never linked back to the German ones — a classic "missing return link." After adding the bidirectional links and resubmitting the sitemap, the share of German users served the correct version rose noticeably within two weeks. The lesson: hreflang correctness must be validated as a whole group; looking at a single page in isolation proves nothing.

Troubleshooting Common Errors

The three most common mistakes are:

  • Missing return links: one variant fails to list the others.
  • Incorrect language codes: specifying only a region, or using unsupported codes such as es-419.
  • Incorrect region codes: using reserved or unassigned codes.

Third-party tools such as hreflang tag generators and the Merkle hreflang tester can quickly validate your markup. For overall architecture, see the website internationalization guide, and for e-commerce, the multilingual e-commerce guide. If your mobile site uses separate URLs, remember mobile hreflang must point only to mobile URLs — see the mobile-first indexing guide.

Source: https://developers.google.com/search/docs/specialty/international/localized-versions
Reference: https://www.sistrix.com/blog/hreflang-tutorial-how-to-hreflang/ (Sistrix hreflang tutorial)