Hreflang Tags
HTML attributes that tell search engines which language and region a page targets.
The Definition
Hreflang tags (rel="alternate" hreflang="x") are HTML link elements or HTTP headers that tell search engines which language and regional version of a page to show to users in different locations. They are essential for international websites that serve content in multiple languages or target different countries.
Why It Matters
Without hreflang tags, search engines may show the wrong language version to users, or treat different language versions as duplicate content. Proper implementation ensures French users see the French page, German users see the German page, and so on.
Best Practices
Include a self-referencing hreflang tag on every language version of a page in addition to the alternate versions
Use correct ISO 639-1 language codes and ISO 3166-1 alpha-2 region codes (e.g., en-US, fr-FR, de-DE)
Ensure every hreflang tag has a corresponding return tag on the target page — missing return tags invalidate the implementation
Include an x-default hreflang tag pointing to a language selector page or your primary language version
Place hreflang tags consistently — either in HTML head, HTTP headers, or sitemap (do not mix methods)
Validate hreflang implementation with specialized tools since manual validation across many pages is error-prone
Mistakes to Avoid
- 1
Missing return tags — if page A declares page B as French, page B must declare page A back
- 2
Using incorrect language or region codes that search engines cannot recognize
- 3
Pointing hreflang tags to non-canonical URLs or pages blocked by robots.txt
- 4
Implementing hreflang without also setting the correct canonical tags, creating conflicting signals
Audit Checks
How Digispot AI identifies and fixes related issues
This international site has no hreflang tags to target different languages/regions.
Impact: Without hreflang, Google may show the wrong-language page and treat variants as duplicates.
Add hreflang tags for every language/region variant. • Include a self-reference and an x-default. • Validate the hreflang set.
One or more hreflang tags have validation errors (bad language codes or missing self-reference).
Impact: Invalid hreflang is ignored, so your language targeting doesn't work.
Use valid ISO language (and region) codes. • Include a self-referencing hreflang on each page. • Validate the full hreflang set.
An hreflang link element appears outside the document <head>.
Impact: Hreflang annotations placed in the body are ignored by Google, silently breaking locale targeting.
Move all hreflang link elements into the document <head>. • Make sure no script injects them into the body after load. • Re-crawl to confirm they are in the head.
One or more hreflang alternates resolve to a non-200 (4xx/5xx/redirect) URL.
Impact: A broken hreflang target de-targets that locale and breaks the language cluster.
Point every hreflang alternate at a live, canonical, 200-status URL. • Fix or remove any alternate that errors or redirects. • Re-validate the hreflang set.
A hreflang code on this page doesn't match the actual language declared on the page it points to (e.g. hreflang="fr-FR" → target page is <html lang="de-DE">).
Impact: When the declared hreflang doesn't match the target's html-lang, search engines may serve the wrong locale in SERPs or drop the cluster entirely.
Update the hreflang code so it matches the target page's html lang attribute. • Or update the target page's html lang to match the hreflang code. • Keep both in sync going forward — they describe the same fact.
One of this page's hreflang alternates points to a page marked noindex — Google can't use it.
Impact: Noindex pages are excluded from search results. Pointing hreflang at one silently de-targets that locale and breaks the cluster.
Remove noindex from the alternate page (if it should be indexed), OR • Remove that hreflang entry and target an indexable equivalent instead. • Re-validate the hreflang cluster.