Hreflang Explained: How It Works and the Most Common Mistakes

By Suraj · October 2, 2026

If you run a site in more than one language or country, you’ve probably heard the word “hreflang.” It sounds technical, and it has a reputation for being easy to get wrong. Both are fair.

The idea behind it is simple, though. This post explains what hreflang does, how to write it, and where it usually breaks. It goes deeper on one part of my international SEO guide for ecommerce, SaaS and marketplaces.

What is hreflang?

Hreflang is a small piece of code that tells search engines: these pages are the same content, written for different languages or countries. Show each one to the right audience.

For example, if you have an English page for the UK and another for the US, hreflang says which is which, so a searcher in London sees the UK page and a searcher in Chicago sees the US one.

Two things are worth knowing:

  • It’s a signal, not a command. Search engines treat hreflang as a strong hint. They usually follow it, but they can still decide differently.
  • It doesn’t boost rankings by itself. Its job is to show the right version to the right person and to stop your own versions from competing with each other.

Why it matters

Without hreflang, search engines have to guess which version to show. For businesses with similar pages across markets, such as the same product in UK and US English, that guess can go wrong in several ways:

  • The wrong country version appears in search results
  • Versions compete with each other and weaken one another
  • Visitors land on a page in the wrong language, currency or shipping zone, and leave

For ecommerce, SaaS and marketplaces, that means lost sales, bookings or sign-ups.

What it looks like

The most common way to add hreflang is as link tags in the head of each page. Here’s an example for a page that exists in three versions:

<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="de-DE" href="https://example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

Each line says: this URL is the version for this language and region. The same set of lines should appear on every version of that page.

The three ways to implement it

You can use any one of these, but pick one and stick with it:

  1. HTML link tags in the head of each page. Simple and common, but it can become heavy on large sites.
  2. XML sitemap. You list the alternates inside your sitemap. This often works better for large sites because it’s easier to manage in one place.
  3. HTTP headers. Mainly used for files like PDFs that don’t have an HTML head.

Mixing methods on the same pages is a common source of conflicts, so choose one source of truth.

The rules that make hreflang work

1. Every version must reference all the others, and itself.
Each page in the group lists every alternate, including its own URL. A self-reference is a recommended best practice, and incomplete sets are one of the main reasons hreflang gets ignored.

2. Links must be reciprocal.
If your UK page points to your US page, your US page must point back. One-way links may be ignored or misread.

3. Use the right codes.

  • Language first, using a valid two-letter code: en, de, fr
  • Then, optionally, a country: en-GB, en-US, fr-CA
  • A country on its own is not valid. GB alone does nothing
  • The UK is GB, not UK. en-UK is a classic mistake

4. Use full, absolute URLs.
Include the whole address, with https:// and the domain.

5. Point only to good pages.
Every URL in your hreflang set should load properly (a 200 status), be indexable, and not redirect. Pointing to broken, redirected or blocked pages makes the signal unreliable.

6. Add an x-default.
x-default is the fallback for visitors who don’t match any of your versions. It’s often a language picker or your main international homepage. Use it once per set, and make sure the other versions link back to it too.

7. Keep it consistent with your canonical tags.
Each version should usually canonicalize to itself. If a page’s canonical points somewhere else, the hreflang on it can be ignored. Hreflang and canonicals need to tell the same story.

The most common mistakes

Missing return links.
The classic one. Page A points to B, but B doesn’t point back. Often caused by adding a new market to the pages in one place and forgetting the rest.

No self-reference.
A page lists its alternates but not itself.

Wrong or invented codes.
en-UK, gb, english, or underscores instead of hyphens.

Pointing to redirected, broken or noindexed pages.
Hreflang to a URL that redirects or can’t be indexed is wasted.

Conflicts with canonical tags.
For example, every language version canonicalizing to the English page. That tells search engines the other versions aren’t worth indexing.

Mixed implementation.
Hreflang in the HTML for some pages, in the sitemap for others, and the two disagree.

Using it to target the wrong thing.
Hreflang is for pages that are genuine alternates of each other. Don’t use it to link loosely related pages.

Several x-default entries, or x-default on every page set incorrectly.
Use it once per group, pointing to the sensible fallback.

Hreflang on some page types, not others.
Handling the homepage correctly but missing product, category or blog pages is common, and each page needs its own correct set.

Inconsistent with the actual content.
If the “German” page is mostly English, or the “UK” version is an exact copy of the US one, hreflang can’t fix a content problem.

Why mistakes often go unnoticed

Hreflang errors rarely break the site. Nothing looks wrong to visitors. Instead you see symptoms: the wrong version ranking, a market that never takes off, or pages from different versions swapping places in search results. It’s easy to blame content or competition when the cause is a missing return tag.

I’ve worked on a multi-language store where a setup problem like this was behind weak performance across several markets. Fixing the foundation made more difference than any amount of new content would have. The pattern is common: if the signals aren’t clean, everything built on top of them struggles.

How to check your own setup

  1. Pick a few key pages from different templates, such as the homepage, a product or service page and a blog post.
  2. View the source or sitemap and list the hreflang entries for each.
  3. Confirm the checklist: self-reference, return links, valid codes, absolute URLs, working pages, one x-default.
  4. Compare with canonicals to make sure they agree.
  5. Use a crawler or hreflang testing tool to check many pages at once. Dedicated tools can flag missing return links and bad codes across the whole site.
  6. Check Google Search Console for indexing issues and watch which version appears for each country.
  7. Re-check after changes. Adding a market, changing URLs or migrating a site are the moments when hreflang breaks.

A quick checklist

  • Does every version list all the others, and itself?
  • Are all links reciprocal?
  • Are language and country codes valid (en-GB, not en-UK)?
  • Are all URLs absolute and returning a 200 status?
  • Are the pages indexable, with no redirects or noindex?
  • Is there one sensible x-default per set?
  • Do canonicals point to the page itself and agree with hreflang?
  • Am I using only one implementation method?
  • Have I checked key page types, not just the homepage?
  • Do I re-check after every new market or site change?

Final thoughts

Hreflang is a small piece of code with a big job: connecting your versions so search engines show the right one to the right person. Most problems come from the same few causes, such as missing return links, wrong codes and conflicts with canonicals, and all of them are fixable.

Treat hreflang as part of your launch process for every new market, not a one-time task, and check it again whenever the site changes.

If you suspect your setup isn’t working, my International SEO service includes hreflang audits, or you can get in touch.