Hreflang
HTML attribute telling search engines which language and region a page targets.
What is Hreflang?
Hreflang is an HTML attribute that tells search engines which language and regional version of a page to show users. It's used for multilingual and multi-regional sites to serve the right content to the right users.
Hreflang annotations work bi-directionally - if page A references page B, page B must reference page A. This can be implemented via HTML link tags, HTTP headers, or XML sitemaps.
Why Hreflang matters
Without hreflang, search engines might show the wrong language version to users or flag pages as duplicate content. Proper hreflang implementation ensures users see content in their language and region.
How to implement
Identify all language/region versions
Use correct language codes (ISO 639-1)
Add hreflang tags to all page versions
Ensure bi-directional references
Include x-default for fallback
Validate implementation with tools
Code example
<!-- In <head> of each page -->
<link rel="alternate" hreflang="en-US" href="https://example.com/en-us/page/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/page/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/page/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/page/" />Common mistakes to avoid
- Non-reciprocal hreflang (A→B but not B→A)
- Wrong language/region codes
- Missing x-default annotation
- Hreflang pointing to non-canonical URLs
Examples
en-US: English for United States
en-GB: English for United Kingdom
de: German (any region)
x-default: Fallback for unmatched languages
Frequently asked questions
Not required, but strongly recommended. Without hreflang, search engines guess which version to show, potentially showing wrong language or treating pages as duplicates.
Google, Yandex, and some other engines support hreflang. Bing uses different markup (content-language meta tag).