prsona
Get started
Medium: fix this month

Hreflang errors: language tags that search engines quietly set aside

Last reviewed

Your translated or regional pages are labelled, but the labels do not hold up.

Hreflang is a tag that tells search engines which language or regional version of a page each searcher should see, for example English for the US and Spanish for Mexico. Errors come in a few familiar forms: a code that does not exist, such as en-UK instead of en-GB, a relative address instead of a full one, or a page its partner does not link back to. Google ignores tags that break these rules, so some visitors can be shown the wrong version. Fixes are usually made in the translation plugin or platform settings rather than one page at a time.

Why hreflang errors costs you customers

Businesses add language versions for real customers: Spanish speakers in your service area, or buyers in another country with their own prices and shipping. When the tags fail, search engines fall back on guessing, and a Spanish-speaking customer can land on the English page, or a UK visitor on US pricing. Some of them leave rather than hunt for a language switcher. The site itself works, so the cost shows up only as weaker results from exactly the audience the translation was built for.

What usually causes hreflang errors

  • A country code was guessed rather than looked up: UK is the classic slip, as the standard code is GB
  • A country code was used where a language code belongs, so "be" intended for Belgium is read as Belarusian
  • Tags were written with relative addresses such as /es/ instead of the full https address
  • A language version was added later and the existing pages were never updated to point to it, so the links run one way only
  • Tags hard-coded into the theme header clash with the ones a translation plugin writes
  • Every language version names the English page as its canonical, which contradicts the hreflang tags

How to check for hreflang errors yourself

  1. Open the code of a translated page through your browser menu and look for the word hreflang. Each line pairs a code, such as en-US or es, with an address.
  2. Read each code: the first part is a two-letter language (en, es, fr), and the optional second part is a two-letter country (US, GB, MX). Watch for UK, which should be GB, and for country codes standing alone.
  3. Check that every address starts with https:// and the full domain. Addresses beginning with a slash are relative and need rewriting.
  4. Open one of the listed pages and view its source as well. It must list the first page, and itself, with the same set of versions. If one page leaves its partner out, Google ignores that pair.
  5. Look for an x-default line. It names the page for visitors who match none of your versions, such as a language chooser or your main home page. Google recommends it, though leaving it out is not an error.

How to fix hreflang errors

  1. Let one system write the tags. On WordPress a translation plugin normally generates hreflang for every connected translation, so remove any tags typed directly into the theme's header file to stop the two clashing.
  2. On Shopify and Wix, the built-in multilingual features write hreflang for each published language, so errors there usually come from extra tags added through theme code or an app. Have your web person strip the extras out.
  3. Correct invalid codes in the plugin's language settings: en-GB for British English, and always a language code before any country code.
  4. Check that every version lists every other version and itself, including recently added languages. In most translation plugins that depends on each translation being linked to its original inside the plugin, not created as a standalone page.
  5. Have your developer set each language version's canonical to itself, not to the English page, so canonical and hreflang agree.
  6. Add x-default pointing at the language chooser or main home page if the site has one.

How Prsona catches hreflang errors

When your site uses hreflang, Prsona checks each tag for a valid language and region code, a full address, and a matching link back from the page it points to, and lists the pages with problems. Sites without hreflang tags are skipped.

Prsona looks for hreflang errors as part of an AI search and SEO audit and technical SEO monitoring.

See whether search engines can trust the language labels on your translated pages.

Questions about hreflang errors

Is it en-GB or en-UK in hreflang?

It is en-GB. Hreflang uses the ISO country code for the region, and in that standard the United Kingdom is GB. Google ignores UK because it is a reserved code, so an en-UK tag is skipped as though it were not there.

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

No. Hreflang is only for sites offering the same pages in more than one language or for more than one country, so a single-language site has nothing to label. The language of each page is declared separately, by the lang setting on the page, which every site should have.

What does a missing return link mean?

Page A lists page B as its translation, but page B does not list page A. Google requires the two pages to name each other and ignores the pair when one side is silent. It tends to happen when a language is added to a site and the older pages are left as they were.

Sources