How to fix URLs where HTML lang attribute is missing

Free SEO Audit

Crawl the website for technical issues and get a prioritized to-do list with detailed guides on how to fix.

Sitechecker crozdesk rating Sitechecker crowd rating Sitechecker capterra rating
Sitechecker trusted company

How to fix URLs where HTML lang attribute is missing

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

Link to YouTube

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.

Example:

how to fix html lang attribute missing

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

Sitechecker rating on crozdesk Sitechecker rating on crowd Sitechecker rating on capterra

Check Your Website for SEO Errors

Go to App
Something went wrong. Please, try again later.
close