WCAG fix guide

How to Fix a Missing or Wrong Page Language (WCAG 2.2)

Last reviewed 5 min read

Applies to: SC 3.1.1 Language of Page, Level A · SC 3.1.2 Language of Parts, Level AA

A missing document language was found on 13.5% of home pages in the WebAIM Million 2026 (detected with WebAIM's WAVE tool), down from 33.1% in 2019. WebAIM also reports that 87.3% of pages had a document language defined (WebAIM). It is usually a one-line, site-wide fix, but a valid value can still be the wrong one, and automated checks can't tell.

What the lang attribute does

How to fix it

Put the language on the opening <html> tag of every page template:

<!doctype html>
<html lang="en-AU">
SituationFix
No lang, or lang=""Add the page's main language: lang="en"
lang="en_US" or lang="english"Use a language tag with a hyphen: en-US. Underscores and language names are invalid
lang only on <body>, or only <meta http-equiv="Content-Language">Move it to <html>. W3C advises against using the meta tag for this (W3C i18n)
English template reused for a German siteChange lang="en" to lang="de" in the template, not just the text
Arabic, Hebrew, Persian or Urdu pageAdd the direction as well: <html lang="ar" dir="rtl">

Which value? W3C's rule is to keep the tag "as short as possible" (W3C i18n). en is enough unless the regional variant matters, as with spelling (en-AU, en-GB) or pt-BR versus pt-PT.

Language of parts (3.1.2): mark passages in another language, such as quotes, testimonials and the names in a language switcher. Proper names, technical terms and words that have become part of the surrounding language don't need it.

<blockquote lang="fr">Le service était impeccable.</blockquote>

<nav aria-label="Language">
  <a href="/de/" lang="de" hreflang="de">Deutsch</a>
  <a href="/fr/" lang="fr" hreflang="fr">Français</a>
</nav>

What automated checks flag, and what they don't

In our test of 15 language patterns in headless Chrome with axe-core 4.14.0, the open-source engine many scanners use, with the WCAG A/AA and best-practice rules switched on (October 2026), the results were:

PatternFlagged?
No lang, lang="", lang on <body> only, Content-Language meta onlyYes (html-has-lang)
en_US, english, or an unknown code like xxYes (html-lang-valid)
lang and xml:lang that disagreeYes (html-xml-lang-mismatch)
An invalid lang on a quote or spanYes (valid-lang)
lang="en" on a page written in FrenchNo: the value is valid, but wrong for the content
en-XY (an unknown region)No: the unknown region isn't flagged
A French quote with no lang at allNo: the scanner can't tell what language the text is in

CMS-specific steps

Menu names can change between platform versions (steps checked October 2026). If a path doesn't match, check your platform's current help pages.

WordPress, Shopify, Webflow, Squarespace and Wix are trademarks of their respective owners. Glimscope is not affiliated with or endorsed by any of them.

What automated tools can and can't tell you: Automated checkers (including axe-core, which our monitor uses) can flag many instances of this issue, but they cannot judge everything. A human still has to check meaning and context. For scale: Deque reports that in its own sample of first-time audits, its automated tests found 57.38% of issues by volume (Deque report). That is Deque's figure for its sample, not a detection rate for any one tool, and it means a large share of issues still needs manual testing. Scanners catch a missing or invalid language code. They can't tell whether a valid code matches the language the page is written in, or find passages in another language that aren't marked. Automated tests find only some accessibility issues; manual testing is still required. Not legal advice.

Manual checklist

Sources

  1. www.w3.org/WAI/WCAG22/Understanding/language-of-page.html
  2. www.w3.org/WAI/WCAG22/Understanding/language-of-parts.html
  3. webaim.org/projects/million/
  4. www.w3.org/WAI/WCAG22/Techniques/html/H57
  5. developer.mozilla.org/en-US/docs/Web/CSS/hyphens
  6. developers.google.com/search/docs/specialty/international/managing-multi-regional-sites
  7. www.w3.org/International/questions/qa-html-language-declarations
  8. www.w3.org/International/articles/language-tags/
  9. www.deque.com/automated-accessibility-coverage-report/

Check your own site

Run a free automated scan of one page to check it for some issues like this one.

Run a free automated scan

Automated tests find only some accessibility issues; manual testing is still required. Not legal advice.