Skip to main content

WCAG 3.1.1 — Language of Page — lang attribute missing or incorrect

seriousWCAG 3.1.1 · Level Acms scope

Your website pages don't specify what language they're written in, which breaks screen readers for blind users. Screen readers need to know whether to pronounce text as English, Spanish, or another language to read it correctly. Under the ADA Title II rule, this is a required fix before your compliance deadline.

Who Is Affected

Users with blindness or low vision who rely on screen readers, users with cognitive disabilities who benefit from text-to-speech software, and users with dyslexia who use reading assistance tools. Also affects search engines and translation services.

What This Means

Every web page needs to declare its primary language using the lang attribute on the opening <html> tag. Screen readers use this information to select the correct pronunciation rules, accent, and speech characteristics. Without it, a screen reader might try to pronounce English text using Spanish pronunciation rules, making the content incomprehensible.

For example, <html lang="en"> tells assistive technology this page is in English, while <html lang="es"> indicates Spanish. The language code must match the actual language of the page content.

Fix: CMS / Theme

This is typically set at the template or theme level and affects all pages site-wide.

Joomla Fix

  1. Go to SystemGlobal ConfigurationSite tab
  2. In the Default Language field, select your site's primary language
  3. Go to ExtensionsTemplates[Your Template]Edit
  4. In the template's index.php file, ensure the <html> tag includes: <html lang="<?php echo $this->language; ?>"
  5. Save and clear cache

WordPress Fix

  1. Go to SettingsGeneral
  2. Set Site Language to match your content's primary language
  3. WordPress themes should automatically use this setting, but verify by viewing page source
  4. If your theme doesn't include the lang attribute, add this to your theme's header.php:
    <html <?php language_attributes(); ?>>
    
  5. Save and clear any caching

Manual HTML Fix

If you're editing templates directly:

  1. Locate the opening <html> tag in your site's main template
  2. Add the appropriate language code: <html lang="en"> for English
  3. Use the correct ISO 639-1 language code (en, es, fr, etc.)

Fix: Content Editor

Content editors cannot typically fix this issue as it requires template-level changes. Contact your IT department or web vendor to implement the CMS fixes above.

However, if you manage content in multiple languages, ensure each page uses the correct language setting in your CMS (this may require additional language plugins).

Standard Reference

WCAG 2.1 Success Criterion 3.1.1 — Language of Page, Level A

The default human language of each Web page can be programmatically determined.

Check if your government website has this issue

OctoComply scans your website and documents for WCAG 2.1 AA violations. The free tier covers up to 10 pages.

Run a Free Scan