Website Spec
← Internationalisation
Recommended

hreflang for language and regional URLs

hreflang tells search engines which language or regional version of a page to show to which user. It uses BCP 47 codes and must be reciprocal across all alternates.

What it is

hreflang is a signal that tells search engines a page has equivalent versions in other languages or regions. It lives on a <link rel="alternate"> element, an HTTP Link header, or a <xhtml:link> entry in an XML sitemap. Each alternate carries a BCP 47 language tag such as en, en-GB, fr-CA, or zh-Hant.

<link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/" />
<link rel="alternate" hreflang="en-US" href="https://example.com/en-us/" />
<link rel="alternate" hreflang="fr-CA" href="https://example.com/fr-ca/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

Why it matters

Without hreflang, search engines guess which version of a page to surface. A user in Paris may get the US English page; a user in Quebec may get the page intended for France. hreflang removes that guesswork, reduces duplicate-content confusion across localised URLs, and improves click-through because the result matches the user's language and region.

It does not influence ranking on its own. It is purely a swap signal: same query, better-matched URL.

How to implement

A sitemap entry covers all alternates of a URL in one place:

<url>
  <loc>https://example.com/en-gb/</loc>
  <xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/" />
  <xhtml:link rel="alternate" hreflang="fr-CA" href="https://example.com/fr-ca/" />
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/" />
</url>

Common mistakes

Sources