HTML lang attribute missing issue means that website has pages where the <html lang=””> attribute is missing.
The importance of the issue
Despite Google and Yandex using hreflang to define local versions of the page, other search engines like Bing use the value set for HTML lang. The absence of HTML lang can lead to a failure in displaying the local version of the page.
<…>We don’t use that at all.
So we use the hreflang links if you have that if you have different language versions. But the language attribute within the HTML markup is something we don’t use at all. We’ve found that this language markup is something that is almost always wrong. So we tend to ignore that.<…>
John Muller, Senior Webmaster Trends Analyst at Google
If HTML lang is not set, the reading software uses the default language, which might cause a failure in displaying content. Source https://web.dev/html-has-lang/.
How to check the issue
Using any browser is enough to check the issue. Open the source code of the flawed page. To do this, click the right mouse button at any spot of the page and choose “browse the code” option, or apply an online tool https://codebeautify.org/source-code-viewer. Find a <html> tag and check if the lang attribute is present.
How to fix this issue
Add the lang attribute to the html tag. Choose a valid value of the lang attribute from the list https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry.
For example, set the value of the lang attribute to en to choose the English language.
Example: <html lang=”en”>
Detect pages where HTML lang attribute is missing
Crawl the website to collect all pages that have no HTML lang attribute