Skip to content
FunnelGuard

Fix guide by FunnelsGuard

hreflang wrong language or region codes (en-UK): how to fix

SEO-267Medium impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

hreflang is an annotation that links alternate versions of a page for different languages or countries. Each value is made of a language code (ISO 639-1, like en, de, fr) and, optionally, a region code (ISO 3166-1 alpha-2, like GB, US, DE). Search engines read the value literally. If it is not a valid code, the annotation is ignored.

Common wrong hreflang values and their fixes
Wrong valueWhy it is wrongCorrect value
en-UKUK is not an ISO region code; the UK is GBen-GB
en_USUnderscore instead of hyphenen-US
usRegion only, no language. Region cannot be used aloneen-US
gbRegion used as language (gb is not a language)en-GB
engThree-letter code, not ISO 639-1en
jpjp is the country code, not the languageja or ja-JP
zh-cn / zhFine in case terms, but script is clearer for Chinesezh-CN or zh-Hans / zh-Hant
en-EUEU is not a country code for hreflangen (or en-IE, en-DE and so on)

Why it costs you leads or sales

How a wrong code sends buyers to the wrong page
  1. UK searcherSearches in Google UK
  2. hreflang en-UKInvalid code, ignored
  3. US page shownDollar prices, US shipping
  4. Checkout or enquiryVisitor leaves

The invalid tag is ignored, so Google picks a version on its own.

How to check if your site has it

Find invalid hreflang codes
  1. View the page source

    Open a page, right-click and choose View page source, then search for hreflang. Read every value in <link rel="alternate" hreflang="...">.

  2. Check the XML sitemap

    If your hreflang lives in the sitemap, open it and look at each hreflang attribute on xhtml:link entries.

  3. Check HTTP headers

    For PDFs and non-HTML files hreflang can be sent in a Link header. Use curl -I on the URL.

  4. Crawl the whole site

    Run a crawler that reports hreflang (for example Screaming Frog's Hreflang tab, or Sitebulb) and filter for incorrect or unsupported values.

  5. Compare against the ISO lists

    Look up any doubtful language in ISO 639-1 and any region in ISO 3166-1 alpha-2.

Quick scan of a page for hreflang valuesbash
curl -s https://www.example.com/ | grep -io 'hreflang="[^"]*"'

How to fix it

Correct hreflang set with valid codeshtml
<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/" />
<link rel="alternate" hreflang="en-US" href="https://www.example.com/us/" />
<link rel="alternate" hreflang="de-DE" href="https://www.example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://www.example.com/" />
Where to correct the codes
  1. Find the source

    Hreflang usually comes from a multilingual plugin (WPML, Polylang, TranslatePress) or an SEO plugin. Open its language settings.

  2. Fix the locale

    Set the language's locale or hreflang code to en-GB, not en-UK. In WPML this is under WPML > Languages > Edit Languages; in Polylang under Languages > Languages, check the Locale and hreflang field.

  3. Clear caches

    Purge page and CDN caches, then view source to confirm.

Fix order of work
  1. List every language and country version

    Write down each URL and the audience it serves.

  2. Assign a valid code to each

    Use a language alone (de) when it covers all countries, or language-region (de-AT) when you have a country-specific page.

  3. Update every page in the set

    Each page must list all versions, including itself, with the same codes. Fix the wrong code everywhere, not only on one page.

  4. Keep one method

    Use head tags or the sitemap, not both with different values.

hreflang before and after

Before

  • hreflang="en-UK" on the UK page
  • Underscore codes such as en_US
  • Google ignores the entries
  • Wrong country version can rank

After

  • hreflang="en-GB" and en-US
  • Hyphen separators everywhere
  • Entries are valid and reciprocal
  • Each market gets its own version

How to confirm it's fixed

Confirmation checks
  • View source on each version and confirm every hreflang value is a valid ISO code
  • Re-crawl the site and see no invalid or unsupported hreflang values
  • Check that each page lists itself and all alternates with matching codes
  • Confirm the head and sitemap use the same values
  • Use a Google search in the target country (or Search Console performance filtered by country) over the next weeks to see the right version appear

How to prevent it happening again

Prevention
  • Keep one mapping table of locale to hreflang code and use it in templates and sitemaps
  • Never type region codes by hand; pick them from a list
  • Add an hreflang check to your launch checklist for every new language or country
  • Run a scheduled crawl monthly and after theme, plugin or migration changes
  • Review the International Targeting and indexing reports in Search Console after changes

How FunnelGuard handles this

Questions people ask

Is hreflang en-UK correct?

No. The ISO region code for the United Kingdom is GB, so the correct value is en-GB. Google does not recognise en-UK, so it ignores that annotation.

What is the correct hreflang code for the United Kingdom?

Use en-GB for English content aimed at the UK. If the whole site is English and you do not need to separate countries, plain en also works.

Why is my hreflang not working?

Common causes are invalid language or region codes, underscores instead of hyphens, missing return links between pages, and tags pointing to redirected or noindex URLs. Start by checking the codes against the ISO lists, then check that every page links back to the others.

Can I use a country code on its own in hreflang?

No. The language is required and the region is optional. us alone is invalid; use en-US or just en.

Does hreflang use an underscore or a hyphen?

A hyphen. Write en-GB, not en_GB. Underscores are common in locale settings of CMS software, so check what your plugin outputs.

Is hreflang case sensitive?

No, en-gb and en-GB are read the same way. The convention is lowercase language and uppercase region for readability.

How do I find wrong hreflang codes across a whole site?

Run a crawler that reports hreflang, such as Screaming Frog or Sitebulb, and filter for incorrect or unsupported language codes. You can also check the XML sitemap and page source by hand for small sites.

Does FunnelGuard check hreflang codes?

Not yet. It is a possible future check. FunnelGuard currently monitors your forms, checkouts, tracking hits and lead delivery, so use a crawler or Search Console for hreflang.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.