Hreflang attributes with invalid locale values (such as malformed language or region codes) prevent search engines from correctly understanding your site's inte
By Seoxpert Editorial · Published · Updated
Hreflang tags are essential for international SEO, ensuring users see the correct language or regional version of your content. If locale values are invalid, search engines like Google may ignore all hreflang annotations on the page, causing users to be served the wrong version or reducing your site's visibility in international search results.
Invalid hreflang locale values can cause search engines to disregard your international targeting signals, leading to decreased relevance for users in specific regions or languages. This can result in lower click-through rates, increased bounce rates, and missed opportunities in international markets.
This issue is typically detected through SEO audits using tools like Google Search Console, Screaming Frog, or Sitebulb, which flag invalid hreflang values. Manual inspection of the page source or HTTP headers can also reveal malformed hreflang codes.
Incorrect hreflang with underscore and typo
<link rel="alternate" hreflang="en_US" href="https://example.com/en/" />
<link rel="alternate" hreflang="en-UK" href="https://example.com/uk/" />Corrected hreflang with valid BCP 47 codes
<link rel="alternate" hreflang="en-US" href="https://example.com/en/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />Incorrect: Non-existent region code
<link rel="alternate" hreflang="en-XY" href="https://example.com/xy/" />Correct: Valid language and region codes, including x-defaul
<link rel="alternate" hreflang="en-US" href="https://example.com/en/" />
<link rel="alternate" hreflang="de-AT" href="https://example.com/at/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />A valid hreflang locale value is a language code (ISO 639-1) optionally followed by a region code (ISO 3166-1 Alpha 2), separated by a hyphen (e.g., en, en-US, de-AT). 'x-default' is also valid for specifying a default page.
No, hreflang values must use hyphens to separate language and region codes (e.g., en-US, not en_US). Underscores are invalid and will cause the hreflang annotation to be ignored.
If any hreflang value is invalid, search engines may ignore the entire set of hreflang annotations for that page, not just the invalid one.
You can use tools like Google Search Console's International Targeting report, or third-party validators such as Screaming Frog or Sitebulb, to check for invalid hreflang codes.
No, 'en-UK' is not valid. The correct region code for the United Kingdom is 'GB', so use 'en-GB'.
No, the region code is optional unless you want to target a specific country. For general language targeting, use only the language code (e.g., 'en').
Run a scan to see if Invalid Hreflang Locale Values affects your pages.
Scan my website →