Skip to main content
New: 190 SEO checks now available. See what's new
mediumAccessibilityMISSING_LANG_ATTRIBUTE

Missing lang attribute on <html> element — the fix

The <html> element does not specify a lang attribute. This attribute declares the primary language of the page content and is essential for screen readers, translation tools, and search engines.

Where this fits: accessibility in SEO

Accessibility overlaps heavily with SEO because both depend on machine-readable structure: alt text, heading hierarchy, labels, contrast. Screen readers and search crawlers consume the same signals. Accessible sites rank better not by special treatment but because the same fixes — descriptive alt attributes, proper headings, real link text — are exactly what search engines parse for meaning. It is also, in a growing number of jurisdictions, the law.

Why missing lang attribute on <html> element hurts your rankings

Without the lang attribute, screen readers may use the wrong pronunciation rules, making the content incomprehensible for visually impaired users. Search engines use the lang attribute as one signal for language targeting and serving the right version of your page to users in different regions. It is also a WCAG 2.1 Level A requirement (Success Criterion 3.1.1).

This is a medium-severity issue: individually modest, but it compounds — dozens of medium issues across hundreds of pages add up to a real quality deficit in how search engines assess the site.

How to fix it

Add the lang attribute to the <html> element using the appropriate BCP 47 language tag for your content's primary language.

<!-- English -->
<html lang="en">

<!-- Spanish -->
<html lang="es">

<!-- French (France) -->
<html lang="fr-FR">

Accessibility best practices

  • Give every informative image an alt attribute that describes its content; decorative images get alt="".
  • Maintain heading hierarchy — never skip levels for styling reasons.
  • Make link text meaningful out of context; screen readers list links in isolation.
  • Keep text contrast at WCAG AA (4.5:1) minimum.
  • Make everything keyboard-operable with a visible focus state.

The full library: SEO best practices, by category.

Frequently asked questions

What does "Missing lang attribute on <html> element" mean?

The <html> element does not specify a lang attribute. This attribute declares the primary language of the page content and is essential for screen readers, translation tools, and search engines.

Why does missing lang attribute on <html> element matter for SEO?

Without the lang attribute, screen readers may use the wrong pronunciation rules, making the content incomprehensible for visually impaired users. Search engines use the lang attribute as one signal for language targeting and serving the right version of your page to users in different regions. It is also a WCAG 2.1 Level A requirement (Success Criterion 3.1.1).

How do I fix missing lang attribute on <html> element?

Add the lang attribute to the <html> element using the appropriate BCP 47 language tag for your content's primary language.

How serious is this issue?

This is a medium-severity issue: individually modest, but it compounds — dozens of medium issues across hundreds of pages add up to a real quality deficit in how search engines assess the site. It belongs to the accessibility family of checks.

How do I find every page affected by this on my site?

Run a free Dr Urls audit: it crawls your site, detects missing lang attribute on <html> element on every affected page, shows example URLs, and generates a ready-to-use fix task. Re-scan after fixing to verify the issue is gone.

Does your site have this issue?

A free Dr Urls audit crawls your site, finds every page affected by missing lang attribute on <html> element, and hands you a ready-made fix task.

Check my site free

Related accessibility guides