Check Engine / Checks / Reference

Are your hreflang codes recognised?

It separates malformed, superseded, unsupported and unrecognised language-region codes.

What Check Engine measures

The sample uses successful pages with hreflang. Empty values, x-default and repeated values are skipped. The format allows 2 language letters or 3 language letters, an optional 4-letter script and an optional region of 2 letters or 3 digits. Known region mistakes, private-use regions, numeric regions, old language codes and unknown values receive different explanations. A value missing from a recognition table stays unrecognised until it can be checked. For example, a 4-letter script subtag can appear between the language and region.

The check reads declared alternate-language codes. It does not judge translation quality or inspect an unavailable target's language. Review each declaration against its intended audience.

How to read the result

Malformed codes are medium severity. Superseded languages and unsupported regions are low, while unrecognised regions or languages are notices. The report distinguishes a known defect from a limit in the audit's own reference tables.

Why it matters

A language code states which audience an alternate page serves. Keeping unknown values separate from known mistakes avoids replacing a legitimate declaration on the strength of an incomplete lookup table.

How to fix it

Review the exact code and the audience it should identify. Correct known typos and use a supported language-region form where needed. Verify unfamiliar values against the relevant registry before changing them. Check the target page and return tags after fixing the code, since spelling alone cannot establish a complete alternate-language relationship.

hreflang values that are not valid language codes

What we found in field audits

Problems in Crawlability & indexing were found on 12 of the 14 sites we audited. These are area totals. Read the field-audit method.

Method note

backend/seo_engine/checks/international.py, hreflang_codes, revision 0bb8e8d3.

Common questions

Can a hreflang code contain a script subtag?

Yes. An optional 4-letter script can sit between language and region. The full value must still match the allowed format.

Does an unrecognised hreflang region always mean the region is invalid?

No. Unrecognised regions or languages receive notices. A missing reference-table entry is kept separate from a known defect.

Are empty hreflang values and x-default checked as ordinary language codes?

No. Empty values, x-default and repeats are skipped. The format comparison uses the remaining values on successful pages.