Hreflang tags

Hreflang tags tell search engines which language or region version of your content to show in which country. They're easy to understand in theory, legendary for being broken in practice. Getting hreflang right on a multi-region site can mean the difference between your US visitors seeing US dollar prices and seeing the wrong currency. This page walks through what hreflang does, the three ways to implement it, the common mistakes that silently break it, and when you actually need it.

The mental model

Hreflang is about showing the right version to the right user. Without it, Google guesses based on a handful of signals (domain, content language, user location) and gets it wrong regularly. With it, you're telling Google directly: "I have a UK English version, a US English version, a French version. Send UK users to UK, US users to US, French users to French."

Think of it as a switchboard. Every hreflang-declared URL knows about every sibling.

A quick example

You have three versions of a product page:

Hreflang lets you tell Google: show the US version to US searchers, UK to UK, French to French. Without hreflang, Google often shows the wrong one.

The three implementation methods

HTML head tags (most common)

<link rel="alternate" hreflang="en-us" href="https://example.com/us/product" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/product" />
<link rel="alternate" hreflang="fr-fr" href="https://example.com/fr/product" />
<link rel="alternate" hreflang="x-default" href="https://example.com/us/product" />

HTTP headers (for non-HTML files)

Link: <https://example.com/us/product>; rel="alternate"; hreflang="en-us"

XML sitemap

<url>
  <loc>https://example.com/us/product</loc>
  <xhtml:link rel="alternate" hreflang="en-us" href="https://example.com/us/product"/>
  <xhtml:link rel="alternate" hreflang="en-gb" href="https://example.com/uk/product"/>
</url>

Valid language and region codes

The x-default fallback

The x-default tag specifies a fallback for users whose language and region don't match any of your specific hreflang values. Usually your US English or generic international-English version. Include it on every page.

Common mistakes that silently break hreflang

The implementation nightmare

For a site with 10 languages times 20 countries, that's 200 page variations. Every page needs 200 hreflang references to be complete. Managing that in head tags becomes unmaintainable fast.

For large multi-region sites, the XML sitemap approach is the sanity-preserving choice. You can generate hreflang in a programmatic, testable way, and you only manage one file per locale set.

Testing hreflang

When not to use hreflang

What to do with this

If you operate in multiple countries and don't have hreflang set up, this is a high-ROI project. US visitors buying from your UK site in pounds is a conversion disaster you can fix with a weekend of work. If you do have hreflang, audit it with Merkle's tool for reciprocation errors. Those are the quiet bugs that keep your implementation at 70% effectiveness.

Next: page speed, the technical lever that pays off in rankings and conversions simultaneously.

What they do

Suppose you have three versions of a page:

Hreflang tells Google: show the US version to users in the US, UK version to UK users, French version to French users. Without hreflang, Google guesses (often wrongly).

The syntax

Each page references every version (including itself). Three implementations, pick one:

1. HTML head tags (most common)

<link rel="alternate" hreflang="en-us" href="https://example.com/us/product" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/product" />
<link rel="alternate" hreflang="fr-fr" href="https://example.com/fr/product" />
<link rel="alternate" hreflang="x-default" href="https://example.com/us/product" />

2. HTTP headers (for non-HTML files)

Link: <https://example.com/us/product>; rel="alternate"; hreflang="en-us"

3. XML sitemap

<url>
  <loc>https://example.com/us/product</loc>
  <xhtml:link rel="alternate" hreflang="en-us" href="https://example.com/us/product"/>
  <xhtml:link rel="alternate" hreflang="en-gb" href="https://example.com/uk/product"/>
  ...
</url>

Valid language/region codes

x-default

The x-default tag specifies a fallback version for users whose language/region doesn't match any specific hreflang. Usually your US English or international-English version.

Common mistakes

The implementation nightmare

For a site with 10 languages × 20 countries = 200 page variations, every page needs 200 hreflang references. This gets unmaintainable fast in head tags. For large sites, XML sitemap hreflang is the sanity-preserving choice.

Testing

When NOT to use hreflang