FREE SEO AUDIT
Hreflang Tags: Examples, Common Mistakes, and a Free Generator
Everything you need to implement hreflang correctly: syntax, reciprocal link rules, x-default, common mistakes, and a free hreflang generator and checker.
Published July 12, 2026 · 7 min read
Hreflang is one of the most error-prone areas of international SEO. The implementation looks simple — add a few <link> tags — but the rules around reciprocal declarations, correct locale codes, and x-default are exacting. One broken link in your hreflang cluster and Google ignores the whole thing. This guide covers correct hreflang syntax, real examples, the most common mistakes, and how to check your implementation is working.
What is a hreflang tag?
A hreflang tag tells search engines which version of a page is intended for which language and region. It is used when you have multiple versions of a page for different audiences — for example, English for the US, French for France, and Spanish for Mexico.
<link rel="alternate" hreflang="en-US" href="https://example.com/en/page" />
<link rel="alternate" hreflang="fr-FR" href="https://example.com/fr/page" />
<link rel="alternate" hreflang="es-MX" href="https://example.com/es-mx/page" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/page" />
Without hreflang, Google has to guess which version to show to which audience. It often gets it wrong: French users see the English page, or the wrong regional variant ranks in the wrong country. Hreflang solves this by making the relationships explicit.
What is x-default?
x-default is a special hreflang value that specifies the fallback page for users whose language or region doesn't match any explicitly targeted version. It typically points to your main language version or a language-selection page.
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
Including x-default is technically optional but strongly recommended. Without it, Google must decide what to show users from countries you haven't explicitly targeted, and the result is often a suboptimal match.
What hreflang locale codes are valid?
Hreflang uses BCP 47 language tags. The two most common formats are:
Language only (targets all regions where that language is spoken):
en (English — any region)
fr (French — any region)
de (German — any region)
Language + region (targets a specific country):
en-US (English, United States)
en-GB (English, United Kingdom)
en-AU (English, Australia)
fr-FR (French, France)
fr-CA (French, Canada)
pt-BR (Portuguese, Brazil)
pt-PT (Portuguese, Portugal)
zh-TW (Chinese Traditional, Taiwan)
zh-CN (Chinese Simplified, China)
Common error: Using underscores instead of hyphens — en_US is wrong; en-US is correct. Google's parser is strict about this.
What is the reciprocal link rule?
This is the most-violated hreflang requirement. Every page in a hreflang cluster must link to every other page in that cluster — including a self-referencing link back to itself.
If you have three pages — EN, FR, DE — the hreflang cluster on each page must list all three:
On the English page:
<link rel="alternate" hreflang="en" href="https://example.com/en/page" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/page" />
<link rel="alternate" hreflang="de" href="https://example.com/de/page" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/page" />
On the French page (must include all three):
<link rel="alternate" hreflang="en" href="https://example.com/en/page" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/page" />
<link rel="alternate" hreflang="de" href="https://example.com/de/page" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/page" />
On the German page (must include all three):
<link rel="alternate" hreflang="en" href="https://example.com/en/page" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/page" />
<link rel="alternate" hreflang="de" href="https://example.com/de/page" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/page" />
If the French page doesn't link back to the English page's hreflang declaration, Google treats the entire cluster as invalid and ignores all three pages' hreflang.
Where do hreflang tags go?
Three implementation methods are supported:
1. HTML <head> (most common):
<head>
<link rel="alternate" hreflang="en-US" href="https://example.com/en/page" />
<link rel="alternate" hreflang="fr-FR" href="https://example.com/fr/page" />
</head>
2. HTTP response header (useful for PDFs or non-HTML files):
Link: <https://example.com/en/page>; rel="alternate"; hreflang="en-US"
Link: <https://example.com/fr/page>; rel="alternate"; hreflang="fr-FR"
3. XML sitemap (useful for large sites where editing every page's head is impractical):
<url>
<loc>https://example.com/en/page</loc>
<xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/en/page" />
<xhtml:link rel="alternate" hreflang="fr-FR" href="https://example.com/fr/page" />
</url>
For the sitemap method, note you still need to include the full cluster — all pages link to all pages — but you do it in the sitemap rather than in each page's HTML.
What are the most common hreflang mistakes?
Mistake 1: Missing reciprocal links
The most common mistake by far. If page A hreflang-points to page B but page B doesn't hreflang-point back to page A, Google ignores the entire cluster. The hreflang checker in the DeepSEOAnalysis audit, or the dedicated hreflang generator tool, validates that reciprocal links are consistent.
Mistake 2: Wrong locale code format
en_US → wrong (underscore). en-US → correct (hyphen). Same for fr_FR → fr-FR, pt_BR → pt-BR. Google's parser is strict; an underscore makes the tag invalid.
Mistake 3: Canonical conflicts
A page can have a canonical pointing to a different URL while also having hreflang tags. This is valid — but the canonical must point to the correct version (usually itself), not to the main-language version. A common mistake is canonicalizing all regional pages to the English page, which tells Google the English page is the only real version and effectively nullifies the hreflang cluster.
Mistake 4: Using hreflang for the same language with different content
Hreflang is for language and region targeting, not for A/B test variants, content experiments, or personalized pages. Using hreflang to alternate between different-content versions of the same page confuses crawlers and can cause indexing problems.
Mistake 5: Forgetting hreflang on newly added pages
When you add a new translated version of a page, you must update the hreflang cluster on every existing language version of that page. Forgetting one means the new page's hreflang declarations are unreciprocated — and Google ignores them.
How do I generate correct hreflang tags?
Use the free hreflang generator tool. You input your pages and their language/region combinations, and the tool generates:
- The complete
<link rel="alternate">tag cluster for each page's<head> - Self-referencing links included
x-defaultadded automatically- Correct BCP 47 locale code format (hyphens, not underscores)
- Copy-paste ready for each page
For sites with many translated pages, the tool generates the full cluster rather than requiring you to construct each tag manually.
How do I verify my hreflang implementation is working?
Three checks:
1. The full audit — run a site audit. It validates hreflang format, checks for reciprocal consistency across all crawled pages, and flags missing x-default declarations.
2. Google Search Console — the International Targeting report shows hreflang errors detected by Google. Common error types shown: "No return tags" (missing reciprocal), "Unknown language tag" (invalid locale code), "No tag with x-default" (missing fallback).
3. Manual spot check — for a single page, view source and search for hreflang. Confirm every language version you've published is in the cluster, that the locale codes use hyphens, and that x-default is present.
Does hreflang affect rankings?
Hreflang doesn't directly boost rankings. What it does is ensure the correct language version of your page appears in the correct country's search results. Without it, you might rank the English page in France, a French page in the US, or multiple regional variants competing against each other in the same market — all of which reduce CTR and effectiveness.
For sites with meaningful non-English traffic, correctly implemented hreflang typically improves organic CTR in targeted markets by 15–30%, simply because users see content in their own language rather than having to click through to a page they then translate.
For sites where GSC shows negligible non-English traffic, hreflang implementation provides no benefit and may add maintenance overhead. The full audit scores hreflang only on sites where the signal is relevant.
FAQ
Does hreflang work for all search engines?
Google and Yandex respect hreflang. Bing does not — it uses its own lang attribute detection and content-language HTTP headers for geotargeting. For Bing international SEO, focus on the Content-Language response header and the lang attribute on the <html> element.
Can I use hreflang for different content in the same language?
No. Hreflang is for language and region targeting only. If you have an English page with different content for US vs UK audiences, hreflang is appropriate (en-US vs en-GB). If you have different content for different user segments within the same language and region, hreflang is not the tool.
What if my site has hundreds of pages in multiple languages?
The sitemap-based implementation method scales better than page-level <head> tags for large sites. You maintain the hreflang cluster in the sitemap XML, where you can generate it programmatically from your CMS, rather than managing hundreds of individual page templates.
How long does it take for hreflang changes to take effect? Google re-crawls pages and processes hreflang on a regular cycle — typically days to a few weeks for sites with moderate crawl frequency. After adding or fixing hreflang, use the International Targeting report in Search Console to confirm Google has processed the changes.
MORE FROM THE BLOG
Related articles
8 min read
WordPress SEO Audit: The 12 Checks That Matter
A practical WordPress SEO audit framework covering the 12 issues that actually hurt rankings — from slow theme bloat to plugin-generated duplicate content.
Read →6 min read
Website SEO Checker: How Ours Works and Why It's Free
A transparent look at how the DeepSEOAnalysis website SEO checker works — what it checks, how it scores results, and why the full audit is free with no email gate.
Read →7 min read
SERP Preview: How Google Displays Your Title and Meta Description
How Google renders title tags and meta descriptions at pixel widths — not character counts — and how to preview and fix truncation before it hurts your CTR.
Read →Run DeepSEOAnalysis on your own site.
Free, no signup. Technical SEO, Core Web Vitals, structured data, and AI visibility in one report.
Run a free audit →