Invalid hreflang code

hreflang.incorrect_lang_codes
Priority
Medium
Severity
Warning

What we look for

The hreflang tags (lines in <head> listing the page's versions in other languages) on these pages use a code that is not a valid language, or language and region, such as en-UK instead of en-GB.

Why it matters

Google ignores a version whose code it does not support, so searchers in that language or region may not be sent to it.

How to fix

Correct each code in the page template or the plugin that writes the tags: a two-letter language (en), optionally followed by a two-letter country (en-GB), or x-default for the fallback page.

Where you’ll see it

The id is stable, and every surface uses it, so it’s the thing to search for or hand to an agent.

Terminal
When it is one of the five findings under Fix first, raptor crawl prints the id under it.
Check: hreflang.incorrect_lang_codes
crawl.json and the CSV
The crawl JSON names the finding by this id, and so do the CSV and raptor_query.
"check_id": "hreflang.incorrect_lang_codes"
The HTML report
This link opens the finding in the report, and each finding shows its id.
crawl.html#finding=hreflang.incorrect_lang_codes
MCP
raptor_findings with this check_id returns the finding in full, with a fix brief ready to paste into a task. If it didn’t fire, it says why.
raptor_findings {
  "job_id": "...",
  "check_id": "hreflang.incorrect_lang_codes"
}