In short
Ahrefs flags "Hreflang annotation invalid" when an hreflang value isn't a valid language code or language-region combination. Google requires an ISO 639-1 language code, optionally followed by an ISO 3166-1 Alpha 2 region code, such as en, en-US. A region code can't be used on its own. The classic mistake is en-UK; the UK's code is GB.
Hreflang values follow a strict format. One wrong code and Google ignores that annotation.
Valid and invalid examples
| Value | Valid? | Why |
|---|---|---|
| en | Yes | Language only |
| en-GB | Yes | Language + region |
| x-default | Yes | Special fallback value |
| en-UK | No | UK isn't an ISO region code; use GB |
| us | No | Region only; needs a language (en-US) |
| eng | No | Three-letter language code |
| en_US | No | Underscore instead of hyphen |
| jp | No | Japanese is ja; JP is the country |
es-419 (Spanish for Latin America) is a valid BCP 47 code but uses a numeric region. Google's documentation describes two-letter ISO region codes, so test carefully if you use it.
How to fix it
Export the invalid values from Ahrefs.
Correct each code in your plugin settings, templates or sitemap.
Recrawl and check the annotations again.
WordPress: check language settings in WPML, Polylang or TranslatePress, where each language has a locale code.
Shopify: codes come from your Markets and language settings. Invalid codes are rare; check manually added tags in theme.liquid.
Webflow: check each locale's subdirectory and language settings in Localization.
Wix: check the language and region chosen for each language in Wix Multilingual.
Custom builds: keep a single list of locales in config and generate tags from it.
This guide isn't affiliated with or endorsed by Ahrefs.
Related issues
Sources and references
Google Search Central, Tell Google about localized versions of your page

About the author
Nazmul Nikhil
Head of SEO & Assistant Manager, Digital Marketing at Notionhive
SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.



