What Is Hreflang? How to Target Language and Region in SEO
Hreflang is an HTML attribute — written as <link rel="alternate" hreflang="x" href="..."> — that tells search engines which language, and optionally which regional variant, a specific page is intended for, and points to equivalent versions of that page in other languages or regions. Google uses these annotations to serve the most appropriate language or regional URL to a user in search results, rather than treating translated versions of the same content as duplicates or unrelated pages.
Definition
The hreflang attribute is used to annotate a set of equivalent pages that target different languages or regions, so a search engine can show the correct one to a searcher based on their language and location. It doesn't translate content or affect ranking directly — it's a signal for which URL to surface to which audience. Established
Basic Syntax
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="fr-ca" href="https://example.com/fr-ca/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
The value combines an ISO 639-1 language code (e.g., fr) with an optional ISO 3166-1 Alpha 2 region code (e.g., fr-CA for Canadian French) — region without language, like just CA, is not valid. The special value x-default designates a fallback page for visitors who don't match any of the specified language/region pairs. Established
Hreflang Must Be Reciprocal
Google's documentation states that hreflang annotations must be confirmed — every page in a set must link back to every other page in that same set, including itself. If page A links to page B via hreflang but page B doesn't link back to page A, Google's guidance says it may ignore the annotation entirely for that pair. Established
Implementation Methods
| Method | Where declared |
|---|---|
| HTML link tags | In the <head> of each page, one tag per language/region variant, per Google's documented method |
| HTTP header | An Link response header — useful for non-HTML files |
| XML sitemap | Grouped via <xhtml:link> elements inside <url> entries, an alternative to in-page tags for large sites |
Hreflang Is Not a Ranking Factor
Hreflang does not directly influence how well a page ranks. It only affects which regional or language version of a page Google chooses to display for a given user in a given market — the underlying ranking signals for each URL remain independent. Established
Common Mistakes
- Missing reciprocal (return) links. Every page in the hreflang set must link to every other page, including itself — a one-way link can cause Google to disregard the annotation.
- Using incorrect language or region codes. Codes must follow ISO 639-1 (language) and ISO 3166-1 Alpha 2 (region) — invalid codes are ignored.
- Pointing hreflang to a non-canonical or redirecting URL. Target URLs should be the canonical, indexable version of each page.
- Forgetting a self-referencing hreflang tag. Each page should include a hreflang annotation pointing to itself, in addition to its alternates.
- Confusing hreflang with translation quality or ranking boost. It's purely a routing signal for which version to show whom, not a quality or ranking mechanism.
FAQ
Does hreflang improve my rankings?
No. Hreflang only affects which language or regional version of a page is shown to a given user — it doesn't directly influence ranking position.
What happens if hreflang links aren't reciprocal?
Google's documentation states that non-reciprocal hreflang annotations may be ignored entirely for that page pair, since every page in the set must link back to every other page.
What does x-default mean in hreflang?
It designates a fallback page to serve visitors whose language or region doesn't match any of the other specified hreflang values.
Related Concepts
Sources
- Google Search Central. "Tell Google about Localized Versions of Your Page." developers.google.com