Skip to main content
← All guides

Hreflang

Hreflang tells an engine that several pages are the same content for different audiences, so it can serve the right one. It is a signal it may decline to follow, not a directive it must obey.

Four rules that keep the set interpretable

Google checks hreflang relationships between URLs. If X points to Y but Y does not return the link, Google may ignore that relationship while still processing other pairs that point to each other. Aim for complete, self-referencing sets so every intended audience relationship is covered.

  • Complete: every version in the group lists every other version.
  • Mutual: if X points to Y, Y should point back to X. Missing return links can cause annotations to be ignored or interpreted incorrectly.
  • Self-referencing: each page lists itself alongside the others.
  • Valid: the codes must parse as real language and region codes.

The mutuality rule is the one that catches teams, because hreflang describes relationships between pages rather than a property of one page in isolation. Roll out corresponding return links together so each published relationship is complete when Google crawls either side.

Where to put the annotations

Three placements are available and they are equivalent in effect. Pick one and use it everywhere — mixing them across a site is how sets end up half-declared.

MethodBest forWatch out for
HTML link elementsSmall to mid-size sitesPage weight when there are many versions
HTTP headersPDFs and other non-HTML filesHeader size limits on large sets
Sitemap entriesLarge sites, many localesKept in sync with the pages themselves
HTML link elements
<link rel="alternate" hreflang="en" href="https://example.com/guide/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/guide/" />
<link rel="alternate" hreflang="pt-br" href="https://example.com/pt-br/guide/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/guide/" />

Note that the English page in that sample lists itself. That is the self-reference. It can look redundant when someone tidies a template, but Google asks each language version to include itself.

Codes, and the ones that don't exist

Language codes use ISO 639-1, optionally followed by an ISO 3166-1 Alpha 2 region. A region alone is not valid: you cannot target Canada without specifying a language. Google also supports script codes such as zh-Hans and zh-Hant (ISO 15924), optionally with a region.

CodeVerdictWhy
enValidLanguage only — English, any region
en-GBValidEnglish as written for the United Kingdom
GBInvalidRegion without a language
ukValid, but not the UKuk is Ukrainian; the UK is GB
euInvalid as a regionThe EU is not a country code
en-UKInvalidThe country code for the UK is GB

What x-default is for

x-default catches the languages you did not list. It is the fallback for a visitor whose language matches none of your versions, and its natural home is a selector page or a home page that routes visitors by itself.

It is not a way to nominate a primary version. Pointing x-default at your English page because English feels like the default tells the engine that English is what an unmatched Japanese or Turkish visitor should get, which may be true and is worth deciding deliberately rather than by habit.

Hreflang and canonical are different jobs

These two get tangled more than any other pair in technical SEO. A canonical is a strong hint about which URL should represent duplicate or very similar pages; hreflang signals which language or region variant suits a searcher. Neither is an absolute indexing instruction.

Point a German translation's canonical at the English page and Google may select the English URL instead, limiting the German page's independent visibility and complicating its hreflang relationships. Distinct translated pages should generally use self-referencing canonicals and reciprocal hreflang. For near-duplicate regional pages in the same language, Google advises choosing a preferred canonical in that language.

Try it on your own site

URL Slug Generator: Clean, Readable Links in Seconds — Turn a page title into a lowercase URL slug with hyphens. Keep accented and non-Latin letters, preview changes live and copy the result. Free, private and browser-only.

Questions and answers

Does hreflang fix duplicate content across languages?

It is a targeting signal, not a duplicate-content fix. Translations are not duplicates; hreflang tells the engine which translation belongs to which audience.

Why is the wrong language version ranking?

Check return links, language and region codes, canonical choices, and the page's actual language. Google can ignore a nonreciprocal pair while still processing other valid reciprocal pairs; it detects language from the content, not the hreflang code.

Do I need hreflang if all my pages are in one language?

Use it when separate URLs target different regions, such as en-GB and en-US, even if their content is very similar. One language version for one audience does not need it.

Should each page canonicalise to itself or to the original language?

For distinct translations, use self-referencing canonicals rather than pointing to the source language. Canonicals are strong hints, not commands; a cross-language canonical risks hiding a translation as a separate result. For near-duplicate same-language regional pages, choose a preferred canonical in that language.

Where should x-default point?

At whatever should serve a visitor whose language you do not publish — usually a selector page or a self-routing home page. It nominates a fallback, not a primary version.

Is hreflang a ranking factor?

No. It is a targeting signal that helps the right version reach the right audience. It does not raise how a page ranks, and Google may decline to follow the annotations at all.