How to set up hreflang for multilingual sites
hreflang tags tell Google which language and country each version of a page serves. They must be reciprocal and include the page itself.
Step by step, with screenshots: hreflang in sitemaps vs in HTML: pick one and keep it consistent →
Check your own site
Runs these 3 checks and the other 184, free, in about 45 seconds.
What a passing site looks like
- Every hreflang alternate links back to this pagewarning · −1.5 ptseffort M
- hreflang tags are complete and validwarning · −1.5 ptseffort M
- Every hreflang alternate returns HTTP 200warning · −1 ptseffort S
1. hreflang return links
Why it matters. hreflang only works when every version lists every other version, including itself. An alternate that does not point back makes Google ignore the pair, so visitors get the wrong language.
- On each alternate page, add a <link rel="alternate" hreflang="…"> for this page and for itself.
- Generate the tags from one list (CMS, plugin or the XML sitemap with xhtml:link) so every page carries the same set.
2. hreflang tags are incomplete or invalid
Why it matters. hreflang tells Google which language or country version to show each searcher. A missing self-reference or an invalid code makes the whole set ignored, so visitors land on the wrong version.
- Use valid codes (language, optionally a region; for example "en", "en-GB", "de-AT") and at most one "x-default".
- Include this page's own URL in its hreflang set, and list the same set on every version.
3. hreflang alternates status
Why it matters. An alternate that answers 404 or redirects is dropped from the hreflang set, and the whole set can be ignored. Old language versions are often removed without updating the tags.
- Point each hreflang entry at a live URL that answers 200 directly (no redirect).
- Remove entries for language versions you no longer publish.