Why do I need to set the page language for screen readers?
You need to set the page language because screen readers use it to choose the right pronunciation rules. A screen reader set up for English that reads a German product page without a language declaration may read German words with English pronunciation, and the result can be hard to follow. WCAG 3.1.1 Language of Page (level A) asks that the default human language of each web page can be programmatically determined; W3C's first stated benefit is that "Screen readers can load the correct pronunciation rules."1 The fix is usually one attribute: lang on the html element, such as <html lang="en-GB">.1
Who else benefits
W3C lists other benefits of a correct page language: visual browsers can display characters and scripts correctly, and media players can show captions correctly.1 It names the people who benefit as screen reader and text-to-speech users, people who find it hard to read written material fluently, people with some cognitive, language and learning disabilities who use text-to-speech software, and people who rely on captions.1
How often is it missing?
It is one of the six most common failures WebAIM tracks. Its 2026 scan of the top million home pages found a missing document language on 13.5% of them, down from 15.8% in 2025.4 It is also one of the easiest to fix, usually in one template.
What the two criteria ask
| Criterion | Level | Requires | How |
|---|---|---|---|
| 3.1.1 Language of Page | A | The page's main language can be determined by software | lang on the html element (technique H57) |
| 3.1.2 Language of Parts | AA | The language of each passage or phrase in another language can be determined | lang on an element around that passage (technique H58) |
Sources: Understanding 3.1.11 and 3.1.2.2 When a page uses several languages, the default is the one used most; if they are used equally, choose the first one used.1
Choosing the language code
W3C's internationalisation guidance says: "Always use a language attribute on the html tag to declare the default language of the text in the page."3 Its main points:
- Use the
htmlelement, notbody, becausebodydoes not cover thehead, where the page title lives.3 - Use standard tags from the IANA Language Subtag Registry, following BCP 47:
en,en-GB,fr,zh-Hans.3 - Do not use a
metaelement withhttp-equiv="Content-Language"to declare the language.3
Get the code right as well as present. A page in Spanish marked lang="en" because the theme was copied from an English store is arguably worse than no attribute, because it tells the screen reader the wrong thing with confidence.
Passages in another language
WCAG 3.1.2 asks you to mark passages or phrases that are in a different language from the page.2 Wrap them in an element with its own lang, such as <span lang="fr">.3 In a store, typical cases are:
- A language switcher. W3C's example marks each language link with its own
langand writes it in that language, such as "Deutsch" and "Français".2 Without that, an English screen reader reads "Français" with English sounds. - Quoted reviews left in another language.
- Product descriptions or care labels supplied in another language and not translated.
- A tagline or motto in another language in the header.
You do not need to mark everything. The criterion excludes proper names, technical terms, words of indeterminate language, and words or phrases that have become part of the surrounding language.2 W3C's example is "podcast" in French text, which needs no marking.2
Multilingual stores
If you sell in several languages, each version of a page should declare its own language. When a visitor switches to German, the html element should change to lang="de" along with the text. This also matters beyond accessibility: Google recommends that title elements use the same language and writing system as the page's main content, and says it may choose different text for a title link when they do not match.8
Shopify and WordPress
Shopify
Shopify's Theme Store requires that "The <html> element must specify a lang attribute."5 Themes from the Theme Store should therefore declare a language. The risk is in customised or older themes, and in stores that have added languages. View the source of a page in each of your languages and check the lang value matches.
WordPress and WooCommerce
Classic WordPress themes usually print the language with <html <?php language_attributes(); ?>> in header.php, a function that builds the language and text direction attributes for the page.6 It outputs lang using the site's language information, and only when that value is not empty.7 If a theme hard-codes lang="en" instead, or leaves the function out, the attribute will be wrong or missing on translated sites. If you use a multilingual plugin, check the output for each language.
How to check
- Run an automated check. Automated tools can detect a missing
langattribute; the WebAIM figures above come from an automated scan. Jralo's free check tests your homepage and up to five linked pages against WCAG 2.2 A and AA, and helps you understand which countries' accessibility laws may be relevant, with a link to a guide for each (general information, not legal advice). - Check the value. A tool can see that
lang="en"is present and valid, but not whether the page is really in English. View the source of each language version. - Listen. With a screen reader, read a page and the language switcher. Does the pronunciation match the language?
Automated tools find many problems, not all; this is one where a tool does most of the work and a quick human look does the rest. For a wider first pass, see how to check your website in 15 minutes.
What else do people ask?
Should I use "en" or "en-GB"?
Either is a valid language tag. W3C's internationalisation guidance says to use tags from the IANA Language Subtag Registry, following BCP 47, such as en, en-GB, fr or zh-Hans. Use a region only when it matters, for example to match the spelling you use.
Do I need to mark every foreign word?
No. WCAG 3.1.2 excludes proper names, technical terms, words of indeterminate language and words that have become part of the surrounding language. A French brand name or "croissant" in English text does not need marking. A full sentence or quotation in another language does.
Do PDFs need a language too?
Yes. W3C lists setting the default language in the PDF document catalogue (technique PDF16) and marking the language of a passage (PDF19) as sufficient techniques for 3.1.1 and 3.1.2. Check the language in the document properties before you publish, as well as on your web pages.
Check your site now
Jralo's free check tests your homepage and up to five pages for accessibility (WCAG 2.2 A and AA) and website QA problems, and tells you which countries' accessibility laws are likely relevant to you. No sign-up.
Run the free checkWhere do these facts come from?
Every number and legal statement in this post links to one of these sources, read on 13 October 2026.
- W3C WAI: Understanding Success Criterion 3.1.1 Language of Page
- W3C WAI: Understanding Success Criterion 3.1.2 Language of Parts
- W3C Internationalization: Declaring language in HTML
- WebAIM: The WebAIM Million, 2026 report
- Shopify: Theme Store requirements
- WordPress developer reference: language_attributes()
- WordPress developer reference: get_language_attributes()
- Google Search Central: Influencing your title links in search results
More questions
- EN 301 549 explained: the European accessibility standard and WCAG
- Jralo MCP real-time alerts: website monitoring for your agent
- Why are so many website accessibility lawsuits filed in New York?
- Shopify accessibility statement: free feedback wording
- California's Unruh Act and websites: what store owners should know
- PHP2Shell: is your website affected, and what to do
- Black Friday checkout accessibility: a one-week checklist
- Israel's website accessibility regulations explained
- WCAG 1.4.13 Content on Hover or Focus: a Shopify test
- India's RPwD Act 2016 and websites: what businesses need to know
- France: accessibility rules for online shops (EAA and RGAA)
- Germany's BFSG: what it means for online shops
- WCAG 1.4.12 Text Spacing: how to test a Shopify store
- Does Australia's Disability Discrimination Act apply to websites?
- AODA website requirements checklist for Ontario businesses
- Skip links on a Shopify theme: what WCAG 2.4.1 requires
- Does the UK Equality Act 2010 apply to my website?
- What makes a good page title for product, collection and checkout pages?
- How do I make log-in and CAPTCHA accessible under WCAG 3.3.8?
- How do I make animation and motion on my website accessible?
- How do I make data tables and size charts accessible?
- How do I write accessible form error messages?
- How do I make product search, filters and sorting accessible?
- PDFs on your website: when to use HTML instead, and how to make PDFs accessible
- Does my website still work when visitors zoom in? Resize and reflow explained
- How big do buttons and links need to be under WCAG 2.5.8?
- How do I make a cookie consent banner accessible?
- How do I make pop-ups and modal dialogs accessible?
- How do I write link text that makes sense out of context?
- Why does heading structure matter for screen reader users?
- Visible focus: why removing outlines hurts, and what WCAG 2.2 asks
- Accessible navigation and mega menus
- Accessible product image galleries, sliders and carousels
- How to make a Shopify cart drawer accessible
- Accessible Shopify variant pickers and colour swatches
- The European Accessibility Act: a step-by-step plan for small online sellers
- ADA Title III and websites in plain English
- What to put in an accessibility statement
- How to make a WooCommerce store accessible
- How to fix accessibility issues without breaking your theme
- How to make a Shopify theme accessible: settings, apps and what to check
- Captions, transcripts and audio description for product and marketing video
- What a screen reader user hears on your product page, and how to fix it
- Accessible forms and checkout: labels, errors and autocomplete
- How to test your website with only a keyboard in 10 minutes
- Colour contrast explained: what WCAG asks and how to fix brand colours
- Why automated accessibility testing finds some problems but not all
- How do I write alt text that actually helps?
- What did WCAG 2.2 add to WCAG 2.1?
- How can I prove my website is monitored for accessibility?
- Does the European Accessibility Act apply to my online store?
- Do accessibility widgets make a website ADA compliant?
- Got an ADA website demand letter? What to do first
- How do I check if my website is accessible? A 15-minute method
- Website accessibility laws by country (2026)