Quick answer: Hreflang tags tell Google which language or regional version of a page to show each user. Every version must list all the others, including itself, using valid ISO language codes (and optional region codes), and every reference must be returned by the page it points to. Add an x-default for users who match no version, keep canonicals self-referencing, and implement through HTML link tags, HTTP headers or the XML sitemap.
Hreflang is one of the most error-prone parts of technical SEO. A single missing return tag can mean your UK customers see the US page with dollar pricing, or a whole market quietly stops receiving organic traffic. The rules are strict but learnable. This guide covers the syntax, the three implementation methods, the most common errors and how to test.
What hreflang does, and what it does not do
- It does: help Google swap in the right language or country version of a page in search results for each user.
- It does not: boost rankings by itself, translate pages, or override a canonical tag pointing elsewhere.
- It is not needed for a single-language, single-market site.
Hreflang syntax
Each tag has two parts: the language-region value and the URL.
<link rel="alternate" hreflang="en-us" href="https://example.com/us/pricing/" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/pricing/" />
<link rel="alternate" hreflang="de-de" href="https://example.com/de/preise/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/pricing/" />| Rule | Correct | Common mistake |
|---|---|---|
| Language code uses ISO 639-1 | en, de, es, fr | eng, ger |
| Region code uses ISO 3166-1 alpha-2 | en-gb, es-mx | en-uk, es-latam |
| Region cannot stand alone | en-ca, fr-ca | ca (that means Catalan) |
| URLs are absolute | https://example.com/de/ | /de/ |
| Each page references itself | Self tag included | Self tag missing |
The return tag rule
Hreflang must be bidirectional. If the US page says the UK page is its alternate, the UK page must say the US page is its alternate. When the return link is missing, Google may ignore the pair. This is the most frequent hreflang failure on the sites I audit, usually caused by one template, one market or one CMS plugin that was configured differently from the rest.
Using x-default
x-default tells Google which page to show users whose language or region does not match any listed version. It is commonly the international homepage, a language selector or the main English version. It is optional but recommended for sites serving many markets.
Three ways to implement hreflang
| Method | Best for | Trade-offs |
|---|---|---|
| HTML link tags in the head | Small to medium sites | Adds code to every page; must be in the head, not the body |
| HTTP headers | PDFs and non-HTML files | Harder to audit; requires server configuration |
| XML sitemap | Large sites with many versions | Keeps page code light; sitemaps must stay perfectly in sync |
Pick one method per set of pages. Mixing methods makes conflicts more likely and harder to debug.
Hreflang and canonical tags
Each language or regional version should have a self-referencing canonical. A common error is canonicalizing all regional versions to one “main” version, for example every English page to the US URL. That tells Google the other versions are duplicates, and hreflang cannot overrule it. You will often see the affected pages listed under duplicate or alternate statuses in Search Console’s indexing report statuses.
Same-language markets
English for the US, UK, Canada and Australia, or Spanish for Spain and Mexico, are where hreflang matters most, because the pages are nearly identical. Make each version genuinely localized: currency, spelling, units, shipping information, contact details and local examples. Thin regional copies with only the currency swapped are more likely to be folded together.
Common hreflang errors checklist
- Missing return tags between versions.
- Invalid codes such as en-uk or region-only values.
- Hreflang pointing to redirected, noindexed or 404 URLs.
- Canonicals pointing to a different language or region.
- Tags placed in the body or after invalid head elements, so they are ignored.
- Relative URLs or mixed http and https versions.
- Old URLs left in hreflang after a migration. Updating every reference must be part of any site migration checklist.
How to test hreflang
- Crawl the site with a tool that validates hreflang and reports missing return links and non-200 targets.
- For sitemap implementations, validate the sitemap and spot-check URL sets.
- Use URL Inspection to confirm Google indexed each version with its own canonical.
- Check Search Console performance by country to confirm each market’s pages receive impressions from the right country.
Hreflang checks belong in every technical audit checklist for multi-market sites, and should be rerun after any template change.
When hreflang is not enough
Hreflang solves which version appears, not whether a market has enough visibility. Ranking in a new country also depends on localized keyword research, local links and content that reflects how people in that market search. That broader work is the focus of our international SEO service. The same is true locally: a locksmith with a correct technical setup still needs a trusted profile, as I explain on my locksmith SEO page.
Frequently asked questions
Does hreflang improve rankings?
Not directly. It helps Google show the right version to the right users, which improves relevance, click-through and conversions in each market.
Do I need hreflang if my site is only in English?
Only if you have separate versions for different English-speaking countries. A single English site for all markets does not need it.
Is en-uk a valid hreflang code?
No. The correct ISO 3166-1 code for the United Kingdom is GB, so use en-gb.
Does Bing support hreflang?
Bing has historically relied more on the content-language meta tag and other signals. If Bing traffic matters in your markets, add a content-language declaration alongside hreflang.



