Mismatched hreflang and HTML lang declarations
This means that the URL in question has hreflang annotations and HTML lang attributes that do not match.
Why is this important?
While Google and Yandex use hreflang to determine which URLs to display in regional search results, some search engines, such as Bing, use the HTML lang attribute.
If a URL uses both hreflang and HTML lang, yet the values do not match, this implies that an error has been made with either the hreflang annotation, or with HTML lang, or both.
This may result in the incorrect page being served in localised search results.
What does the Hint check?
This Hint will trigger for any URL which has hreflang annotations and HTML lang attributes that do not match.
Examples that trigger this Hint:
Consider the URL: https://example.com/en/page-a/
The Hint would trigger for this URL if it had an HTML lang attribute:
and a different hreflang value:
How do you resolve this issue?
Incorrect HTML lang will cause you issues in search engines that still support HTML lang (e.g. Bing), and they won't serve the correct localised content in different regions. Incorrect hreflang will cause you issues in search engines that support hreflang (e.g. Google).
You may need to manually inspect the page content to understand which is incorrect, and then make corrections to the pages directly or to the scripts that generate the language tags.