Skip to content

How to set up hreflang for multilingual sites

SEO2 min readFixes 4 checks hreflang-return-links-site, hreflang-return-links, hreflang-valid-pairs, hreflang-alternates-reachable

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 4 checks and the other 189, free, in about 45 seconds.

Or run only this check with the free Hreflang generator or the free Hreflang checker.

What it is

hreflang is an attribute that tells search engines which language, and optionally which country, each version of a page is written for, so they show the right version to each searcher. It is written as <link rel="alternate" hreflang="de-AT" href="…"> in the head, in an HTTP header or in the XML sitemap.

It only works as a complete set: every version must list every other version and itself, with valid ISO language codes and optional region codes, and every listed URL must answer 200. When one link back is missing, Google ignores that pair and visitors may land on the wrong language.

OK looks like this: each language version carries the same full list of alternates, including itself, at most one x-default, and each version's canonical points to itself. getReport checks the codes, the return links and whether each alternate loads.

What a passing site looks like

  • Every language version your pages list links back to themwarning · −2 ptseffort M
  • 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

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

How to fix it.
  1. Use valid codes (language, optionally a region; for example "en", "en-GB", "de-AT") and at most one "x-default".
  2. Include this page's own URL in its hreflang set, and list the same set on every version.

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

How to fix it.
  1. Point each hreflang entry at a live URL that answers 200 directly (no redirect).
  2. Remove entries for language versions you no longer publish.

Questions people ask

Where should hreflang go, in the HTML, an HTTP header or the sitemap?

Any one of the three works, and Google treats them the same. Link tags in the head suit most sites; the HTTP header is for PDFs and other files without HTML; the XML sitemap suits large sites, because it keeps every set in one file. Pick one method, since two that disagree make the result unpredictable.

Should hreflang URLs match the canonical?

Yes. Each language version should have a canonical tag pointing to itself, and hreflang should list those same canonical URLs. If a French page canonicalises to the English page, Google treats it as a duplicate and ignores its hreflang. Never point all language versions' canonicals at one version.

What is hreflang x-default?

x-default is a special hreflang value for the page to show when no listed language or region matches the searcher, often a language picker or the international English version. It is optional, you use it at most once per set, and it must appear on every page in the set like the other alternates.

What are hreflang return tags?

Return tags are the links back: if page A lists page B as an alternate, page B must list page A too. Google only trusts a pair when both sides confirm it, so a missing return tag makes it ignore the pair. Generating all tags from one list in your CMS or sitemap keeps them in sync.

Filed under Technical SEO. Copy is generated from the same catalogue that scores every report, so what you read here is what the report says.