hreflang
hreflang maps language/region equivalents so search engines show the right page version and avoid cross-language cannibalization.
Definition
hreflang is a language/region annotation via <link rel="alternate" hreflang="..."> that connects equivalent pages in different languages or regions. It helps search engines serve the correct version to users.
Why it matters
- Reduces cross-language cannibalization
- Improves language/region targeting accuracy
- Helps crawlers understand your locale structure
- Improves UX (auto-redirect to correct language)
- Prevents Google from treating language variants as duplicate content
- Supports same-language regional variants (e.g., en-US vs en-GB)
- Works with canonical to fully describe page relationships
How to implement
- Declare alternates bidirectionally on every locale version
- Include an x-default fallback version
- Keep canonical self-referential; hreflang is not a canonical replacement
- Use ISO 639-1 language codes (en, zh) + optional ISO 3166-1 region (US, TW)
- Place in HTML head, HTTP header, or sitemap (sitemap for large sites)
- Ensure all alternate URLs return 200 and confirm each other
- Validate hreflang setup regularly (Search Console reports errors)
Examples
html
<!-- HTML head implementation -->
<link rel="alternate" hreflang="en" href="https://example.com/en/about" />
<link rel="alternate" hreflang="zh-TW" href="https://example.com/about" />
<link rel="alternate" hreflang="ja" href="https://example.com/ja/about" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/about" />
<link rel="canonical" href="https://example.com/about" /> <!-- self-referencing -->xml
<!-- sitemap implementation (for large multilingual sites) -->
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://example.com/about</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/about" />
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://example.com/about" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/about" />
</url>
</urlset>Related
Tutorials
Tools
FAQ
Common questions about this term.