Set up hreflang for translated pages
Short answer
Add an hreflang annotation on each language version listing every version, including itself. Annotations must be reciprocal, use valid language (and optional region) codes, and point at canonical, indexable URLs.
When you need it
Section titled “When you need it”You need it when the same content exists in more than one language or regional variant, for example /guide/ (English) and /zh-cn/guide/ (Simplified Chinese). It helps Google show the right version. It is not needed for ranking a single-language site.
-
Pick one method — HTML
<link>tags, HTTP headers, or sitemap entries. Google treats them as equivalent. -
List every version on every version, including the page itself:
<link rel="alternate" hreflang="en" href="https://example.com/guide/" /><link rel="alternate" hreflang="zh-CN" href="https://example.com/zh-cn/guide/" /><link rel="alternate" hreflang="x-default" href="https://example.com/guide/" /> -
Use valid codes — ISO 639-1 language, optionally followed by an ISO 3166-1 alpha-2 region (
zh-CN, notcn). -
Add
x-defaultfor the fallback page shown when no version matches.
Verify
Section titled “Verify”- View source on each version and check that the sets of
hreflanglinks are identical. - Each
hrefshould return200, be self-canonical and notnoindex. This is our recommendation; the hreflang guide itself does not state it as a rule.
Common mistakes
Section titled “Common mistakes”- Emitting hreflang for translations that don’t exist — for example a CMS that serves English text under a
/zh-cn/URL as a fallback. Only annotate real translations. (This wiki strips such tags at build time.) - Canonicalizing translations to the English page, which tells Google they are duplicates. See Canonical URL signals.