Skip to content

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.

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.

  1. Pick one method — HTML <link> tags, HTTP headers, or sitemap entries. Google treats them as equivalent.

  2. 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/" />
  3. Use valid codes — ISO 639-1 language, optionally followed by an ISO 3166-1 alpha-2 region (zh-CN, not cn).

  4. Add x-default for the fallback page shown when no version matches.

  • View source on each version and check that the sets of hreflang links are identical.
  • Each href should return 200, be self-canonical and not noindex. This is our recommendation; the hreflang guide itself does not state it as a rule.
  • 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.

Sources

  1. Tell Google about localized versions of your pageGoogle Search Central · official · ✓ 2026-10-24