Home / Fix guides / Technical SEO

How to fix hreflang errors

Hreflang errors happen when the tags that link your language or country versions are wrong, incomplete or contradict each other. Fix them by making every version list all versions (including itself) with valid codes and working, indexable URLs.

Hreflang tags tell Google which language or regional version of a page to show to which visitor. An hreflang error means those tags are wrong, incomplete or contradict each other, so Google ignores them and may show the wrong version, such as your English page to a German searcher.

What hreflang errors look like

You rarely see the problem on the page itself. The signs show up elsewhere:

  • Visitors in one country land on the page meant for another (a US page in UK results, or English where a Spanish page exists).
  • Your translated pages barely appear in search, or the wrong version outranks the right one.
  • An SEO audit tool reports messages like "missing return tag", "invalid language code" or "hreflang points to a redirected or non-indexable URL".
  • Two near identical versions (for example US and UK English) compete with each other.

Why it matters

Hreflang is a hint, not a command, but a broken hint is simply ignored. The cost is practical: visitors who land on the wrong language leave, or see the wrong currency, shipping rules or legal wording. That means lost sales and less trust. Similar pages in the same language can also be treated as duplicates, so Google may show only one of them. It is not a security problem, but it quietly wastes the work you put into translating.

The most common errors

ErrorUsual causeFix
Missing return tagPage A points to page B, but B does not point backEvery version must list every other version
Invalid codeen-UK instead of en-GB, or a country alone like usLanguage first (en), then an optional region (en-GB)
Points to a redirect or errorOld URL, trailing slash mismatch, deleted pageUse the final URL that returns a normal page
Points to a noindex pageTranslation hidden from searchRemove noindex or remove the tag
No self referencePage lists others but not itselfAdd a tag pointing to its own URL
Conflict with canonicalCanonical points to another language versionEach version canonicals to itself
Relative URLs/de/ instead of the full addressUse full https:// URLs

How to check your site for free

  • Open a page, right click, choose View Page Source and search for hreflang. The tags usually sit in the <head> section.
  • Open your XML sitemap and look for xhtml:link lines, which is the other common place hreflang lives.
  • For files like PDFs, hreflang can be sent in the HTTP header. In a terminal, curl -I https://example.com/file.pdf shows the headers.
  • Crawlers such as Screaming Frog, or the site audit tools in Ahrefs and Semrush, report hreflang problems. Check which plan includes that report.
  • Search Console no longer has a dedicated hreflang report, but URL Inspection shows whether a page is indexed and which canonical Google chose.

SiteMonday checks this in week 36 (Multilingual readiness), and explains what it finds in a written report with a ranked fix list. Fixing is still up to you or your developer.

How to fix hreflang errors

  1. List every language and region version of the page, with its exact live URL.
  2. Pick one method only: tags in the <head>, HTTP headers, or the XML sitemap. Mixing them makes conflicts likely.
  3. On every version, list all versions, including the page itself.
  4. Use valid codes: a two letter language (en, de, fr), optionally followed by a region (en-GB, de-AT).
  5. Add one x-default entry for visitors who match none of your versions, such as a language picker or your main page.
  6. Make sure each URL loads normally, does not redirect, is not blocked or set to noindex, and has a canonical pointing to itself.
  7. Use full https:// addresses and keep them identical to the canonical URL, including the trailing slash.

A correct set for a page with US, UK and German versions looks like this, and the same block goes on all three pages:

<link rel="alternate" hreflang="en-US" href="https://example.com/us/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

If your canonical tags are wrong, hreflang will fail too, so see canonical pointing to the wrong page.

Common platforms

Menu names differ by version and theme, so look for the multilingual or localization settings.

  • WordPress: hreflang normally comes from a multilingual plugin such as WPML, Polylang or TranslatePress. A separate SEO plugin can output a second set, so make sure only one source is active. See the WordPress guide.
  • Shopify: hreflang is usually added automatically for languages and markets you set up in the admin. Errors tend to come from misconfigured domains or a theme that adds its own tags. See the Shopify guide.
  • Wix and Webflow: their built in multilingual and localization features generally add the tags for you. Check the language settings and that each translated page is published.
  • Next.js: the Metadata API supports an alternates.languages setting, and the Pages Router has built in i18n routing. Check what the rendered HTML actually contains.
  • Magento and Drupal: Drupal's multilingual modules usually output the tags for translated content. Magento often needs an extension or custom code, so check the store view setup.

How to confirm the fix worked

Start with View Page Source on each version and check the block is identical and complete. Then run a crawler again and confirm the error count has dropped. Google has to recrawl your pages before anything changes in search, which can take days or weeks. You can speed it up for key pages with Request Indexing in Search Console URL Inspection. Finally, ask someone in the target country to search for your brand or page and see which version appears.

How to stop it coming back

  • Let a plugin or the platform generate hreflang. Hand typed tags drift out of date.
  • When you add a page or language, make sure the new version links to all others and all others link to it.
  • When you change a URL, redirect the old one and update every hreflang tag that used it.
  • Recheck after migrations, theme changes and plugin updates, which are the usual moments tags get duplicated or lost.
  • Keep your sitemap in step with your live pages. Related problems are covered in the guide to a missing canonical tag.

Step by step for your platform

Questions

What is the correct code for the United Kingdom in hreflang?

Use `en-GB`. `en-UK` is a common mistake because UK is not the official country code. The language comes first, then the region.

Do I need hreflang if my site is only in one language?

No. It only matters when you have several versions of the same content for different languages or regions.

Do all pages need hreflang tags?

Only pages that have translated or regional equivalents. Each of those pages must list all its versions, including itself.

Why does Google say my hreflang tag has no return tag?

The page you point to does not point back to you. Add the matching tag on the other page, using the exact same URLs.

How long until hreflang fixes show up?

Google must recrawl the pages first, which can take days to weeks depending on your site. Requesting indexing for key pages can help.

Should I use hreflang for a language with no country, like just `de`?

Yes, that is fine and often best. Add a region such as `de-AT` only when you have a version made specifically for that country.

Related problems