Annex

Fixing Language of Page on WooCommerce (WCAG 3.1.1)

The page's language must be declared in the markup: <html lang="de">.

Why it matters

A one-line fix, but when it is missing a screen reader pronounces the page with the wrong language's phonetic rules — German product copy read with English pronunciation is close to unintelligible. It bites hardest on multilingual EU storefronts: if the language switcher translates the content but leaves the lang attribute untouched, every translated version is announced wrongly.

WooCommerce — where to look

Theme header template (header.php), the html tag.

What to do

Use WordPress language_attributes() instead of a fixed string; with WPML or Polylang it returns the active language. The Storefront reference theme does this already.

Verification status

Checked by reading the platform’s own source code. Storefront ships <html <?php language_attributes(); ?>>.

Source: https://github.com/woocommerce/storefront/blob/trunk/header.php

Reference themes change. If your store runs a different or older theme, confirm the file before editing it.

How to verify the fix

  1. View source and look at the opening html tag — is lang present?
  2. Switch to another language with the site's own switcher and check the source again. Did lang change?
  3. On a multilingual store, check every locale. Usually only the default one is correct.

Other platforms

The full criterion

Read the full explanation of WCAG 3.1.1 Language of Page, or the formal W3C definition.