Skip to content
Nazmul Nikhil
Menu

HTML Lang Attribute Missing (Ahrefs): A One-Line Accessibility Fix

Ahrefs flags pages with no lang attribute on the html tag. It's an easy accessibility fix. Here's what to add and where on each platform.

Nazmul Nikhil

By

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

Published 1 min read
HTML Lang Attribute Missing (Ahrefs): A One-Line Accessibility Fix
Photo: Andrew Stutesman on Unsplash

In short

Ahrefs flags "HTML lang attribute missing" when a page's <html> tag has no lang attribute. Google detects language from the visible text, so this isn't a ranking issue. It is an accessibility requirement: without it, screen readers may read the page with the wrong pronunciation, and browsers may offer to translate a page that's already in the reader's language. Add lang="en" (or your language) to the html tag.

This applies to every site, including single-language ones.

The fix

<!DOCTYPE html>
<html lang="en">

Use en-US or en-GB if you want to be specific; en alone is fine for most English sites.

Why it matters

  • Accessibility: WCAG 2.2 success criterion 3.1.1, Language of Page, is level A, the minimum standard many accessibility laws refer to.

  • Browsers: translation prompts, spell-checking, hyphenation and font choices use it.

  • Search: Google doesn't use code-level language information such as lang, but other tools may.

Where to set it

WordPress: Settings > General > Site Language, with a theme that calls language_attributes().

Shopify: theme.liquid, first line of the html tag.

Webflow: set the site language in Site settings (Localization for multi-language sites).

Wix: Settings > Language & Region.

Custom builds: add it to the root index.html or layout component.

This guide isn't affiliated with or endorsed by Ahrefs.

Sources and references

TAGSAhrefs Site AuditHtml lang attribute missingAdd html langLang attribute seo
Nazmul Nikhil

About the author

Nazmul Nikhil

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.

Need help with this?

Get it fixed with International SEO

I find the issues that cost you traffic and fix them, starting with the pages that matter most.

Keep reading

Related articles

All Site Audit Issues posts →

Get the next guide in your inbox

One email when a new SEO or AI search guide goes live.

Ready to grow?

Get a free audit of your website, or book a 30-minute call to talk through your goals.

Nazmul Hasan

Talk to Nazmul directly

Reply within 24h

WhatsApp +880 1682835118
nazmulnikhil@gmail.com