Audit reference
WarningSEO

Invalid hreflang language code

What it means

These hreflang values are not valid language codes, or language and region codes. An unrecognised code is ignored, so the page is left out of its language group.

How to fix it

Use an ISO 639-1 language code, optionally followed by a hyphen and an ISO 3166-1 alpha-2 *region* code: en, en-GB, pt-BR. The region is a country, not a language: en-UK is wrong (the country code is GB), and en_us uses the wrong separator and case. The only value allowed that is not a language is x-default.

Finding it in CrawlStat

After a crawl, open Issues and pick Invalid hreflang language code. Click Show all in Pages to filter the Pages table to the affected pages, or Export affected to hand the list to whoever owns the fix. Audit ID: hreflang_invalid_code.