Guide Published 1 December 2026 13 min read

Hreflang Tags: How to Implement Them Without Return-Tag Errors

Hreflang tags swap the URL that already ranks for the version written for the searcher's market, one pair at a time. Which codes work, the three placements with copyable code, and the errors only a crawler will show you.

Roman Makuev
Last updated

Hreflang has no ranking to hand out. Google’s John Mueller has said so since 2016, and again in 2022: the annotation doesn’t move a page up, it changes which URL Google shows for a ranking the site already has. Hreflang tags are annotations, <link rel="alternate" hreflang="…"> elements in the page’s head or the same data in an HTTP header or a sitemap, that tell Google which URLs are language or regional versions of one page, so it can show each searcher the version written for their language and country. Google checks those tags one pair at a time. Two versions that point at each other form a working pair, and a pair that doesn’t is dropped on its own. Most broken pairs come out of a template that builds the list of versions from the wrong data, which is why the fix usually sits in one place while the damage shows up in thousands of rows.

What hreflang does for SEO, and what it doesn’t

Hreflang SEO comes down to one job: when one version of a page ranks for a query, Google can swap in the version meant for the searcher’s language or region. The ranking itself is earned the usual way, by the page that holds it.

Several things people expect from hreflang sit elsewhere. Google doesn’t read a page’s language from the annotation or from the HTML lang attribute; it detects the language from the content. Translations don’t need the annotation to avoid being treated as copies either, because Google’s documentation counts localized versions as duplicates only when the main content stays untranslated (the general case is in duplicate content and SEO). Hreflang doesn’t guarantee that every version gets indexed. In May 2025 Mueller described the same-language case: when fr-FR and fr-BE are effectively the same page, Google often keeps one as canonical, may still swap the URL shown to Belgian searchers, and reports the clicks under the canonical.

Outside Google the annotation counts for less. A Bing representative said in 2020 that hreflang is a far weaker signal there than content-language, and that Bing also reads language and market from links and from who visits. Yandex reads hreflang from the page’s <head> and supports x-default.

That is why “implement hreflang first, it fixes duplicates and lifts local traffic” gets the order wrong. A version with thin content, no local demand, or a canonical that points at another market has nothing for hreflang to swap in, and the annotation adds a template to maintain without adding a click. The annotation pays off on the versions that are already worth showing.

Hreflang tag syntax and language-region codes

A hreflang tag is a link element in the page’s <head>: rel="alternate", a language or language-region value, and the full URL of one version. Every version of the page carries the same set of lines, one per version, its own included.

<link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/pricing/" />
<link rel="alternate" hreflang="en-US" href="https://example.com/en-us/pricing/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/preise/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en-us/pricing/" />

The value is an ISO 639-1 language code, optionally followed by an ISO 3166-1 alpha-2 region code; a script code from ISO 15924 can sit in between when the script is what differs, as with Chinese. A region on its own is invalid. Google’s documentation names one popular code as unsupported, es-419 for Latin America, because it isn’t in those standards, and it says EU, UN and UK have no effect.

The harder question is whether to add a region at all. A region code belongs on a version only when something about the page differs for that country: currency, tax, delivery terms, legal requirements, local contacts, or vocabulary and search demand that split the market. A global SaaS product with one price in dollars, a knowledge base or a blog serves every English speaker with one page, and en says exactly that.

ValueTargetsUse it when
enEnglish speakers anywhereOne page serves all of them: same price, same terms
en-GBEnglish speakers in the United KingdomPrices in GBP, UK delivery or UK legal pages
en-UKNothingNever. UK has no effect; the ISO code is GB
de-ATGerman speakers in AustriaAustrian prices, shipping or legal text differ from the German version
esSpanish speakers anywhereOne Spanish version for every market
es-ES, es-MXSpain; MexicoCurrency, delivery or vocabulary differ between the two
es-419Nothing in GoogleNever. Use es, or list the countries: es-MX, es-AR, es-CO
zh-Hant, zh-HansTraditional; Simplified ChineseThe script differs; with zh-TW Google derives the script from the country
USNothingNever. A region needs a language in front of it
x-defaultEveryone the other values missThere is a fallback version (see below)

en-UK is the one where sources disagree. Google’s documentation says UK has no effect, while practitioners have reported over the years that Google maps it to GB anyway (Mueller on Reddit in 2018; Ahrefs’ hreflang study in 2023). I can’t tell which describes Google today. The fix is a one-line change in a config and crawlers flag the code, so it gets changed regardless.

The rules of a hreflang cluster

The rule most guides repeat is that one missing return link makes Google ignore the whole cluster. Google’s documentation on localized versions says something narrower. If two pages don’t both point to each other, the tags are ignored for that pair, and Google still processes the pairs that do. A cluster is the full set of versions of one page; the pair is the unit Google checks.

Take a page in en-GB, en-US and de. The German template lists itself and en-US but leaves out en-GB. The en-GB ↔ de pair drops out, because only one side confirms it. The en-GB ↔ en-US and en-US ↔ de pairs keep working, so a searcher in Britain can still be swapped from the US page to the British one. The damage is real and it is local, which also explains why a broken template often goes unnoticed for months: most pairs still work.

Each version carries the same set of lines, so the rules apply to every line in it:

  • The version lists itself. Google asks for this explicitly in sitemaps and HTTP headers, and its HTML example includes the page’s own URL in the set.
  • Every URL is fully qualified, protocol included: https://example.com/de/, never /de/.
  • Every URL is the version’s canonical, and it answers 200. Google’s hreflang page doesn’t list status codes, but the consequence follows from how it picks canonicals: a redirect is a strong signal that the redirect target should become canonical, and noindex can take the page out of Search altogether. An annotation pointing at either has nothing left to show (redirect types are covered in SEO redirects).

A cluster also doesn’t have to cover every page in every language. Google says that when a full set is hard to maintain, some languages can be left off some pages, and the pairs that confirm each other keep working. That matters against the advice to annotate 100% of a multilingual site. A page that was never translated, or one that differs from its sibling only by the currency in the header, adds lines to the matrix and nothing a searcher would notice. Leaving it out of the cluster is the cleaner choice.

x-default: where it should point

x-default marks the fallback version, the one Google shows when no other value matches the searcher’s language and country. Google recommends it and designed it for language-selector pages; it takes no language code.

Most sites have no selector page. Then x-default goes on the version in the site’s main global language, usually the root or /en/, the page meant for everyone the explicit locales miss. A selector that opens as a modal without a URL of its own can’t be the target, since x-default needs a URL that answers 200. And a site with no universal version at all, say German for Germany and Austria and nothing else, is better off without x-default, or a searcher in Brazil gets sent to an Austrian price list.

Three ways to implement hreflang tags

Hreflang can be implemented as link elements in the HTML <head>, as an HTTP Link header, or in an XML sitemap. Google treats the three as equivalent and says that using all three at once brings no benefit in Search. Pick one per page type.

In the <head>, the hreflang tags from the example above go into every version. They have to sit inside a well-formed <head>: a script or an unclosed tag that ends the head early pushes the links into the body, where they no longer count. Google also asks not to combine hreflang with attributes such as media in the same tag.

The HTTP header is for files without a <head>, PDFs above all. The header has to be identical on every version and include the requested version itself:

Link: <https://example.com/en/guide.pdf>; rel="alternate"; hreflang="en",
      <https://example.com/de/leitfaden.pdf>; rel="alternate"; hreflang="de",
      <https://example.com/de-ch/leitfaden.pdf>; rel="alternate"; hreflang="de-CH"

In a sitemap, each <url> entry lists every version of that page, itself included, through xhtml:link elements, and the sitemap declares the xhtml namespace:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://example.com/en-gb/pricing/</loc>
    <xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/pricing/" />
    <xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/en-us/pricing/" />
    <xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/preise/" />
  </url>
  <!-- one <url> entry per version, each with the same three lines -->
</urlset>

Which of the three is “best” gets more debate than it deserves. For Google the choice changes nothing, so the deciding question is where the list of versions lives. If the CMS knows every page’s equivalents, it can render them into the head. If a data pipeline already builds sitemaps, the annotations can ride along. Headers suit a server or CDN rule for documents. What breaks clusters is the data fed into them. One limit outside Google: Yandex’s documentation says it no longer reads language versions from sitemaps and asks for on-page markup, so a site that needs Yandex keeps the head.

Hreflang and canonical

The common symptom: a version vanishes from results in its own market, and every pair pointing at it goes quiet. The usual cause is a canonical on that version pointing at another market’s URL, often the home market. If Google accepts it, the version is folded into the other one as a copy, and the annotations pointing at it have nothing to show.

Google’s canonicalization guide, updated on 10 July 2026, sets the rule: with hreflang, point the canonical at a page in the same language, or at the closest language when no same-language page exists. The annotations should then list only those canonical URLs. A rel="canonical" tag that carries an hreflang attribute isn’t used for canonicalization at all. The same guide adds a detail few guides mention: among duplicates, Google prefers URLs that sit inside a hreflang cluster, so de-DE and de-CH annotated to each other win over a de-AT page outside the cluster. How these conflicts show up in Search Console’s Page indexing statuses is in our international SEO audit.

Hreflang errors and how to fix them

Search Console won’t list any of these hreflang tag errors. Its International Targeting report, the last place that showed hreflang errors, was removed on 22 September 2022, and the Page indexing help states that alternate language pages aren’t detected. A crawler is the only place they show up, and the table names the Screaming Frog filter where each one lands (the crawl settings are in the audit’s Screaming Frog section).

ErrorWhat Google doesFixScreaming Frog filter
Missing return linkIgnores that pair; the other pairs still workAdd the line on the template of the version that lacks itMissing Return Links
Version doesn’t list itselfThe set is incomplete against Google’s own specAdd the page’s own line to the generated setMissing Self Reference
Invalid code: en-UK, es-419, a region aloneThe value has no effect or isn’t supporteden-GB; es or a list of countries; add the languageIncorrect Language & Region Codes
Target redirects or returns 404A redirect points canonical signals at its destination; a 404 drops out of the indexList the final URL, or remove the version from the clusterNon-200 Hreflang URLs
Target carries noindexThe page can leave Search, so the pair has nothing to showDrop the noindex or take the version out of every setNoindex Return Links
Target’s canonical points elsewhereGoogle can fold the version into the URL it canonicalizes toSelf-canonical on every version; hreflang lists canonicals onlyNon-Canonical Return Links, Not Using Canonical
Relative or protocol-less URLsGoogle’s spec requires fully qualified URLsGenerate absolute https:// URLs—
One code on two URLsGoogle’s documentation doesn’t say which one winsOne URL per value; a second regional version gets its own codeMultiple Entries
Links outside the <head>Only links in a well-formed head countFind what closes the head early; check the rendered HTMLOutside <head>
Version removed, cluster not updatedEvery pair pointing at it breaksRemove it from all other versions in the same releaseNon-200 Hreflang URLs
No x-defaultNothing breaks; Google only recommends x-defaultAdd it when a fallback version existsMissing X-Default

The last row changes how error counts read. Ahrefs’ 2023 study of 374,756 domains using hreflang found that 67% had at least one issue, and the most common one, on 56.3% of domains, was a missing x-default. That is a recommendation Google makes, and adding x-default doesn’t move positions. Counted alongside it, a missing return link on the product template looks like one more row in a long list, though it removes pairs on every product.

Sort the crawl export by template before fixing anything. Thousands of Missing Return Links rows usually come from one template, and the ticket goes to whoever owns it.

Generate the cluster from one registry

A common way hreflang gets built is a template rule that takes the current URL and swaps the language prefix: /de/produkte/tisch/ becomes /fr/produkte/tisch/ and /en-gb/produkte/tisch/. It works until the slugs are localized or a page doesn’t exist in every language. From then on the rule writes annotations to URLs that return 404, and every one of those pairs fails at once.

The arithmetic makes manual upkeep a losing game. With N versions, each version carries N lines, so one page across all its versions holds N² annotations: 25 for five markets, 100 for ten. Adding a market means editing every existing version, and removing one means the same edit in reverse.

The list of versions has to come from one registry of equivalents, a table of page × locale → canonical URL kept in the data model, the PIM or the sitemap generator, and the head tags or the sitemap get rendered from it. A missing translation then simply has no row, and no annotation points at it. Releases and migrations are where the registry and the live site drift apart: a new URL pattern, a redirect rule or a canonical change rewrites URLs that the registry still lists. A hreflang crawl belongs in the pre-release check and again after launch.

How to check a hreflang implementation

Checking hreflang takes two steps that answer different questions. A crawl shows whether the annotations are built correctly. Search Console’s Performance report shows whether Google is acting on them.

  1. Validate the built cluster. Check canonicals and status codes first, since every URL in a cluster should answer 200 and canonicalize to itself, then return links and codes. On a whole site that means a crawl of production after the build. For one URL, view the hreflang tags in the source, or in the rendered HTML in URL Inspection if a script injects the tags; Lighthouse’s SEO audit also checks hreflang links in the head and in response headers for valid language codes.
  2. Check what Google shows. In the Performance report, filter by the target country and look at which URLs get the impressions. If searchers in the UK and Canada still land on /en-us/, the swap isn’t happening. The method for measuring that share per market is in the audit’s leakage section.

The second step has a blind spot. For versions in the same language, Mueller’s May 2025 answer says Google may swap the URL while reporting the data under the canonical, so a low count on /en-gb/ doesn’t prove British searchers never saw it. How long after a fix the swap starts, Google doesn’t publish, and with no hreflang report in Search Console, the change shows up only as URLs shifting in Performance.

Hreflang FAQ

Do I need hreflang if each country has its own domain?

When two of those domains share a language, yes. A ccTLD tells Google the country, but example.de and example.at are still two German pages, and when they are effectively the same Google can keep one as canonical. Hreflang works across domains: Google’s documentation says alternate URLs don’t need to be on the same domain, so each site lists the other’s URLs like any other version.

Does the order or case of hreflang values matter?

No. Google treats the value as case-insensitive, so en-gb and en-GB are the same, and Mueller has said the order of the lines makes no difference. Writing the region in capitals follows the ISO convention and makes the set easier to scan.

What I can’t tell you is whether AI Overviews or AI Mode use hreflang when they pick which version of a page to cite. Google’s documentation doesn’t say, and the swap described above is documented for ordinary results. Until it does, the check for AI answers stays manual: ask in the market’s language and see which version comes back. If you want a cluster read end to end, template by template, that is part of our SEO audit services.