/ โ† Learning Hub / Hreflang Fixes
On this page
  1. How a hreflang cluster works
  2. The fix guides, error by error
  3. Which errors to fix first
  4. Valid codes, and the ones that look right but are not
  5. HTML, HTTP header or sitemap: choosing where to declare
  6. A sensible order of work
  7. Questions and answers

How a hreflang cluster works

Hreflang works on groups of pages, usually called clusters. Every page in the cluster lists every version, including itself, with the language, and optionally the region, it serves. Here is a complete cluster for a page with British, Irish and French versions and a fallback:

<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/pricing/">
<link rel="alternate" hreflang="en-IE" href="https://example.com/ie/pricing/">
<link rel="alternate" hreflang="fr-FR" href="https://example.com/fr/tarifs/">
<link rel="alternate" hreflang="x-default" href="https://example.com/pricing/">

Exactly the same four lines go in the head of all four pages. That repetition is the point: Google only trusts a link between two pages when both pages confirm it. If the French page lists the British page but the British page does not list the French one, Google may ignore the annotation between them.

Four rules follow from this, and nearly every error the checker reports breaks one of them:

Hreflang is a signal, not a command. It helps Google choose between versions it has already decided to index; it does not force a page into the index, and it does not tell Google what language a page is in. Google works that out from the content itself.

๐Ÿ’ก Google retired the International Targeting report in Search Console some time ago, so there is no longer a built-in report of hreflang errors. A crawler-based check, such as the Hreflang Checker, is now the main way to find them.

The fix guides, error by error

Each guide explains one error the checker reports: how it breaks the cluster, how to find every instance, how to fix it and how to stop it coming back.

Errors in the structure of the cluster

Fixing missing return tags covers reciprocity, how to audit it across thousands of pages, and generating annotations from one source so pairs cannot fall out of step. Adding missing self-referencing hreflang covers why each page must list itself, one of the most frequent reasons a cluster is not honoured. Adding a missing x-default covers the fallback for visitors who match none of your locales, and whether it should point to a language picker or to an international English page.

Errors in the values

Fixing invalid language codes covers the ISO standards behind the codes and the usual slips, such as en-UK for en-GB, or a country code used where a language code belongs.

Errors caused by other signals

Fixing hreflang and canonical conflicts covers the case where locale pages name one another as canonical, which tells Google they are duplicates and undermines the whole cluster. Fixing sitemap and HTML hreflang mismatches covers annotations declared in two places that disagree, and how to choose one source to maintain. Fixing hreflang pointing at 404s or redirects covers targets left behind after deletions, launches and migrations, and automated checks that catch them. Fixing blocked or noindexed hreflang targets covers targets that robots.txt blocks or that carry noindex, which Google cannot use.

By platform

Hreflang in WordPress covers WPML, Polylang and TranslatePress, clashes with SEO plugins, and multisite versus a single site with a translation plugin. Hreflang in Shopify covers the annotations Shopify Markets generates, country domains versus subfolders, and errors that appear when a new market is launched. Hreflang in Next.js and Nuxt covers generating annotations from the i18n routing configuration and adding them through each framework's head or metadata system.

Which errors to fix first

Some errors invalidate a whole cluster; others only weaken one link in it. Fix the structural ones first, because a perfect language code is no help on a page Google cannot use.

  1. Canonical conflicts. If locale pages point their canonicals at one another, Google treats them as copies of one page and the hreflang has nothing to work with.
  2. Blocked, noindexed, broken or redirecting targets. A target Google cannot index cannot be shown to anyone, so every annotation pointing at it is wasted.
  3. Missing return tags and self-references. These are the most common errors and the most damaging to a cluster that is otherwise correct.
  4. Invalid codes. An unrecognised value is ignored, so that locale is effectively missing from the cluster.
  5. Sitemap and HTML disagreements. Resolve them by choosing one source and removing the other.
  6. A missing x-default. Recommended rather than required, but it gives you a say over what visitors outside your target markets see.
โš ๏ธ Hreflang does not redirect anyone. Automatically redirecting visitors by IP address or browser language can stop Google, which mostly crawls from the United States, from seeing your other versions at all. Offer a clear language or country switcher instead, and let hreflang handle search.

Valid codes, and the ones that look right but are not

A hreflang value is a language code from ISO 639-1, optionally followed by a hyphen and a region code from ISO 3166-1 alpha-2. A region on its own is not valid. Case does not matter, but the usual style is lower-case language and upper-case region. Many invalid values are country codes used by mistake, and several of them happen to be real codes for a different language.

Written asProblemCorrect value
en-UKThe ISO code for the United Kingdom is GBen-GB
uk for a UK pageuk is Ukrainianen-GB
gbA country used as a languageen-GB
jpCountry code, not languageja or ja-JP
cnCountry code, not languagezh-CN, or zh-Hans for Simplified script
se for Swedense is Northern Samisv or sv-SE
dkCountry code, not languageda or da-DK
grCountry code, not languageel or el-GR
en-EUThe EU is not a region code accepted for hreflangOne value per country, or plain en
es-LANot a country codeOne value per country, or plain es

Use a region only when the content really differs by country, for example prices in euros for Ireland and pounds for the UK. If you have one English page for everyone, plain en is clearer than listing it several times under different regions.

HTML, HTTP header or sitemap: choosing where to declare

Google accepts hreflang in three places, and treats them as equivalent:

A sitemap entry for the British pricing page looks like this, and a matching entry is needed for every other version:

<url>
  <loc>https://example.com/uk/pricing/</loc>
  <xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/uk/pricing/"/>
  <xhtml:link rel="alternate" hreflang="en-IE" href="https://example.com/ie/pricing/"/>
  <xhtml:link rel="alternate" hreflang="fr-FR" href="https://example.com/fr/tarifs/"/>
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/pricing/"/>
</url>

The sitemap's opening urlset element must declare the xhtml namespace for these entries to be read. Using two methods at once is allowed, but it doubles the maintenance and creates the risk the checker flags as a mismatch: one source updated, the other forgotten. For most sites the better choice is one method, generated automatically from the same list of locales and addresses the site uses for its menus and language switcher.

A sensible order of work

  1. Write down your locale plan: every language and country you serve, and the address pattern for each.
  2. Run the Hreflang Checker on the main page of each locale and let it follow the cluster.
  3. Fix canonicals so that every locale page is its own canonical.
  4. Remove or repair targets that are blocked, noindexed, redirected or missing.
  5. Choose one declaration method and generate the full cluster, with self-references and return tags, from a single source.
  6. Correct any invalid codes and add x-default.
  7. Run the checker again, and add it to your launch checklist for new markets and URL changes.

For the full reference, read the Hreflang Guide, see a finished report in the example report, or start with the beginner tutorial if hreflang is new to you.

Questions and answers

1. Do I need hreflang if my site is only in English?

Usually not. Hreflang is for sites with more than one version of the same page for different languages or regions. A single English site serving everyone does not need it. It becomes useful if you run separate English pages for different countries, such as the UK, Ireland and Australia, with different prices, spelling or delivery details, because those pages are otherwise very similar and Google needs help deciding which one to show to a searcher in each country.

2. What happens if hreflang return tags are missing?

Google only trusts a hreflang link between two pages when both pages confirm it. If the French page lists the British page but the British page does not list the French one, Google may ignore the annotation between them. The result is that searchers can be shown the wrong version, for example the British page in France. The fix is to make every page in the cluster list every version, including itself, ideally generated automatically from one list of locales.

3. Is en-UK a valid hreflang code?

No. Hreflang uses ISO 3166-1 alpha-2 codes for regions, and the code for the United Kingdom is GB, so the correct value is en-GB. A value of en-UK is not recognised, which means that version is effectively missing from the cluster. A related trap is using uk on its own, which is the language code for Ukrainian. The Hreflang Checker flags invalid codes, and the same GB rule applies to the lang attribute and to og:locale.

4. What should x-default point to?

It should point to the page you want shown to searchers who do not match any of the languages or regions in the cluster. On many sites that is a language or country selection page. On others it is an international English version, or the main version of the page for the biggest market. The x-default page should itself be a working, indexable page and should be listed in the same cluster on every page, just like the other versions.

5. Should each language version have its own canonical?

Yes. Every locale page should use a canonical tag pointing to its own address. If the French and German pages point their canonicals at the English page, you are telling Google that they are duplicates of the English page, which contradicts the hreflang that says they are alternatives for different audiences. Google tends to follow the canonical, so the translated pages may drop out of the index and the hreflang cluster stops working.

6. Is it better to put hreflang in the sitemap or in the HTML?

Google treats both as equivalent, so choose the one you can keep accurate. HTML link tags are easy to see and check on each page, which suits small sites. A sitemap keeps pages lighter and is easier to generate centrally, which suits large sites with many locales. Avoid maintaining both by hand, because they tend to drift apart and send conflicting signals. Whichever you choose, generate it from the same list the site uses for its language switcher.

7. Does hreflang help my pages rank higher in other countries?

Not in the sense of lifting rankings. Hreflang helps Google choose which of your existing versions to show in each country or language, so the right page appears where you already have visibility. It does not replace the work of earning rankings in a new market, such as translated content written for local searchers, local links and relevant details like currency and delivery. Think of it as routing traffic to the right page rather than creating more of it.

Check your hreflang clusters now

The Hreflang Checker follows each cluster of locale pages and validates return tags, language codes, x-default, sitemap consistency, target reachability and canonical alignment, with the guide that fixes each error.

Run the Hreflang Checker โ†’
๐Ÿ’ฌ Got a problem?
Related Guides: Hreflang Guide  ·  Example Report  ·  Beginner Tutorial  ·  Learning Hub

About aiwebpageseo

aiwebpageseo.com is a data-driven SEO and AEO (Answer Engine Optimisation) platform providing a free suite of technical SEO tools. Rather than relying on AI-theorised assumptions, the platform analyses live URL performance, delivering objective diagnostics, page speed metrics, CLS debugging, and site crawl data alongside actionable technical tutorials.