
Element Code: IN-052
What the Missing Language Check Actually Flags
This check looks at one specific thing: whether your page's opening <html> tag declares a lang attribute, and whether that attribute has a value at all. So <html> or <html lang=""> both fail. <html lang="en"> or <html lang="fr-CA"> pass. That is the entire scope of this check. It does not evaluate whether the value you picked is the correct language, it just confirms one is present and non-empty.
People conflate this with hreflang constantly, so let me draw the line clearly. The lang attribute is a declaration: it tells any consumer of the page, browser, screen reader, translation tool, crawler, "this document's content is written in language X." Hreflang is a targeting signal: it tells Google "here is the URL for this same content in language Y, aimed at users in region Z." One describes what a page is. The other maps relationships between multiple pages. You can have perfect hreflang and still be missing lang on every page. You can have lang set correctly everywhere and have zero hreflang tags because you only run one language. They are related concepts that solve different problems, and a site running international SEO needs both done right, not one instead of the other.
Why It Matters
Start with accessibility, because that is where the impact is most direct and most documented. Screen readers use the lang attribute to select the correct pronunciation engine and phoneme set. If a French-language page has no lang attribute, most screen readers default to whatever language the user's assistive technology is set to, typically English for US-based screen reader users. The result is a screen reader trying to pronounce French words using English phonetic rules, which is close to unintelligible. This is not a minor edge case: it is codified as WCAG Success Criterion 3.1.1 (Language of Page), a Level A criterion, meaning it is one of the baseline requirements for a conformant, accessible site. If your organization has any accessibility compliance obligation (ADA, Section 508, EN 301 549, AODA), a missing lang attribute is an automatic fail on an automated accessibility audit.
Second, browser behavior. Chrome, Edge, and other Chromium browsers use the lang attribute to decide whether to offer an auto-translate prompt. Without it, the browser falls back to language detection heuristics run against the visible text, which are inconsistent. You'll see false "Translate this page?" prompts on English pages, or no prompt at all on pages that actually need one. That is a real UX papercut for real visitors, and it happens more often than people expect on sites that have never bothered to set lang.
Third, it feeds into internationalization correctness. If you run hreflang across multiple language versions of a page, a missing or wrong lang attribute on the target pages does not break hreflang validation directly (Google reads the hreflang annotations themselves, not the lang attribute, to resolve alternates) but it is a strong tell that your i18n setup was done sloppily, and sloppy i18n setups are where hreflang mistakes cluster: wrong region codes, missing return tags, inconsistent canonicalization. Treat a missing lang attribute as a canary. If it's missing, go check your hreflang implementation too, because if one got skipped the other might have as well.
Now the honest part: this is not a meaningful ranking factor on its own. Google has never listed the lang attribute as a signal it uses for ranking, and there's no credible evidence it materially affects visibility for a single-language site. If your English-language blog has no lang attribute and ranks fine, adding lang="en" tomorrow is not going to move your position. This is a hygiene and accessibility fix, not a ranking hack. I'd still fix it on every site I audit, because it's free, it's fast, and it removes a real user-facing and compliance-facing problem, but don't sell it internally as an SEO win. Sell it as what it is.
How Browsers and Screen Readers Handle It
The diagram below shows the practical difference between a page with and without the attribute set.
How to Detect It
This is a trivial detection problem, which is part of why it's inexcusable to leave sites shipping without it.
- View source: the fastest manual check. Right-click, View Page Source, look at the opening
<html>tag. If there's no lang attribute or it's empty, that's the issue, no tool required. - Screaming Frog: the SEO Spider's built-in Accessibility report (powered by axe-core) flags this natively under "HTML Element Requires Lang Attribute" and "HTML Element Lang Attribute Value Must Be Valid," both tied to WCAG 2.0 Level A. You don't need a custom extraction for the basic check, though a custom extraction with XPath
//html/@langis useful if you want the raw value exported for every URL in a crawl to spot-check inconsistent codes across a large site. - Sitebulb: flags missing or invalid lang attributes as part of its Accessibility audit category, with the same severity framing tied back to WCAG.
- Google Search Console: does not have a direct "missing lang attribute" report. It's not a Core Web Vitals or Page Experience factor, so you won't find it flagged there. If you're relying only on Search Console for technical health, you'll miss this entirely, which is a decent argument for running Screaming Frog or Sitebulb crawls periodically regardless of what GSC shows.
- Automated accessibility scanners (axe DevTools browser extension, WAVE, Lighthouse's Accessibility audit): all of these will surface a missing lang attribute as a failed check, usually described in terms of WCAG 3.1.1.
How to Fix It
The fix itself is a one-line change. The work is making sure it's applied consistently and set to the right value.
- Identify the correct language code. Use a standard two-letter ISO 639-1 code (en, fr, de, es, ja) and optionally a region subtag if it matters for your content (en-US vs en-GB, pt-BR vs pt-PT). Don't overthink region subtags unless you're actually running region-specific content or hreflang variants that depend on the distinction.
- Static HTML sites: open your template or every HTML file and set it directly:
<html lang="en">. If you're hand-maintaining multiple static pages without a build system, this is exactly the kind of thing that drifts, so it's worth a quick grep across your source directory for<htmlto confirm every file has the attribute set consistently. - WordPress: most modern themes already output this correctly via the
language_attributes()function inside the theme'sheader.php, which pulls from the site language set in Settings, General. If it's missing, check whether your theme's header.php calls<html >. If you can't or don't want to touch the theme file, a small snippet infunctions.phphooked to a filter, or a lightweight accessibility plugin, can inject or correct the attribute. If you run a multilingual WordPress setup with WPML or Polylang, those plugins handle per-page lang attributes automatically based on the content's assigned language, so a missing attribute on a multilingual build usually points to a plugin misconfiguration rather than something you need to hand-code. - Multilingual and hreflang setups: each language version of a page needs its own correct lang value matching that page's actual content language, not just the default site language repeated everywhere. This is the detail teams get wrong: they set
lang="en"once in a base template and never override it on the French or German URL variants, so every page across every locale claims to be English regardless of hreflang tags pointing between them. Audit this by crawling each locale subfolder or subdomain separately and confirming the lang value changes accordingly. - JavaScript-rendered or SPA sites: if your framework renders the shell client-side, make sure the lang attribute is set on the initial server-rendered HTML, not injected only after hydration. Crawlers and screen readers that don't wait for full JS execution will see the unset version otherwise.
- Verify after deploying. Re-crawl with Screaming Frog or view-source a sample of URLs across templates (homepage, category, product or article page, any custom landing page templates) since different templates on the same site sometimes pull from different header files.
What good looks like: every page on the site, checked across every template type, declares a non-empty, valid lang attribute matching its actual content language. On multilingual sites, that value varies correctly per locale and stays in sync with whatever hreflang annotations point to that URL.
Do This, Not That
- Set lang on the html tag in your base template so every page inherits it
- Match the lang value to the page's actual written content, not the target audience's assumed language
- Set a distinct, correct lang value per locale on multilingual builds
- Re-check after theme updates or migrations, since header files get overwritten
- Pair this fix with an actual hreflang audit if you run multiple languages
- Assume this fix will move rankings, it won't by itself
- Hardcode lang="en" globally on a multilingual site and call it done
- Confuse this check with hreflang validation, they test different things
- Rely only on Search Console to catch this, it doesn't report it
- Leave the attribute empty (lang="") thinking that counts as declared, it doesn't
Lang vs Hreflang: Quick Comparison
| Aspect | lang attribute | hreflang |
|---|---|---|
| Location | On the <html> tag of each page | In <head> link tags or sitemap, or HTTP headers |
| Purpose | Declares what language this page's content is in | Maps this page to equivalent pages in other languages/regions |
| Primary audience | Browsers, screen readers, assistive tech | Search engine crawlers |
| Ranking impact | None documented directly | Not a ranking factor either, but affects which URL is served |
| Accessibility impact | Direct, required for WCAG 3.1.1 | None |
| Needed on single-language sites | Yes, always | No, only relevant with multiple language/region versions |
FAQ
Will fixing this improve my Google rankings?
Is this the same thing as hreflang?
What value should I use if my page has mixed languages?
Does Google Search Console report this issue?
My site is only in English. Do I still need to bother?
A missing lang attribute is usually a symptom of a template that hasn't been reviewed in a while. If you want someone to go through your whole site's technical foundation, indexation, crawlability, hreflang, structured data, and accessibility together, that's exactly what we do.
Claude Vincent is a technical SEO consultant focused on crawlability, rendering, and AI-search visibility. He writes the field guides and case studies at SEO ProCheck, with a bias toward the durable, unglamorous work that decides whether search engines and AI answer engines can actually read and cite a site.
About SEO ProCheck
Technical SEO consulting and GEO strategy with 20 years of enterprise experience. Case studies, resources, and tools for search and AI visibility.
Work With Me
Technical SEO audits, GEO strategy, site migrations, and international SEO. Hourly consulting for teams who need hands-on support, not just reports.
Subscribe to our newsletter!
Recent Posts
- Can AI Crawlers Actually Read Your Site? I Measured 400 of the Biggest September 5, 2026
- The Pre-Publish Quality Gate for AI-Assisted Content August 6, 2026
- AGENTS.md vs llms.txt vs llms-full.txt: Which Agent File Does What July 18, 2026







