March 8, 2026·5 min read·By NitroSERP Editorial Team
Updated
Hreflang Tags: 2026 Setup, ISO Codes & x-default Guide
Implement hreflang correctly with reciprocal return links, valid language and region codes, self-referencing canonicals, and x-default examples.
hreflang tags (<link rel="alternate" hreflang="lang-region" href="https://..." />) are HTML or XML annotations that tell Google which language and regional URL version of a page to display to searchers in different countries. Whether you translate content into multiple languages (en, es, de) or serve regional variants of the same language with local currency and shipping (en-US, en-GB, en-AU), proper hreflang implementation prevents the wrong country's URL from ranking in local SERPs.
You can generate a complete, reciprocal <link rel="alternate" hreflang="..."> cluster in seconds using our free hreflang tag generator.
The 3 Iron Rules of Hreflang Architecture
Most broken hreflang clusters come from violating one of these three rules required by Google's localized versions specification:
1. Bidirectional Reciprocity (Return Links Are Mandatory)
If Page A (en-US) includes a hreflang link pointing to Page B (de-DE), then Page B must include a matching hreflang link pointing back to Page A. If Page B does not link back, Google ignores the annotation to prevent third parties from hijacking rankings for arbitrary foreign pages.
2. Self-Referencing Annotations on Every URL
Every page in a language cluster must include a hreflang tag pointing to itself alongside its siblings. Because every URL in the cluster lists itself plus all alternates, the <link rel="alternate" hreflang="..."> block is 100% identical across every page in that cluster.
3. Self-Referencing Canonical Tags (Never Cross-Canonicalize Locales!)
Each localized URL must have a <link rel="canonical"> tag pointing to its own localized URL (use our canonical URL generator to verify).
- Correct:
https://example.com/uk/pricinghas<link rel="canonical" href="https://example.com/uk/pricing" />. - Fatal Error: Pointing
/uk/pricingor/de/preisecanonical tags to/us/pricingtells Google the UK and German pages are duplicates that should be de-indexed.
Copy-and-Paste Reciprocal HTML <head> Example
Suppose your pricing page exists in US English, UK English, German, and Spanish. Place this exact same 5-line block inside the <head> of all four URLs:
<link rel="alternate" hreflang="en-US" href="https://www.example.com/us/pricing" />
<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/pricing" />
<link rel="alternate" hreflang="de-DE" href="https://www.example.com/de/preise" />
<link rel="alternate" hreflang="es" href="https://www.example.com/es/precios" />
<link rel="alternate" hreflang="x-default" href="https://www.example.com/us/pricing" />
Notice how:
- Both
en-USanden-GBuse language + region codes to separate USD ($) from GBP (£). estargets all Spanish speakers globally regardless of country.x-defaultpoints to the global fallback URL (/us/pricing) for users in countries not explicitly listed (such as Japan or Brazil).
Valid ISO 639-1 (Language) & ISO 3166-1 Alpha-2 (Region) Codes
hreflang values always follow the format language or language-REGION. A region code can never be used by itself without a language prefix:
| Target Locale | Valid hreflang Code | Invalid Code (Common Mistake) | Why the Invalid Version Fails |
|---|---|---|---|
| United Kingdom (English) | en-GB | en-UK | UK is not an assigned ISO 3166-1 Alpha-2 code; Great Britain is GB |
| European Union | en / fr / de | en-EU | EU is not a valid country code in hreflang; target languages instead |
| Latin America (Spanish) | es-MX, es-AR, or es | es-LA / es-419 | Google hreflang requires 2-letter ISO 3166-1 Alpha-2 country codes (LA is Laos!) |
| Traditional vs Simplified Chinese | zh-Hant / zh-Hans (or zh-TW / zh-CN) | zh-CHS | Use ISO 15924 script codes (Hans/Hant) or specific ISO country codes |
| Global / Language Selector | x-default | default | Must include the x- prefix |
Where to Implement Hreflang: HTML <head> vs XML Sitemap vs HTTP Headers
Google supports three equivalent placement methods (choose one to avoid maintenance drift):
| Implementation Method | Best For | Pros | Cons |
|---|---|---|---|
1. HTML <head> Tags | Small-to-medium sites (2–10 locales) | Easy to inspect in View Page Source; generated directly by our hreflang tag generator | Adds HTML byte weight if a page has 40+ country versions |
2. XML Sitemap (xhtml:link) | Large enterprise & e-commerce sites (15+ locales) | Keeps HTML <head> lightweight; centralized in sitemap.xml | Harder to debug manually without a crawler |
| 3. HTTP Response Header | Non-HTML files (PDFs, downloadable docs) | Works on binary files that have no HTML <head> | Requires server/CDN header configuration |
Pre-Launch International SEO QA Checklist
- Generate your cluster: Build your
<link rel="alternate" hreflang="...">tags in the free hreflang tag generator. - Verify
200 OKstatus on every alternate URL: Never point ahreflangattribute to a301redirect or404page. - Confirm self-referencing canonicals: Check that each locale points its
<link rel="canonical">to itself using the canonical URL generator. - Include all localized URLs in your sitemap: Add every regional URL to your
sitemap.xmlwith the XML sitemap generator and review our XML sitemap best practices guide. - Avoid automatic IP redirects for Googlebot: Because
Googlebotcrawls primarily from US IP addresses (plus local crawlers), forcibly redirecting all non-UK IPs away from/uk/prevents Googlebot from ever crawling your UK pages! Use a dismissible country switcher banner instead of forced geo-IP redirects.