Hreflang is an HTML attribute (rel="alternate" hreflang="x") that signals to Google which language and country a specific page version targets. It prevents duplicate content issues when a site serves multiple regional or linguistic audiences, ensuring German speakers see the German page and US visitors get the US page rather than a random version.
If your site has pages in multiple languages or targets different countries with the same language, hreflang is the mechanism that puts the right page in front of the right audience. Without it, Google picks arbitrarily — and often wrong.
What is hreflang?
Hreflang is an HTML attribute that lives in the <head> of a page (or in HTTP headers, or in an XML sitemap) and tells Google two things: what language the page is in and which country it targets. A page written in American English for US readers gets hreflang="en-us". The same content localized for UK readers gets hreflang="en-gb". A French translation gets hreflang="fr".
Google uses these signals to serve the correct page version in search results for each region. Without hreflang, Google sees near-identical pages and either consolidates them or surfaces the wrong version for each market.
Only 19% of multilingual sites implement hreflang correctly. The remaining 81% have errors ranging from missing return tags to broken URLs — meaning the majority of international sites are invisible to the audiences they're trying to reach.
Why hreflang matters for international SEO
Hreflang solves four problems that every international or multilingual site eventually runs into:
- Language accuracy. Visitors in specific countries automatically receive content in their language without manual redirection or guesswork on Google's part.
- Duplicate content prevention. Google recognizes regional and linguistic variants as intentional, not as copied content that should be penalized or consolidated.
- Engagement improvements. Native-language content reduces bounce rates and increases time on page, which feeds engagement signals back to Google.
- Regional commerce control. E-commerce businesses with different pricing, currencies, or inventory by market can control which version each region sees — protecting revenue and user trust.
How hreflang works
Hreflang annotations can be placed in three locations. Google recommends choosing one and staying consistent across your site.
| Method | Where it goes | Best for |
|---|---|---|
| HTML link tag | Page <head> | Most sites — simple to implement and verify |
| HTTP header | Server response header | Non-HTML files (PDFs, images) |
| XML sitemap | Sitemap file | Large sites with many language variants |
A basic HTML implementation looks like this:
<link rel="alternate" hreflang="en-us" href="https://example.com/us/product/">
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/product/">
<link rel="alternate" hreflang="fr" href="https://example.com/fr/product/">
<link rel="alternate" hreflang="x-default" href="https://example.com/product/">
The return tag rule — the most missed requirement
Hreflang annotations must be bidirectional. If Page A lists Page B as its French equivalent, Page B must also list Page A as its English equivalent. Missing return tags are the single most common hreflang error. Google discards annotations that are not reciprocated, so a missing return tag effectively breaks the entire cluster.
The x-default tag
The x-default value specifies which page displays when no language or region match exists. Typically the English or primary-market version. Without x-default, search engines make assumptions that are often incorrect — a German speaker in Switzerland might see the French version simply because it ranked slightly higher.
Hreflang targeting types
Language and region codes can be combined to achieve different levels of specificity.
| Code | Targets | Example use case |
|---|---|---|
en | All English speakers | Global English content without regional variation |
en-us | English speakers in the US | US pricing, US spelling, US-specific offers |
en-gb | English speakers in the UK | UK pricing, British English, UK-specific content |
fr | All French speakers | French language content, any country |
fr-fr | French speakers in France | French market-specific pricing and content |
x-default | No specific match | Fallback page when no region matches |
Real hreflang implementation examples
1. E-commerce site with regional pricing
An online shoe retailer maintains separate pages: example.com/us/shoes/ with USD pricing and example.com/uk/shoes/ with GBP pricing. Without hreflang, UK visitors regularly see US pricing, causing confusion and cart abandonment. Proper implementation ensures each market sees the correct currency and regional promotions.
2. Multilingual SaaS platform
A project management app publishes its homepage in 8 languages using XML sitemap implementation. Each language version references all 7 others. German users land on /de/, Spanish users on /es/, and everyone else defaults to the English x-default version. Organic click-through rates improved 23% after implementation because users recognized their language in the SERP snippet.
3. Blog with translated posts
example.com/blog/seo-guide/ → hreflang="en"
# French translation
example.com/fr/blog/guide-seo/ → hreflang="fr"
# Each page references the other — return tag required
Hreflang vs canonical URL — which one to use
Both influence which page Google favors, but they solve different problems. Using the wrong one creates more confusion, not less.
Use hreflang when
- You have translated or localized versions of a page
- Different regions need different content for the same intent
- You want each version indexed separately for its target market
- Pricing, currency, or legal content varies by country
- You want Google to show the right version in each country's results
Use canonical when
- Pages are near-identical with no language or regional differences
- URL parameter variants exist (sort order, session IDs)
- You want one URL to absorb all ranking signals
- Content is syndicated across domains in the same language
- Duplicates are accidental, not intentional regional targeting
6 best practices for hreflang implementation
- Always include return tags. Every page in a hreflang cluster must reference all other pages in that cluster, including itself. Missing return tags cause Google to ignore the entire annotation set.
- Use the correct language-region codes. Follow BCP 47 standard codes —
en-usnoten_usoren-US. Case matters; hyphens not underscores. - Include x-default on every page. The fallback tag tells Google what to show users who don't match any language or region. Omitting it invites arbitrary choices.
- Keep URLs absolute, not relative. Write
https://example.com/fr/page/not/fr/page/. Relative URLs in hreflang annotations are a common source of errors. - Pick one implementation method and stick to it. Mixing HTML tags with XML sitemap annotations for the same pages creates conflicting signals.
- Monitor with Google's webmaster dashboard. The International Targeting report flags missing return tags, invalid language codes, and unlinked pages within 48 hours of crawling.
Hreflang is for multilingual or multi-regional sites only. Adding it to a single-language, single-region site creates unnecessary complexity with no benefit. If all your content is in English for a global audience with no regional variants, use canonical tags instead to handle any duplicate URL issues.
Common hreflang mistakes to avoid
- Missing return tags — the most common error. Breaks the annotation cluster entirely.
- Pointing to non-canonical URLs — hreflang targets should always be the canonical version of each page.
- Wrong language codes — using
en_US(underscore) instead ofen-us(hyphen) renders tags invalid. - Mixing implementation methods — HTML tags and sitemap entries for the same page create conflicting signals.
- Pointing to redirected URLs — hreflang tags should point to the final destination URL, not a URL that 301s elsewhere.
- Omitting x-default — leaves the fallback audience without a clear page, causing Google to guess.
Frequently asked questions
Hreflang does not directly boost rankings. It ensures the right page version appears for the right audience. Correct language matching improves engagement metrics like bounce rate and dwell time, which can indirectly help rankings over time.
Yes. Hreflang handles regional variants through country-specific codes like en-us, en-gb, and en-au. Each region gets its own annotation pointing to the appropriate page version with localised pricing, spelling, or content.
Google ignores faulty annotations and decides independently which version appears in each market. No penalties apply, but you lose control over regional content distribution. The International Targeting report in Google Search Console identifies most errors.
x-default is the fallback value that specifies which page to show when no language or region match exists. It is typically the English or primary-market version. Omitting it causes search engines to make assumptions that are often incorrect.
For most sites, HTML link tags in the page head are easiest to implement and verify. XML sitemaps work well for large sites with many language variants. HTTP headers are mainly useful for non-HTML files. Pick one method and use it consistently — mixing methods creates conflicting signals.
