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.
| Method | Best for | Watch out for |
|---|---|---|
| HTML link elements | Small to mid-size sites | Page weight when there are many versions |
| HTTP headers | PDFs and other non-HTML files | Header size limits on large sets |
| Sitemap entries | Large sites, many locales | Kept in sync with the pages themselves |
<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.
| Code | Verdict | Why |
|---|---|---|
| en | Valid | Language only — English, any region |
| en-GB | Valid | English as written for the United Kingdom |
| GB | Invalid | Region without a language |
| uk | Valid, but not the UK | uk is Ukrainian; the UK is GB |
| eu | Invalid as a region | The EU is not a country code |
| en-UK | Invalid | The 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.