hreflang link structure diagram showing reciprocal alternate links between English, French, and German page versions
SEO Tools

hreflang Explained — Implementation, Common Mistakes, and Validation

Sunny Pal Singh · · 7 min read

hreflang is one of the most error-prone elements in international SEO. The syntax is unforgiving, the required reciprocal linking adds complexity that scales with every language/region combination, and the failure mode is silent — Google just picks a different page than you intended without any warning or error. This guide covers what hreflang does, exactly how to implement it, and how to validate it before it quietly costs you rankings in the wrong market.

A multilingual site without hreflang isn't broken — it just leaves Google guessing which version to show to which users. That guess is often wrong. French users see the English version. US users see the international version. A UK user searching in English lands on a German-language page. These aren't algorithm failures; they're missing hreflang signals that would have told Google exactly what to do.

The technical barrier to hreflang is low. The implementation discipline required is high. Every page in a cluster must declare all alternates. Every declaration must be reciprocal. Every URL must resolve. One missing tag in one page quietly breaks the entire cluster for that page.

Key Takeaways

  • hreflang tells Google which page to show for which language/region combination — it's a hint, not a directive
  • Every hreflang relationship must be reciprocal — if page A declares hreflang pointing to page B, page B must also declare hreflang pointing back to page A
  • The x-default value indicates the fallback page for users whose language/region doesn't match any specific alternate
  • hreflang uses ISO 639-1 language codes (en, fr, de) and optionally ISO 3166-1 alpha-2 region codes (en-US, en-GB, fr-FR)
  • Invalid hreflang implementations are common and silent — validate with Google Search Console's International Targeting report

What hreflang Does

hreflang is an HTML link attribute (or HTTP header or sitemap element) that tells Google: "this page has alternate versions for other languages or regions — here's where they are." When implemented correctly, Google shows users the most appropriate version of your page based on their browser language settings and geographic location.

Without hreflang on a multilingual site, Google consolidates what it considers duplicate or near-duplicate content and picks one canonical version to show globally. It often picks correctly for the dominant language, but fails at the edges — regional variants of the same language (en-US vs en-GB), or markets where your site has meaningful but secondary traffic.

hreflang does not control what users see when they land on your site directly — it only influences which version Google surfaces in search results for a given user's context.

hreflang Syntax

In the <head> of each page, declare alternate links for the entire cluster:

<!-- On the English (US) version -->
<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-FR" href="https://example.com/fr/page/">
<link rel="alternate" hreflang="x-default" href="https://example.com/en-us/page/">

The same complete set of <link> tags must appear on every alternate version — each page lists itself and all its siblings:

<!-- On the French (France) version — identical tag set -->
<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-FR" href="https://example.com/fr/page/">
<link rel="alternate" hreflang="x-default" href="https://example.com/en-us/page/">

This reciprocal requirement is the most common source of implementation errors. One page missing the tags, or declaring a slightly different URL, breaks the cluster for that page.

Language Codes and Region Codes

hreflang values use ISO 639-1 two-letter language codes, optionally combined with ISO 3166-1 alpha-2 region codes:

hreflang valueMeaning
enEnglish, any region
en-USEnglish, United States
en-GBEnglish, United Kingdom
frFrench, any region
fr-FRFrench, France
fr-CAFrench, Canada
zh-HansSimplified Chinese
zh-HantTraditional Chinese
x-defaultFallback for unmatched languages/regions

Key rules: language codes are lowercase (en, not EN); region codes are uppercase (en-US, not en-us) — though Google accepts both cases. Use language-only (en) when you have one English version for all regions. Use language+region (en-US, en-GB) only when the content differs meaningfully between regions — pricing, date formats, legal terms, product availability.

The x-default Value

x-default specifies the fallback page shown when a user's language or region doesn't match any of your declared alternates. If you have en-US and fr-FR and a Japanese user searches, they see the x-default page.

x-default typically points to your global homepage, your international English version, or a language selector page. It should always be a useful destination — not a 404, and ideally not a page entirely in a language the user probably doesn't read.

Omitting x-default doesn't break the cluster, but including it is good practice for any site with meaningful traffic outside the declared language/region combinations.

Implementation Methods

HTML <link> tags in <head> — the standard method shown above. Must be server-rendered — not added by JavaScript. Crawlers read hreflang from the HTTP response, not the rendered DOM. If your CMS adds hreflang via JavaScript, many crawlers (including Bing) won't see it.

HTTP response headers — for non-HTML files (PDFs, images serving as content pages): send hreflang in the HTTP response headers:

Link: <https://example.com/fr/doc.pdf>; rel="alternate"; hreflang="fr-FR"

XML Sitemap — list all hreflang relationships using the xhtml:link namespace. This is often easier to maintain on large sites — one file to update rather than every page's HTML:

<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="fr-FR"
    href="https://example.com/fr/page/"/>
  <xhtml:link rel="alternate" hreflang="x-default"
    href="https://example.com/en-us/page/"/>
</url>

Sitemap-declared hreflang still requires reciprocal entries — every alternate URL must appear in its own <url> block with the full set of xhtml:link elements.

Common Mistakes

MistakeEffectFix
Missing reciprocal tags Google ignores the signal for that page Every page must list all alternates including itself
Wrong language code Google can't match the signal Use ISO 639-1 (de, not german)
hreflang added via JavaScript Most crawlers can't read it Must be in server-rendered HTML response
Missing x-default No fallback for unmatched languages Add x-default pointing to your global/fallback page
hreflang pointing to a 404 Signal breaks for the entire cluster Validate all hreflang URLs return 200
Canonical conflicts hreflang and canonical signals cancel out Each hreflang URL must also be self-canonical
Inconsistent URL format Google treats trailing-slash and non-trailing-slash as different URLs Use the same URL format throughout the cluster

hreflang and Canonical Tags

hreflang and canonical tags interact directly: each page in an hreflang cluster should be self-canonical. A page that hreflang-links to page B but canonicals to page C sends conflicting signals. Google may follow the canonical and treat the hreflang as pointing to an uncanonical URL, effectively discarding the signal.

The rule: every page's <link rel="canonical"> should point to that page's own URL. If a page canonicals to a different URL, include the canonical URL in the hreflang cluster — not the original URL. Don't include non-canonical URLs in hreflang declarations.

Quick validation check: pick two pages that should be reciprocally linked — for example your English and French homepages. View source on each and confirm that each lists the other in its hreflang tags. If one is missing the other, the implementation is broken for that page. This manual check takes 60 seconds and catches the most common error before it costs rankings.

Validating hreflang

Google Search Console → Settings → International Targeting — shows detected hreflang tags, language/region breakdown, and flagged errors. Takes 2–4 weeks to populate after initial implementation. The most authoritative source for whether Google successfully processed your hreflang signals.

View source manually — fastest for spot-checking individual pages. Search for hreflang in the raw HTML. Confirms the tags are server-rendered (not JavaScript-injected) and present.

curl — confirm hreflang is in the raw HTTP response, not the rendered DOM:

curl -s https://example.com/en-us/page/ | grep hreflang

If this returns nothing but the rendered page has hreflang tags, they're being added by JavaScript and crawlers won't see them.

ByteWaveNetwork SEO Analyzer — crawls your entire site and surfaces canonical mismatches, which frequently co-occur with hreflang errors. Pages where the canonical URL doesn't match the declared hreflang URL are highlighted in the canonical column. Running a full site crawl after implementing hreflang catches both issues at scale.

When You Don't Need hreflang

hreflang is only necessary when you have multiple pages serving the same (or similar) content in different languages or for different regions. If your site is in one language and targets one region, hreflang adds no value. If you have a French-language blog post and an English-language blog post covering entirely different topics, they're not alternates — don't link them with hreflang.

Common cases where hreflang is genuinely needed: e-commerce sites with country-specific pricing and localised product descriptions; news sites publishing the same story in multiple languages; SaaS products with separate landing pages per market; corporate sites with regional offices and localised content.

Audit Your Site's SEO Signals

Free, no signup. The SEO Analyzer crawls every page on your site and flags canonical mismatches, missing metadata, and indexability issues — helping catch hreflang conflicts before they affect rankings.

Try the SEO Analyzer Free →
SP

Sunny Pal Singh

Fellow · Technical Director — AI Infrastructure, Cloud Orchestration & Network Automation

Sunny is a Fellow and Technical Director specialising in AI infrastructure, cloud orchestration, and network automation. With hands-on depth across AWS, Azure, GCP, Red Hat OpenStack, and OpenShift, he leads high-performing teams of architects and engineers building transformative solutions at scale. He built ByteWaveNetwork to bring the same engineering rigour to everyday web tooling.

Affiliate disclosure: Some links on this page may be affiliate links. We only mention tools we've personally used and have an honest opinion about. Affiliate revenue helps keep ByteWaveNetwork's tools free and maintained. We are not paid by any of the tools compared in this article for favorable coverage.

Choose design