All articles
How-To

How to Set Up hreflang for Multilingual Sites

September 25, 20268 min readIzajul HaqueIzajul Haque

Last verified: 2026-09-20. AI platform behavior changes frequently — verify current details on the respective platform's site.

Set up hreflang by adding rel=alternate tags with hreflang attributes for each language and region, including a self-referencing tag, using ISO 639-1 language codes and ISO 3166-1 alpha-2 country codes, and ensuring bidirectional linking between all language versions.

Key Takeaways

  • hreflang tags must be reciprocal: if page A declares page B as its French alternate, page B must also declare page A as its English alternate.
  • Use ISO 639-1 language codes (en, fr, de) optionally combined with ISO 3166-1 region codes (en-GB, en-US, fr-FR) — never invent codes.
  • Add an x-default hreflang pointing to the fallback page for users whose language/region is not matched by any specific tag.
  • hreflang can be implemented in the HTML head, in HTTP headers, or in the XML sitemap — pick one method and use it consistently across all pages.
  • The hreflang value must point to the canonical URL for each language version, not to a redirect.


hreflang is the technical mechanism that tells Google which language version of a page to show to which audience. Without it, a multilingual site risks serving French users an English page, or cannibalizing rankings between language versions of the same content. hreflang is also one of the most commonly misconfigured SEO elements — missing reciprocal tags, wrong language codes, and non-canonical URLs are widespread. This guide walks through implementing it correctly from scratch.

Step 1: Audit your multilingual URL structure

Before writing any hreflang tags, map out your exact URL structure for each language version. hreflang works with three structures:

StructureExampleProsCons
Subdirectoryexample.com/fr/pageEasy to manage, shares domain authorityRequires correct routing setup
Subdomainfr.example.com/pageClear separationSplits domain authority
Separate domainexample.fr/pageStrongest local signalMost expensive to maintain

For each page, record the exact URL per language:

English: https://izajulhaque.com/services/seo
French:  https://izajulhaque.com/fr/services/seo
German:  https://izajulhaque.com/de/services/seo

These are the values you will use in the hreflang tags. They must be the canonical URL for each version — not a redirect URL. See how to set up canonical tags correctly for canonical URL guidance.

Check your hreflang tags now — Use the hreflang Tag Checker to inspect the hreflang implementation on any page URL: it validates language codes, checks reciprocity, and flags missing x-default tags.

Step 2: Choose the correct language and region codes

hreflang uses two code formats:

Language only:

en    → English (any region)
fr    → French (any region)
de    → German (any region)
es    → Spanish (any region)
zh    → Chinese (any region)
pt    → Portuguese (any region)
ja    → Japanese
ko    → Korean
ar    → Arabic

Language + region (when content differs by region):

en-US → English, United States
en-GB → English, United Kingdom
en-AU → English, Australia
fr-FR → French, France
fr-CA → French, Canada
es-ES → Spanish, Spain
es-MX → Spanish, Mexico
pt-BR → Portuguese, Brazil
pt-PT → Portuguese, Portugal
zh-CN → Chinese, Simplified (Mainland China)
zh-TW → Chinese, Traditional (Taiwan)

Rules:

  • All codes are lowercase
  • ISO 639-1 for language (two letters: en, fr, de)
  • ISO 3166-1 alpha-2 for region (two letters: US, GB, FR) — region is uppercase in the BCP 47 standard but Google accepts either case
  • Do not invent codes — an invalid code is silently ignored by Google

Step 3: Write the hreflang tags in the HTML head

Add one <link rel="alternate"> tag per language/region version plus one x-default tag:

<head>
  <!-- Self-referencing (current page language) -->
  <link rel="alternate" hreflang="en" href="https://izajulhaque.com/services/seo" />

  <!-- Alternate language versions -->
  <link rel="alternate" hreflang="fr" href="https://izajulhaque.com/fr/services/seo" />
  <link rel="alternate" hreflang="de" href="https://izajulhaque.com/de/services/seo" />
  <link rel="alternate" hreflang="es" href="https://izajulhaque.com/es/services/seo" />

  <!-- Fallback for unmatched languages/regions -->
  <link rel="alternate" hreflang="x-default" href="https://izajulhaque.com/services/seo" />

  <!-- Canonical tag (must match the self-referencing hreflang) -->
  <link rel="canonical" href="https://izajulhaque.com/services/seo" />
</head>

Region-specific example (en-US vs en-GB):

<head>
  <link rel="alternate" hreflang="en-US" href="https://izajulhaque.com/services/seo" />
  <link rel="alternate" hreflang="en-GB" href="https://izajulhaque.com/uk/services/seo" />
  <link rel="alternate" hreflang="x-default" href="https://izajulhaque.com/services/seo" />
  <link rel="canonical" href="https://izajulhaque.com/services/seo" />
</head>

Step 4: Make hreflang tags reciprocal

Reciprocity is the most commonly missed hreflang requirement. Every page in a cluster must reference every other page in the cluster.

The English page (/services/seo) must include:

<link rel="alternate" hreflang="en" href="https://izajulhaque.com/services/seo" />
<link rel="alternate" hreflang="fr" href="https://izajulhaque.com/fr/services/seo" />
<link rel="alternate" hreflang="de" href="https://izajulhaque.com/de/services/seo" />
<link rel="alternate" hreflang="x-default" href="https://izajulhaque.com/services/seo" />

The French page (/fr/services/seo) must include the same set:

<link rel="alternate" hreflang="en" href="https://izajulhaque.com/services/seo" />
<link rel="alternate" hreflang="fr" href="https://izajulhaque.com/fr/services/seo" />
<link rel="alternate" hreflang="de" href="https://izajulhaque.com/de/services/seo" />
<link rel="alternate" hreflang="x-default" href="https://izajulhaque.com/services/seo" />

The German page (/de/services/seo) must include the same set.

If any page in the cluster is missing the reciprocal tags, Google discards the hreflang signal for the entire cluster. Use the hreflang Tag Checker to verify every page returns the complete reciprocal set.

Step 5: Add x-default for the language-neutral fallback

The x-default tag tells Google which page to show when no language match is found. It typically points to:

  • A language selection page (/languages/ or /choose-language/)
  • Your primary language version (usually the English version)

<!-- x-default pointing to language selector -->
<link rel="alternate" hreflang="x-default" href="https://izajulhaque.com/language-select" />

<!-- x-default pointing to primary language version (more common) -->
<link rel="alternate" hreflang="x-default" href="https://izajulhaque.com/services/seo" />

The x-default tag must be present on every page in the cluster, not just the homepage.

Step 6: Verify with the hreflang tag checker and Search Console

After implementation:

1. Use the hreflang Tag Checker on each language version of a sample page
2. Verify: correct language codes, reciprocal tags present, x-default present, canonical URLs used
3. Open Google Search Console → International Targeting and check for hreflang errors
4. Monitor Search Console for "hreflang errors" in the Coverage report — common errors include "Missing return tags" (non-reciprocal) and "No return tag" (page only declared as alternate, not self-declared)

Allow 2-4 weeks for Google to recrawl all versions and apply the hreflang signal. See SEO consulting for help with multilingual SEO strategy.

Common mistakes

  • Missing reciprocal tags — If the English page declares a French alternate but the French page does not declare an English alternate, Google ignores the entire cluster. Every page must declare every other page. Use the hreflang Tag Checker to verify.
  • Using the wrong language code — gb is not a language code (it is a country code for Great Britain). The correct code for English as spoken in Great Britain is en-GB. Similarly, cn is not a code — use zh-CN for Simplified Chinese. Invalid codes are silently ignored.
  • Pointing hreflang to a redirect URL — If the French URL in your hreflang tag redirects to another URL, Google may follow the redirect or may not — the behavior is inconsistent. Always point to the canonical, final-destination URL for each language version. Use the Canonical Tag Checker to verify.
  • Forgetting x-default — Every page cluster needs an x-default. Without it, Google cannot determine the fallback for unmatched users. Add it to every page in the cluster.
  • Only adding hreflang to the homepage — hreflang must be implemented on every page that has a language alternate. Implementing it only on the homepage while ignoring inner pages means most of your site is still subject to language-mismatch rankings. See SEO consulting for full multilingual SEO implementation.

Frequently Asked Questions

Google ignores the entire hreflang cluster if tags are not reciprocal. If the English page says "fr version is /fr/page" but the French page does not say "en version is /en/page," Google cannot verify the relationship and discards the signal. The result is language-mismatch rankings — French users seeing the English page in results. Use the hreflang Tag Checker to verify reciprocity.

Yes, if your content differs significantly by region (e.g., en-US vs en-GB pages with different pricing, spelling, or content). If the content is identical between regions, duplicate it without hreflang and let Google determine regional preference from other signals (CDN location, domain TLD, structured data). If you add hreflang for region variants, treat them exactly like language variants — reciprocal tags, correct codes, x-default.

Yes. hreflang can be implemented in three places: the HTML head (most common), HTTP response headers (for non-HTML files), or the XML sitemap. All three methods are equally valid. Pick one and apply it consistently across all pages. Mixing methods on the same site does not cause errors but makes auditing harder. See how to fix a broken XML sitemap for sitemap implementation guidance.

Izajul Haque

Izajul Haque

SEO, AEO & GEO consultant. I help businesses get discovered, understood, and cited across Google, AI Overviews, ChatGPT, and Perplexity. More about Izajul →

Let's talk

Your next customer might not click a blue link — they'll ask an AI. Be the answer.

Book a free strategy call and I'll audit your visibility across Google, AI Overviews, ChatGPT, and Perplexity — then map out exactly what it takes to be found and cited.