01Three ways to declare it
Google accepts hreflang in HTML <link rel="alternate"> tags, in HTTP headers, or in the XML sitemap [1]. Use one method per cluster; mixing them is how two sources end up disagreeing.
<link rel="alternate" hreflang="de"The usual choice, and the only one visible in view-source.
href="https://site.com/de/produkt">
<url>Keeps the head small when a cluster has twenty languages [1].
<loc>https://site.com/product</loc>
<xhtml:link rel="alternate"
hreflang="de" href="…/de/produkt"/>
</url>
02Codes must be valid
Google requires valid codes and ignores annotations it cannot parse [1]. The region half is optional and the language half is not, which is the opposite of what most people assume.
uk is Ukrainian while the United Kingdom is gb. Region-only codes are not valid at all. Which standard applies where →hreflang="en" → English, anywhereLanguage first, region second, both from the standard lists [1].
hreflang="en-gb" → English, UK
hreflang="pt-br" → Portuguese, Brazil
hreflang="x-default"
hreflang="uk" → Ukrainian, not UKEach looks plausible and does nothing. The first is the expensive one: it sends UK traffic a Ukrainian page.
hreflang="en-UK" → the code is GB
hreflang="gb" → not a language
hreflang="de-DE-formal" → a CMS locale
03Hreflang is a hint about audience
Hreflang helps Google serve the right version to the right user; it is not a guarantee and it does not override relevance [1]. All versions stay indexed and any of them can rank for any query.
German searcher → /de/produkt preferredA preference applied when Google already decided to show your page.
French searcher → /fr/produit preferred
• rank the pages higherThe last one is the common confusion: that is what canonicals are for [3].
• stop /de ranking in France
• redirect anybody
• consolidate duplicates
04Keep canonicals consistent
Every page in a cluster should carry a self-referencing canonical, and hreflang should point at canonical URLs [1][3]. Canonicalising translations to one language removes them from the index.
<!-- on /de/produkt -->The canonical withdraws the page the hreflang just nominated.
<link rel="canonical" href="/product">
<link rel="alternate" hreflang="de"
href="/de/produkt">
→ "index /product" and "/de is the German one"
<link rel="canonical" href="/de/produkt">Self-canonical, then the annotations. Translations are not duplicates [3].
→ plus the full hreflang cluster
05The return tag is the whole mechanism
Annotations must be confirmed from both ends [1]. This is the single most common hreflang fault, and it cannot be seen from either page alone.
/product → names /de/produktUsually a page added later, or a template that only runs on the default language.
/de/produkt → names nothing
→ the pair is not confirmed
/product → names /de/produkt + itselfEvery page lists the whole cluster, itself included [1].
/de/produkt → names /product + itself
→ the pair holds
06x-default is the fallback, not the default language
Google uses x-default for users whose language or region matches none of the annotations [1]. It is optional, and it is misread more often than it is missing.
Japanese searcherA catch-all, usually the international or language-selection page.
→ no ja annotation exists
→ gets the x-default page
x-default → "this is our main language"It can point at the same URL as your
x-default → "this is the homepage"
→ neither is what it means
en page; that is a coincidence, not the definition.07Annotations must point at live URLs
An annotation pointing at a redirect, an error or a noindex page cannot be confirmed, so the pair is dropped [1][3]. The tag still looks right in the source, which is why this survives so long.
hreflang="de" → /de/alt → 301Three valid-looking tags, three unconfirmable pairs.
hreflang="fr" → /fr/old → 404
hreflang="es" → /es/draft → noindex
old: /de/produkt → 301Moving one language quietly breaks the cluster from every other page.
new: /de/produkte
→ every other page still names the old URL
08Same language, different region
Region variants are what hreflang exists for: the content is almost the same, so without annotations Google may pick one and show it everywhere [2]. With them, each market gets its own.
hreflang="en" → /shopA bare
hreflang="en-gb" → /uk/shop
hreflang="en-us" → /us/shop
hreflang="en-au" → /au/shop
en alongside the regional ones catches English speakers elsewhere [2].prices in the local currencyIf nothing differs but the URL, you have duplicates and want a canonical instead [3].
shipping and returns that differ
spelling, sizes, legal copy
References
- [1]Tell Google about localized versions of your page · Google Search Centraldevelopers.google.com/search/docs/specialty/international/localized-versions
- [2]Managing multi-regional and multilingual sites · Google Search Centraldevelopers.google.com/search/docs/specialty/international/managing-multi-regional-sites
- [3]How to specify a canonical URL with rel="canonical" and other methods · Google Search Centraldevelopers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
- [4]Build and submit a sitemap · Google Search Centraldevelopers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap