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.
| Wrong value | Why it is wrong | Correct value |
|---|---|---|
| en-UK | UK is not an ISO region code; the UK is GB | en-GB |
| en_US | Underscore instead of hyphen | en-US |
| us | Region only, no language. Region cannot be used alone | en-US |
| gb | Region used as language (gb is not a language) | en-GB |
| eng | Three-letter code, not ISO 639-1 | en |
| jp | jp is the country code, not the language | ja or ja-JP |
| zh-cn / zh | Fine in case terms, but script is clearer for Chinese | zh-CN or zh-Hans / zh-Hant |
| en-EU | EU is not a country code for hreflang | en (or en-IE, en-DE and so on) |
Why it costs you leads or sales
- UK searcherSearches in Google UK
- hreflang en-UKInvalid code, ignored
- US page shownDollar prices, US shipping
- 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
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="...">.Check the XML sitemap
If your hreflang lives in the sitemap, open it and look at each
hreflangattribute onxhtml:linkentries.Check HTTP headers
For PDFs and non-HTML files hreflang can be sent in a
Linkheader. Usecurl -Ion the URL.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.
Compare against the ISO lists
Look up any doubtful language in ISO 639-1 and any region in ISO 3166-1 alpha-2.
curl -s https://www.example.com/ | grep -io 'hreflang="[^"]*"'How to fix it
<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/" />Find the source
Hreflang usually comes from a multilingual plugin (WPML, Polylang, TranslatePress) or an SEO plugin. Open its language settings.
Fix the locale
Set the language's locale or hreflang code to
en-GB, noten-UK. In WPML this is under WPML > Languages > Edit Languages; in Polylang under Languages > Languages, check the Locale and hreflang field.Clear caches
Purge page and CDN caches, then view source to confirm.
Use Markets
Shopify outputs hreflang itself for domains and languages set up under Settings > Markets. Check the language and country there rather than editing code.
Check theme or app code
If a translation app or your theme (
theme.liquid) adds extra hreflang tags, correct the values or remove duplicates.
Avoid tag-injected hreflang
If a Custom HTML tag injects hreflang with JavaScript, edit the values there, but prefer moving the tags into the server-rendered head, as it is more reliable.
Localization settings
If you use Webflow Localization, check each locale under Site settings > Localization; the language and region come from the locale you chose.
Manual tags
If you added tags by hand in page settings > Custom code in head, edit the
hreflangvalues there.
Wix Multilingual
Wix creates hreflang from the languages you add in Multilingual. Check that the language and region variant you picked is the one you want (for example English with the UK region).
Code injection
Squarespace has no built-in hreflang for separate sites. If you added tags in Settings > Advanced > Code Injection or per-page header injection, correct the codes there.
Fix the template
Find where your templates build the hreflang value and map locales to valid codes. Do not hand-write
UK; map it toGB.Fix the sitemap
If you generate sitemap hreflang, apply the same mapping there.
List every language and country version
Write down each URL and the audience it serves.
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.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.
Keep one method
Use head tags or the sitemap, not both with different values.
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
- 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
- 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.
Related issues
- SEO-265hreflang missing on multi-language sitesFix guide
- SEO-266hreflang without return links (not reciprocal)Fix guide
- SEO-268hreflang points to redirecting, 404 or noindex pagesFix guide
- SEO-269hreflang points to non-canonical URLsFix guide
- SEO-270x-default missingFix guide
- SEO-278Wrong country version ranks in a marketFix guide