ARTICLE - SEO Optimization

hreflang International SEO Guide: Tag Language and Region

Many teams treat hreflang as a master key for multilingual SEO: add the tags, translations stop being counted as duplicates, and users land on the right language automatically.

2026-08-06 Google Search Central

hreflang International SEO Guide: Tag Language and Region

Many teams treat hreflang as a master key for multilingual SEO: add the tags, translations stop being counted as duplicates, and users land on the right language automatically. Neither expectation holds. hreflang does exactly one thing: it declares that a group of pages are language or region variants of the same content, and asks the search engine to pick one for display based on the user's language and region. It does not consolidate ranking signals, and it does not take on duplicate content.

That misunderstanding is expensive. Once hreflang is expected to "solve duplication", canonical is usually written wrongly: every language variant is canonicalised to the English site, the cluster declaration is contradicted by its own canonical tags, and the two signals fight each other. The engine then picks one on its own, and the one it picks is often not the one you wanted.

This guide follows a single thread: hreflang is an equivalence declaration, and all of its power comes from the consistency of the whole group. Looking at any single page tells you nothing about whether it is correct.

1. What It Does and Does Not Do

1.1 An equivalence declaration

hreflang reads literally as: this address and that address are the Spanish, German and British English versions of the same content. It describes a version relationship — not priority, not quality. There is no "which version matters more" layer in it; importance is set by content, internal links and history.

Given the relationship, the engine performs a match at display time: whichever version in the cluster matches the user's language and region preference is shown; when nothing matches, x-default is used. That is the entire job.

One long-standing claim is worth correcting: search engines detect page language through algorithmic analysis of the body text, not through hreflang or the lang attribute. Adding hreflang does not make a page "detected as" a language; it only acts in distribution. This is also why pages whose body was never actually translated — only the template was — cannot be rescued by hreflang. They still count as duplicates.

1.2 It does not consolidate signals or fix duplicate content

This is the sentence to remember: hreflang does not consolidate ranking signals, does not prevent duplicate content, and is not a substitute for canonical. Consolidating signals and naming the original is canonical's job, and the division of labour is clean.

Canonical answers "among these identical addresses, which one is the original". hreflang answers "which language and region does each address represent". A page can be the canonical original of one language version and a member of a cross-language cluster at the same time. The two coexist as long as they are written correctly — see section 3.

Doing hreflang without fixing canonical leaves plenty of duplicate variants with unclear direction. Doing the opposite — canonicalising every language version to one English page — cancels the very "parallel versions" that hreflang declares. For a broader signal audit, see the SEO checklist.

2. Return Links Are Mandatory

2.1 One-way declarations are ignored

The rule is hard: if A declares B, B must declare A. A one-way declaration is usually ignored entirely, because the engine cannot distinguish a genuinely reciprocal cluster from a one-sided mistake — and accepting the latter is the riskier choice.

This is the most frequent error and the easiest to miss while troubleshooting: the diagnostic points at "missing return link", the site owner checks only the page they happen to be looking at, sees the tags right there, and blames the tool.

Build the habit instead: every page's hreflang list must include itself plus every other version in the cluster. With five language versions, each page carries five entries (one pointing at itself) plus one x-default. The lists are identical across pages; only ordering or the self-reference position differs.

2.2 How to validate the group

You cannot validate page by page; you validate the group. The practical method: extract every URL in the cluster, fetch each one, collect the hreflang set it declares, and build a matrix — rows are pages, columns are declared targets. Every cell should be symmetric.

Three failure shapes dominate: a page is missing several versions (a language was added and older pages were never updated), a page declares versions that no longer exist (dead links carried over from a copied template), or a page misspells a code (en-GB written as en-UK). The third is the most deceptive, because the page looks like it "has hreflang" while the code is invalid and therefore ignored.

The matrix also exposes duplication: if two different URLs show up in the same cell, the cluster contains two variants for the same language, which is a duplicate problem to solve before anything else.

3. Forced Consistency With Canonical

3.1 Every page in the cluster must self-canonicalise

Within an hreflang cluster, each page's canonical must point at itself. The reason is direct: hreflang says "these are parallel, independent versions". If one version's canonical points at the English page, that page also says "I am not independent, my signals belong to the English page". The two signals point in opposite directions, so the engine follows one — usually the canonical — and the hreflang relationship is voided.

Self-referencing means the canonical address is character-for-character identical to the hreflang entry pointing at that page: same scheme, same host, same path, same trailing slash. A common slip is hreflang on https://example.com/es/page while canonical says https://www.example.com/es/page, or canonical carries tracking parameters. Differences like these are almost invisible to manual review; only a script comparison catches them.

3.2 What conflicting signals do

Signal conflicts do not raise errors; they just make outcomes unpredictable. The typical symptom: some language users are sent to the English page and others to the correct one, and it varies by query. This "sometimes right" behaviour is the hardest to debug, because any single test can produce the opposite conclusion.

The test is the same matrix: each page's canonical target and its hreflang self-reference should be the same string. Where they differ, that is the fix. For the full signal-alignment method and the role of self-referencing canonicals, see canonical and duplicate content management.

4. Language and Region Codes

4.1 Writing language and region codes correctly

The format is either a language, or a language followed by a hyphen and a region: the language uses a two-letter ISO 639-1 code, the region a two-letter ISO 3166-1 Alpha 2 code, as in en-US, pt-BR, de-AT.

Three hard rules:

  • A region alone is not valid. be is Belarusian, not Belgium; uk is Ukrainian, not the United Kingdom. Using country codes as language codes is the classic beginner error.
  • Reserved or unassigned codes do not work. EU and UK are not valid region codes, and declaring them has no effect.
  • The separator is a hyphen. zh_CN with an underscore is invalid and is silently ignored.

Writing systems can be expressed with a script subtag: zh-Hans is Simplified, zh-Hant is Traditional. That form suits cases where two script systems coexist in one region and is more accurate than forcing a region code. Do not stack it into a three-part zh-Hans-CN; combining script and region that way is invalid.

4.2 Do not add region codes when you only have languages

This is the second most common error: a site has one English body of content and declares en-GB, en-US and en-AU, all pointing at the same URL or at three identical URLs. The semantics become muddled and the engine may ignore the whole set.

The test is simple: region codes are needed only when content genuinely differs by region — prices, stock, regulation, currency, contact details, delivery coverage. When content is identical, a single en is enough, because it means "all English-speaking users".

Another shape of the same mistake: writing region codes for wherever customers are, while the page itself is unchanged. That is not an hreflang scenario; it is a decision about whether to localise at all. A version with a translated navigation and footer but an untranslated body will never count as an independent version, whatever code you attach.

5. What x-default Is For

5.1 It is not the "default language"

x-default is often described as the default version, which misleads. Its precise meaning is: the page to show when no version matches the user's language and region.

That is why it usually points at a language selector or a global landing page, rather than the version you most want to promote. If your business wants all unmatched users funnelled into the English site, pointing x-default at the English home page is legitimate; but if the site has a "choose your region" interstitial, that page is the better x-default.

5.2 Which pages suit x-default

Three typical choices, each with a cost:

  • A language selector: the user decides, which rarely goes wrong, but it adds a click and affects bounce behaviour.
  • A global landing page: the most natural and cheapest to maintain when content is generic and needs no region switch.
  • The primary-language home page: used when the business defaults to one language, at the cost of sending some users to a non-native page.

x-default is also a cluster member and must satisfy reciprocity: the page declared as x-default must itself list every version in the cluster, including itself. Many sites add the x-default entry on the other pages and forget the return link on the target page, and the declaration is ignored.

6. Choosing One of Three Implementations

Implementation (as described in the article) Where it fits Advantage Drawback
Link tags in the HTML head HTML pages The full declaration is visible in the source and an audit script can crawl the HTML to build the matrix Depends on correct template output: a new language shipped without a template change drops one entry from the whole group, unreported
HTTP response headers Non-HTML resources such as PDF whitepapers, images and video Still declares the group where there is no head to write into Manual review is impractical, and CDNs sometimes rewrite headers
XML sitemap Large sites whose heads come from several templates or stacks Version relationships live in one generated file Can drift from the actual heads without any error, and the conflict is harder to trace

6.1 Link tags in the HTML head

The most common and most auditable method. Each page outputs a group in its head:

<link rel="alternate" hreflang="en" href="https://example.com/en/page" />
<link rel="alternate" hreflang="zh-Hans" href="https://example.com/zh/page" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

The advantage is visibility: the full declaration sits in the page source, and an audit script can crawl the HTML and build the matrix. The drawback is dependence on correct template output — if a new language ships without touching the template, one entry is missing from the whole group, and nothing reports it.

6.2 HTTP headers and XML sitemaps

HTTP headers suit non-HTML resources such as PDF whitepapers, images and video files, which have no head and no parseable body. The whole group is returned in a single Link: header. The drawback is that manual review is impractical — only tools can read response headers — and CDNs sometimes rewrite headers, so verify nothing is dropped.

XML sitemaps suit large sites whose heads are maintained by several templates or stacks: the version relationships live in one generated file. The drawback is that it can drift from the actual heads without any error — the sitemap says one thing, the head says another, and the conflict is harder to trace. See the XML sitemap guide for the syntax.

6.3 Pick one, do not mix

Any one of the three is enough. Do not use two methods to say different things. Mixing is not fatal by itself — writing the same declaration twice is usually harmless — but inconsistent content is: five versions in the head and three in the sitemap leaves the engine to choose, and it tends to choose the more complete file, which may be the stale one.

If history forces both to coexist, at least generate them from one source: a single language-version configuration that renders both the head and the sitemap, instead of two hand-written copies. This is the same single-source-of-truth principle used elsewhere in engineering, just applied to SEO files.

7. Five Common Failures and a Launch Checklist

7.1 Declaring outward only, never back

The first and most frequent failure: a new language version ships and lists the older versions, but the older pages are never updated to list the new one. The group never closes, so it usually fails as a whole — and the diagnostic appears in a different page group, which is why it is hard to map back.

7.2 Pointing at noindexed or canonically redirected pages, or relying on automatic redirects

The second failure: an hreflang target is noindexed, or its canonical points elsewhere. In both cases the target does not participate in indexing, so the declaration points at a void.

The third failure belongs to the same family and is often mistaken for a cleverer solution: replacing hreflang with IP-based or browser-language automatic redirects. A 302 to the matching language version looks like better UX, but crawlers typically visit from one IP range and see "this URL always redirects to another URL". They can only crawl one version, and the rest are neither crawled nor distributed. Language switching should be a link the user can click, not a server-side forced redirect. How such redirects consume crawl budget is covered in crawl budget management.

7.3 Invalid code

The fourth failure is the code itself, usually in one of four shapes:

  • zh_cn or en_us with underscores, which is invalid syntax.
  • Three-part values such as zh-Hans-CN that stack script and region, which is invalid.
  • Mixed casing (en-gb next to en-GB). Matching is case-insensitive in practice, but mixed casing usually signals a broken template concatenation worth chasing.
  • Relative paths such as /en/page instead of full URLs; hreflang requires absolute addresses.

7.4 Architecture: subdirectories, subdomains or parameters

The fifth failure is not in the tags but in the architecture: multilingual sites built on query parameters (?lang=es) keep several language versions under one path. Parameterised URLs are easily missed by crawlers, easily judged as duplicates, and make both canonical and hreflang hard to get right.

The trade-offs:

  • Subdirectories such as /en/ and /zh/: the least effort. Signals concentrate on one host, operations stay cheap, canonical and hreflang are straightforward, and internal links can stay relative. Most sites should choose this.
  • Subdomains such as en.example.com: suitable for regional operations, large content or compliance differences, and independent deployments. The cost is diluted signals, separate maintenance per site, and weaker cross-domain internal links — see internal linking strategy.
  • Parameters: not recommended for language versions, only for transient state such as a language toggle that does not affect indexing.

7.5 Launch checklist

Work through in order; if any item fails, go back and fix it:

  1. Every page in the cluster lists itself plus all other versions, with matching counts.
  2. Every declared address returns 200 and is not noindexed.
  3. Every page's canonical self-references and matches its hreflang self-reference exactly.
  4. Language codes are valid ISO 639-1, region codes valid ISO 3166-1 Alpha 2, separator is a hyphen.
  5. x-default exists, and that page also lists the whole group.
  6. No IP- or UA-based automatic redirect replaces hreflang; language switching is user-triggered.
  7. The declarations are generated from one configuration, not written twice in head and sitemap.

One closing standard: hreflang is correct or incorrect per group, not per page. Page-by-page checks almost always miss something, and building the matrix is the only reliable method. For the rest of the indexing chain see the website indexation guide, for multi-version mobile sites see mobile-first indexing, and for the broader set of site-level checks see the technical SEO checklist.

Source: Google Search Central documentation on localized versions and hreflang, compiled and interpreted by 16IDC.

Integration & Code Examples

Example 1: A language cluster must be reciprocal, with self-referencing canonicals

<!-- Every language version must declare the full cluster, including itself -->
<link rel="alternate" hreflang="zh-Hans-CN" href="https://www.example.com/zh-cn/pricing" />
<link rel="alternate" hreflang="zh-Hant-TW" href="https://www.example.com/zh-tw/pricing" />
<link rel="alternate" hreflang="en-US"      href="https://www.example.com/en-us/pricing" />
<link rel="alternate" hreflang="en-GB"      href="https://www.example.com/en-gb/pricing" />
<link rel="alternate" hreflang="ja-JP"      href="https://www.example.com/ja-jp/pricing" />

<!-- x-default points at the selector or default version, exactly once -->
<link rel="alternate" hreflang="x-default"  href="https://www.example.com/en-us/pricing" />

<!-- Canonical must be self-referencing: never point every locale at the English page -->
<link rel="canonical" href="https://www.example.com/zh-cn/pricing" />

A missing return link invalidates that edge of the cluster, which is the most common hreflang failure.

Example 2: Check reciprocity and self-reference before launch

import urllib.request
from html.parser import HTMLParser
PAGES = ["https://www.example.com/zh-cn/pricing",
         "https://www.example.com/en-us/pricing",
         "https://www.example.com/ja-jp/pricing"]

class Links(HTMLParser):
    found = {}
    def handle_starttag(self, tag, attrs):
        a = dict(attrs)
        if tag == "link" and a.get("hreflang") and a.get("href"):
            self.found[a["hreflang"].lower()] = a["href"]

def cluster(url):
    p = Links()
    p.found = {}
    p.feed(urllib.request.urlopen(url, timeout=20).read().decode("utf-8", "ignore"))
    return p.found

graph = {u: cluster(u) for u in PAGES}
for url, links in graph.items():
    back = sum(1 for l in graph.values() if url in l.values())
    print(url, "->", len(links), "declared, back-referenced by", back, "pages")
    if url not in links.values() or "x-default" not in links:
        print("  [WARN] missing self-reference or x-default:", url)

The script does three things: fetch clusters, compare return links, verify self-reference, which catches structural regressions in CI.

Limitations

  • It does not consolidate ranking signals, and it does not take on duplicate content.
  • Adding hreflang does not make a page "detected as" a language; it only acts in distribution.
  • This is also why pages whose body was never actually translated — only the template was — cannot be rescued by hreflang.
  • The rule is hard: if A declares B, B must declare A.
  • Build the habit instead: every page's hreflang list must include itself plus every other version in the cluster.

FAQ

How do you measure hreflang coverage across locales?

Per cluster, never per page. Build a matrix from every URL's hreflang declarations, pages as rows and declared targets as columns, and check that each cell is mirrored. With 5 languages plus one x-default, each page should carry 6 entries; two entries for one language means the cluster itself has duplicates.

How long can you wait before updating older pages?

Not at all — do it in the same release, rendered from 1 shared config. If the new page lists only itself and the older pages never link back, the engine ignores the group. Generate head and sitemap from that config so adding a version fills in every older page automatically.

Why does hreflang fail to work after adding it?

Usually a one-way declaration or an invalid code. A pointing at B without the reverse link makes the group ignorable; en-UK, zh_CN and zh-Hans-CN are all illegal formats. A declared target carrying noindex or a canonical elsewhere also voids it, so compare 20 cluster members with a script rather than by eye.

Related Providers

  • Google Search Console: when indexed language versions and geo targeting errors need confirming after launch, group impressions by directory and language here.
  • Semrush: when each language directory tracks keywords separately, build one project per region.
  • Ahrefs: when the hreflang cluster must be checked for complete mutual references, run a site audit to list missing and conflicting tags.

Community & Resources

Learning resources and tools

Original source: Google Search Central ↗