# Set up hreflang for translated pages

> 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.

- URL: https://geo.casa/crawling-indexing/hreflang/
- Guide · Officially documented
- Reviewed: 2026-10-24

## 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.

## Steps

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:**

   ```html
   <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.

> **Officially documented:**
> If two pages don't both point to each other, the tags will be ignored. Each language version should list itself as well as all other versions.
>
> Sources: [Google Search Central: Tell Google about localized versions of your page](https://developers.google.com/search/docs/specialty/international/localized-versions)

## Verify

- 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.

## 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](https://geo.casa/crawling-indexing/canonical-signals/).

## Sources

- [Google Search Central: Tell Google about localized versions of your page](https://developers.google.com/search/docs/specialty/international/localized-versions)
