Skip to content
StoreA11y

WooCommerce · 3.1.1 Language of Page (Level A)

Page language code is not valid on WooCommerce

The <html> lang attribute is present but is not a valid BCP-47 language tag — for example lang="english" or lang="EN_US". Assistive technology cannot match it to a voice, so it behaves as if no language were set at all.

Which WCAG criterion this fails

  • Does not meet 3.1.1 Language of Page (Level A)

How to fix it on WooCommerce

Everything below is done from Appearance > Theme File Editor, or your child theme over SFTP. Take a copy of the theme before editing.

  1. Open layout/theme.liquid and correct the value on the <html> tag.
  2. Use the two-letter code alone ("en", "de", "fr") or code-REGION with a hyphen ("en-US", "pt-BR"). Never an underscore, never the language name.
  3. On a Shopify Markets store, use {{ request.locale.iso_code }} rather than hardcoding — it always emits a valid tag.
  4. If part of the page is in another language, wrap that block in an element with its own lang attribute instead of changing the page-level one.

Where this usually lives

header.php via language_attributes(), and Settings > General > Site Language

Paths given for Storefront, Astra, Flatsome and other WooCommerce themes. A heavily customised theme may differ; the CSS selector in your scan report points at the exact element.

Code

<!-- Invalid -->
<html lang="english">   <html lang="en_US">

<!-- Valid -->
<html lang="en">        <html lang="en-US">

<!-- Mixed-language block -->
<p>Our motto is <span lang="fr">joie de vivre</span>.</p>

How to confirm it is fixed

Re-run the scan. This rule should drop out of the findings entirely. If the instance count falls but does not reach zero, the same defect exists in another template — product cards and quick-view modals are the usual second home for it.

Effort: low. Rule id: html-lang-valid (axe-core).