Invalid incoming hreflang annotations

This means that the URL in question has one or more incoming hreflang annotation that is invalid (e.g. invalid language or region code).

Why is this important?

Hreflang annotations include an attribute value that identifies the language, and optionally the region of an alternate URL.

For example, the value "en-gb" identifies English (en) as the language and Great Britain (gb) as the region.

In order to be considered valid, and recognised by search engines, the attribute value must conform to certain guidelines:

  • The language code in your hreflang attribute must be in ISO 639-1 format.
  • The region code in your hreflang attribute must be in ISO 3166-1 Alpha 2 format.
  • Hypens must separate the language and region codes.
  • The region code must not be used on its own (the language code can be).
  • When used together, the language code must always proceed the region code.

If hreflang does not conform to any of the above, it will not be recognised by search engines.

What does the Hint check?

This Hint will trigger for any URL which has at least one incoming hreflang annotation that is invalid.

Note: This Hint is very similar to another Hint: Has invalid outgoing hreflang annotations. The difference being that this Hint is analysing the target page of a hreflang annotation (i.e. incoming hreflang) whereas the other Hint is analysing the page with hreflang on (i.e. outgoing hreflang).

Examples that trigger this Hint:

Consider the URL: https://example.com/en/page-a/

The Hint would trigger for this URL if it had invalid incoming hreflang from another page;

<link rel="alternate" href="https://example.com/en/page-a/" hreflang="en-uk" />

(where "en-uk" is invalid - it should be "en-gb")

How do you resolve this issue?

Invalid hreflang cannot be ignored if you want search engines to serve the correct localised content in different regions.

If you have invalid hreflang, the first task is to understand why it is invalid - which of the 5 guidelines above was broken? Once you understand this, you can roll out a fix on the website, across all affected URLs.

How do you get more data from Sitebulb?

Although this issue triggered a Hint, the best place to check for invalid hreflang in Sitebulb is in the 'Hreflang Geotargeting' tab in the International section.

The column marked 'Valid' will show you which hreglang is invalid, and the other columns will show you other datapoints, such as the number of URLs affected.

Invalid hreflang

In this case there seems to be an error with 2 of the hreflang values, across basically all translated pages. The error, in this case, is:

  • The region code must not be used on its own (the language code can be).

Both cn (China) and cz (Czech Republic) are region codes, and are not valid language codes. China has a range of languages (none of which use the symbol 'cn'), and Czech language is denoted by 'cs'. You can use this list of country and language codes to check.

Further Reading

Ready to try Sitebulb?
Start your free 14 day trial now

Start Free Trial