If your website serves audiences in multiple countries or languages, there's a specific technical SEO problem lurking beneath the surface: Google may be serving the wrong version of your content to the wrong audience. A French speaker in France landing on your English page. A US visitor getting your Canadian pricing page. A searcher in Australia seeing results meant for the UK market. These aren't hypothetical edge cases — they're everyday occurrences on international sites that haven't implemented hreflang correctly.
hreflang is the HTML attribute that solves this problem. It tells Google which language and regional version of a page to serve to which audience. It's one of the more technically complex elements in SEO, and one of the most commonly implemented incorrectly. This guide covers what it does, when you actually need it, how to implement it, and how to check whether yours is working.
What hreflang Actually Does
hreflang is an HTML link attribute that creates a relationship between alternate versions of the same page — versions that differ by language, by regional targeting, or both. It tells Google two things simultaneously: "these pages contain equivalent content" and "here's which audience each version is intended for."
Without hreflang, Google faces a duplicate content problem when multiple language or regional versions of a page exist. It has to guess which version is most relevant for any given searcher in any given location — and it frequently guesses wrong. hreflang removes the guesswork by providing explicit signals for each version.
The result, when implemented correctly, is that French searchers in France see your French page in search results, English speakers in the US see your US-targeted English page, English speakers in the UK see your UK-targeted English page, and so on. Ranking signals — backlinks, engagement data, authority — are consolidated correctly rather than being split or misattributed across versions.
When You Actually Need hreflang
Not every site needs hreflang. Before implementing it, it's worth being clear about whether your situation actually calls for it:
- You need hreflang if your site has content in multiple languages — an English version and a Spanish version, for example — and both are meant to appear in search results for their respective language audiences.
- You need hreflang if your site has the same language but different regional content — a US English page and a UK English page with different pricing, spelling conventions, or locally relevant content.
- You need hreflang if you're seeing traffic from the wrong countries landing on the wrong language versions of your pages in Google Search Console.
- You don't need hreflang if your site is in one language targeting one country. A US-based English-only site has no use for hreflang.
- You don't need hreflang if you have international pages but use country-code top-level domains (ccTLDs) like .fr, .de, .co.uk — Google uses the ccTLD itself as a strong geographic signal, though hreflang can still provide additional refinement.
- You don't need hreflang merely because you have visitors from multiple countries. Visitors from other countries finding and reading your English content is normal and fine. hreflang is for when you have alternate-language or alternate-regional versions of pages that you want those audiences to find specifically.
How hreflang Is Implemented
hreflang can be implemented in three places: in the HTML <head>, in the HTTP header, or in the XML sitemap. The HTML implementation is most common and easiest to understand:
<!-- On the English US 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="fr" href="https://example.com/fr/page/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/page/" />
A few things to note about this syntax:
- Every version must reference every other version. This is the most commonly missed requirement. The hreflang implementation on the English US page must list all alternate versions — including itself. The French page must also list all versions including itself. If any version in the set doesn't return a confirming hreflang link back, Google may ignore the entire set.
- Language codes use ISO 639-1 format. Two-letter language codes:
enfor English,frfor French,defor German,esfor Spanish, and so on. - Region codes use ISO 3166-1 Alpha-2 format. Two-letter country codes:
usfor United States,gbfor United Kingdom,aufor Australia,cafor Canada. - Combined tags use a hyphen:
en-usmeans English targeting the US.en-gbmeans English targeting the UK.fr-cameans French targeting Canada. - x-default marks the fallback. The
x-defaultvalue specifies which URL Google should show when no other version matches the searcher's language or region — typically your main/global page.
hreflang in XML Sitemaps
For large sites with many pages and many language variants, adding hreflang annotations to every page's HTML quickly becomes unwieldy. The sitemap implementation is often more practical at scale:
<url>
<loc>https://example.com/en-us/page/</loc>
<xhtml:link rel="alternate" hreflang="en-us"
href="https://example.com/en-us/page/"/>
<xhtml:link rel="alternate" hreflang="en-gb"
href="https://example.com/en-gb/page/"/>
<xhtml:link rel="alternate" hreflang="fr"
href="https://example.com/fr/page/"/>
<xhtml:link rel="alternate" hreflang="x-default"
href="https://example.com/page/"/>
</url>
The same reciprocal link requirement applies in sitemaps — every URL entry must reference all alternates in the set. Validate your sitemap is correctly structured with the XML Sitemap Validator after adding hreflang annotations.
Common hreflang Mistakes That Kill Rankings
hreflang is one of the most error-prone technical SEO implementations because a single mistake in a large set can invalidate the entire group. The mistakes that cause the most ranking damage:
- Missing reciprocal links. As above — the most common error. If Page A declares an hreflang relationship with Page B but Page B doesn't return the relationship, Google ignores the tag.
- Pointing to redirecting URLs. hreflang annotations must point to the final destination URL, not to URLs that redirect. A redirect in an hreflang chain breaks the signal.
- Using the wrong language or region codes.
en-ENis wrong — it should been-gbfor British English.zhis ambiguous — specifyzh-hansfor Simplified Chinese orzh-hantfor Traditional. Check ISO 639-1 and ISO 3166-1 references carefully. - Applying hreflang to pages with noindex. A page that's noindexed can't appear in search results, so hreflang on it serves no purpose and may confuse Google's processing of the entire set.
- Forgetting x-default. Without an x-default fallback, Google has no guidance for what to show searchers whose language or region isn't explicitly covered by your hreflang set.
- Inconsistent URL formats. If some hreflang annotations use trailing slashes and others don't, or some use www and others don't, Google may treat them as different URLs. Canonical and hreflang URLs must be perfectly consistent.
How to Check Your hreflang Implementation
Given how many ways hreflang can go wrong, checking the live implementation is essential — not just reviewing what your CMS says it should be. The Hreflang Checker fetches any URL and displays the complete set of hreflang tags exactly as Google reads them, making it straightforward to spot missing reciprocal links, incorrect language codes, and redirect issues in the chain.
Run it on at least one page from each language or regional variant in your set. If the output doesn't show a clean, complete set of mutual references with correct ISO codes and a valid x-default, your implementation has errors that are likely suppressing rankings for the affected language versions.
hreflang sits alongside canonical tags as one of the more technically demanding elements of international SEO — both involve managing URL relationships across large sets of pages, and errors in either can cause significant ranking problems that are hard to diagnose without the right tools. For the broader context of how these elements fit into your overall technical SEO foundation, the guide to what technical SEO covers is the place to start, and the meta tags guide covers the other head-element implementations that work alongside hreflang.