Blog
International

Hreflang tags explained: show the right page to the right country

September 27, 2026 · 6 min read

If you serve the same content in several languages — or country-specific versions of a page — search engines need help choosing which version to show each visitor. That's what hreflang is for: a small HTML annotation that says "this page has an equivalent in this language or country." Get it right, and a searcher in Germany sees your German page instead of your English one. Get it wrong, and the tags are simply ignored.

Do you even need hreflang?

Hreflang only matters when you have multiple versions of the same page. If your site is English-only, skip it entirely — adding hreflang to a monolingual site does nothing. You need it when:

  • You translate pages into other languages (example.com and example.com/es/).
  • You run country-specific versions with mostly shared content — e.g. a US store and a UK store selling the same products in the same language, with different prices or shipping.

In both cases, without hreflang Google picks one version on its own, and small sites often find the "wrong" one ranking abroad.

What a hreflang tag looks like

In the <head> of each page, one tag per language version — including the page itself:

  • <link rel="alternate" hreflang="en" href="https://example.com/" />
  • <link rel="alternate" hreflang="de" href="https://example.com/de/" />
  • <link rel="alternate" hreflang="x-default" href="https://example.com/" />

The x-default tag is the fallback shown when no language matches — usually your language selector or your main version. Language codes follow ISO 639-1 (en, de, es) and can be combined with an ISO 3166-1 region for country-targeting: en-gb for British English, es-mx for Mexican Spanish.

The three rules Google actually enforces

Hreflang is unforgiving. Ignore these and Google discards the whole cluster:

  • Reciprocity. Every page that points to another version must be pointed back at. If your English page lists the German page, the German page must list the English one — and itself. A one-way hreflang tag is ignored.
  • Self-reference. Each page must include a hreflang tag for itself. Pages that only reference their siblings fail this check.
  • Valid codes and reachable URLs. Language and region codes must be valid ISO codes, and every href in the cluster must return 200. A tag pointing at a redirect or a 404 breaks the cluster's trust.

Mistakes that quietly waste your tags

  • Using the region code as the language. hreflang="uk" means Ukrainian, not the United Kingdom — use en-gb. This is the single most common error we see.
  • Mismatched clusters. Adding a new language to one page but not its siblings leaves the group inconsistent, and Google starts second-guessing all of them.
  • Conflicting canonicals. A page's canonical should point at itself when hreflang is in play. Canonicalizing every language version to the English original cancels the hreflang out.
  • Blocking translated pages in robots.txt. If crawlers can't fetch a URL, they can't verify its hreflang tags.

Where to put the tags

For typical sites, in the <head> of the HTML as shown above. Google also accepts hreflang in the HTTP header (for non-HTML files like PDFs) and in your XML sitemap via the xhtml:link extension — the sitemap route scales better once you pass a handful of languages, since every tag lives in one file instead of repeated on every page.

Try it yourself

Build a valid, reciprocal set of tags with the Hreflang Generator — it handles the language/region codes and self-references for you, and flags missing return links. Then read XML sitemaps: help search engines find the right pages if you plan to put your hreflang annotations in the sitemap instead of the page head.

Discussion

Share an SEO tip or ask how to use one of the tools. No account needed.

0/2000

Loading comments…