Do you need hreflang?
| Your site | Hreflang? |
|---|---|
| One language, one country | No |
| Same language, different countries with real differences (prices, spelling, delivery) | Yes, for example en-US, en-GB, en-AU |
| Different languages | Yes |
| Machine-translated copies with no real local value | Fix the content first. Tags do not make thin pages useful |
| Only the navigation is translated, the main content is not | No. Google treats the page by its main content language |
Google does not use hreflang or the HTML lang attribute to work out a page's language. It detects language from the content (Google, localized versions, updated September 21, 2026). Hreflang only tells Google which variants belong together.
Three ways to add hreflang
Google treats all three the same. Pick one and use only that one.
| Method | Where | Best for | Watch out for |
|---|---|---|---|
HTML <link> tags | In the <head> of every version | Most CMS sites with a few languages | Page weight with many versions; tags must be in the head |
HTTP Link header | Server response | PDFs and other non-HTML files | Hard to audit without curl |
| XML sitemap | <xhtml:link> entries per URL | Large sites, many versions | Every URL must list every alternate, including itself |
An HTML example for a page in US English, UK English and German:
<link rel="alternate" hreflang="en-us" href="https://northwind-outdoors.com/us/tents/" />
<link rel="alternate" hreflang="en-gb" href="https://northwind-outdoors.com/uk/tents/" />
<link rel="alternate" hreflang="de" href="https://northwind-outdoors.com/de/zelte/" />
<link rel="alternate" hreflang="x-default" href="https://northwind-outdoors.com/tents/" />The exact same four lines go on all four pages. That covers self-references and return links in one go.
Valid and invalid codes
| Code | Valid? | Why |
|---|---|---|
en | Yes | Language only |
en-GB | Yes | Language plus region. Case does not matter |
de-CH | Yes | German for Switzerland |
zh-Hant or zh-Hans-US | Yes | Script variants are allowed |
en-UK | No | The ISO region code for the United Kingdom is GB |
en-EU | No | EU is not a country code |
GB or us | No | Region alone is not allowed: the language must come first |
x-default | Yes | Reserved value for the fallback page |
Google lists missing return links, region-only codes and invalid region codes like EU, UN and UK as the common mistakes.
The rules, as a checklist
- Self-reference: each page lists itself.
- Complete set: each page lists every other version of the same content.
- Return links: if page A points to page B, page B must point back to A. If not, Google may ignore the pair.
- Absolute URLs: full
https://addresses, not relative paths. - Indexable targets: every URL in the set returns 200, is not noindex and is its own canonical.
- Canonical stays in its language: the German page's canonical points to the German page, never to the English one. Pointing all versions at one canonical tells Google they are duplicates and only one gets indexed.
- x-default: add one for your language picker or global page.
- One method: do not mix head tags and sitemap entries that disagree.
For same-language regional pages that are near duplicates (en-US and en-GB with the same text), Google recommends using rel="canonical" plus hreflang so the right regional URL is shown (Google, multi-regional sites, updated December 10, 2025).
The 8 most common hreflang errors and how to fix them
| Error (as crawlers report it) | What it means | Fix |
|---|---|---|
| No return tags | B does not point back to A | Output the same full set on every version |
| Missing self-reference | A page leaves itself out | Add its own line |
| Invalid language or region code | en-UK, en-EU, uk for Ukrainian mixed up with UK | Use ISO 639-1 and ISO 3166-1 Alpha 2 (Ukrainian is uk, the UK is GB) |
| Hreflang to a redirect | The URL in the tag 301s | Use the final URL |
| Hreflang to a noindex or 404 page | Target is not indexable | Fix the page or remove it from the set |
| Hreflang and canonical conflict | Canonical points to another language | Self-canonical per version |
| Relative URLs | /de/zelte/ instead of the full URL | Absolute URLs |
| Tags outside the head | A script or an unclosed tag pushes them into the body | Put them early in the head and validate the HTML |
Do not auto-redirect by IP or browser language
Google says to avoid automatically redirecting users from one language version to another, and not to use IP analysis to adapt content. Most Google crawls come from the US, so an IP redirect can hide your other versions from Googlebot. Show a banner that suggests the local version instead, and let people choose.
How to test
- Crawl the site with a crawler that has an hreflang report (Screaming Frog, Sitebulb). Filter for missing return links, invalid codes and non-200 targets.
- Spot check with
curl -s URL | grep hreflangon one page per template. - In Search Console, use URL Inspection on a few versions and check the Google-selected canonical stays in the right language.
- Watch Performance > Countries for the version Google shows in each market.
How to use this with an AI assistant
Connect SEOmatic at https://seomatic.ai/mcp and ask: "Sign me in with connect_seomatic, then use gsc_indexing (action: batch_inspect) on my English, UK and German versions of /tents/ and tell me if Google picked a canonical in the wrong language." SEOmatic does not crawl a whole hreflang set, so pair it with a crawler's hreflang report.
More from the technical SEO checklist
- The checklistTechnical SEO Checklist (2026)
- Guiderobots.txt for AI Crawlers: Which to Allow and Which to Block
- GuideHow to Fix INP (Interaction to Next Paint)
- GuideHow to Do a Technical SEO Audit, Step by Step (2026)
- GuideJavaScript SEO Checklist for React, Next.js and Single-Page Apps
- GuideStructured Data Checklist 2026: What Still Earns a Rich Result


