Skip to content
Pandus

WCAG A/AA requirement Priority: Moderate

The page declares two different languages

The page's <html> tag has both a lang and an xml:lang attribute, and they name different languages, for example lang="de" and xml:lang="en".

This text was translated automatically and has not been reviewed by a native speaker yet.

Why it matters to your customers

Software that reads xml:lang may treat a German page as English. Screen readers can then read product names, prices and checkout instructions with the wrong pronunciation, and translation tools may misidentify the language.

Who is affected

  • blind customers
  • screen reader users
  • people who use read-aloud or translation tools

How to fix it

Make both attributes name the same language, such as lang="pl" xml:lang="pl". In a normal HTML5 page the xml:lang attribute is not needed, so the simplest fix is to remove it and keep a correct lang. Check every language version of the shop: the mismatch often appears only on translated pages.

On Shopify

Rare in current themes. Usually caused by an older or heavily customised layout file with a hard-coded xml:lang while lang comes from the shop language. Fix or remove xml:lang in the theme's layout Liquid file.

On Shoptet (CZ)

Rare; if it appears, it comes from the template or a customisation of the page header. Ask Shoptet or a Shoptet partner to align or remove xml:lang.

On PrestaShop

Usually in older or customised themes where xml:lang is hard-coded in the layout .tpl template. Make it use the same language ISO code as lang, or remove it.

On WooCommerce

Usually in older themes with an XHTML-style header where xml:lang is hard-coded, or when a multilingual plugin changes only lang. Fix the <html> tag in the child theme's header template, ideally by outputting only language_attributes().

Fix it with AI

Copy this prompt into ChatGPT, Claude or Copilot and add the HTML of the element. Check the answer before you publish it.

You are an experienced web developer and accessibility specialist. Fix this accessibility problem on my website so that it meets WCAG 2.2 level AA.

Website: [https://…]

## Problem: The page declares two different languages
WCAG 2.2 3.1.1 (A)

The page's <html> tag has both a lang and an xml:lang attribute, and they name different languages, for example lang="de" and xml:lang="en".

**How to fix:** Make both attributes name the same language, such as lang="pl" xml:lang="pl". In a normal HTML5 page the xml:lang attribute is not needed, so the simplest fix is to remove it and keep a correct lang. Check every language version of the shop: the mismatch often appears only on translated pages.

## Elements found by the automated check
[Paste the HTML of the element here, or the selector from the Pandus report]

## Requirements
- Change only what is needed; keep the design and how the site works.
- Do not add accessibility overlays or widgets; fix the code or the content.
- Show the corrected code and say in which template or file it goes.
- Explain how to check the fix with the keyboard and a screen reader.

Standards

Standards
StandardClause
WCAG 2.2 3.1.1 (A) Language of Page
WCAG 2.1 3.1.1 (A) Language of Page
WCAG 2.0 3.1.1 (A) Language of Page
EN 301 549 4.1.1 9.3.1.1
EN 301 549 3.2.1 9.3.1.1
Section 508 2017 E205.4
ДСТУ EN 301 549 2022 9.3.1.1

Automated check: axe-core rule html-xml-lang-mismatch. dequeuniversity.com, github.com, www.w3.org

WCAG success criterion

Guides and tools

Help articles

All rules we check