Part of the Accessibility audit

Check your page language setting

Screen readers choose a voice and pronunciation rules based on the lang attribute. Without it, they guess, and often guess wrong.

Start 7-Day Studio Trial

No signup required. Results in under 60 seconds.

423,000+ checks run and counting

What this check does

SiteCurl checks the <html> tag on each page for a lang attribute. It checks three things: the attribute exists, it is not empty, and it contains a valid BCP 47 language code like 'en', 'en-US', 'fr', or 'de'.

A missing lang attribute is flagged as critical. An invalid value (like 'english' or '123') is flagged as a warning. A valid value like 'en' passes the check.

The check runs on each page in your scan. Some CMS templates set the lang attribute on some pages but not others, or set it to other values on other templates. SiteCurl catches these gaps across your entire site.

How this shows up in the real world

Screen readers use the lang attribute to load the correct pronunciation engine. When the attribute says 'en', the reader uses English phonetics. When it says 'fr', it switches to French. When the attribute is missing, the reader guesses based on the user's system language or the content itself.

The guess is often wrong. A French screen reader hitting an English page will attempt to pronounce English words with French phonetics. The result is garbled speech that is hard to follow. For bilingual sites or sites serving international audiences, this makes the content nearly incomprehensible.

Even on English-only sites in English-speaking countries, the lang attribute matters. Some screen reader users have their system set to a new language. Without the lang attribute, the reader defaults to that system language. An English page read with a Japanese pronunciation engine is not useful.

The lang attribute also affects browser behavior beyond screen readers. Browsers use it for spell-checking, hyphenation, quotation mark style, and font selection. Search engines use it as a signal for language-specific results. Translation tools use it to determine the source language.

Why it matters

The lang attribute is a critical accessibility rule. WCAG 2.2 lists it under Success Criterion 3.1.1 (Language of Page) at Level A, the most basic conformance level. This is not an optional enhancement. It is a baseline rule for making a page usable with assistive technology.

Screen readers that pronounce content in the wrong language make the page sound like gibberish. Users who depend on screen readers may leave right away because the content sounds broken, even though the text is perfectly fine.

There is also an SEO benefit. Search engines use the lang attribute alongside hreflang tags to understand which language a page is written in. This helps with accurate indexing in the correct regional search results.

Who this impacts most

Each website needs a lang attribute. It is not specific to multilingual sites. Any site that serves content in any language needs to declare that language so screen readers and browsers know how to process it.

Multilingual sites are most of all affected. If a French page has no lang attribute and the user's reader defaults to English, the French content is mispronounced. Each language version of the site needs the correct lang value on its html tag.

Sites built with older CMS templates may be missing the attribute entirely. Many early HTML templates did not include lang on the html tag. If the template has not been updated, each page on the site has the same gap.

How to fix it

Step 1: Add the lang attribute to your html tag. Open your base HTML template (or layout file) and add the lang attribute: <html lang='en'>. Use the correct BCP 47 code for your content language. For English, use 'en'. For US English in detail, use 'en-US'. For French, use 'fr'.

Step 2: Check your CMS template. In WordPress, the lang attribute is often set in header.php via the language_attributes() function. Check that the function is present and that WordPress knows the site language (Settings > General > Site Language). In Shopify, check theme.liquid for the html tag.

Step 3: Set the correct value for each language version. If your site has content in multiple languages, each version needs its own lang value. A French page should have lang='fr', not lang='en'. Check that your translation plugin or routing system sets this correctly.

Step 4: Use the lang attribute on inline content too. If a paragraph on an English page contains a French phrase, wrap it in a span with lang='fr'. This tells the screen reader to switch pronunciation for that phrase.

Common mistakes when fixing this

Using 'english' instead of 'en'. The lang attribute requires a BCP 47 code, not the full language name. 'english', 'English', and 'eng' are all invalid. The correct code is 'en' (or 'en-US', 'en-GB' for regional variants).

Setting lang on the body instead of the html tag. The lang attribute must be on the <html> element, not the body. Screen readers and browsers look for it on the root element. A lang on the body tag is not reliably read.

Setting the wrong language. If your site is in Spanish but the template sets lang='en', the screen reader uses English pronunciation on Spanish text. The content will sound wrong. Make sure the value matches the actual content language.

Forgetting to update lang after translation. If you translate a page from English to German, the HTML must change from lang='en' to lang='de'. Some translation workflows update the content but leave the html tag unchanged.

How to verify the fix

After adding the lang attribute, run another SiteCurl scan. The language check should pass. For a quick manual check, right-click on any page, select 'View Page Source,' and look at the very first line. The <html> tag should include lang='en' (or your content language).

To check with a screen reader, activate VoiceOver or NVDA and navigate to your page. Listen to the pronunciation. If the words sound natural, the lang attribute is correct. If the reader seems to be using the wrong accent or phonetics, check the value.

The bottom line

The lang attribute is one line of HTML that affects each screen reader user on your site. Without it, screen readers guess the language and often get it wrong. Add lang='en' (or your language code) to the html tag in your base template. It takes 10 seconds and fixes each page at once.

Example findings from a scan

HTML lang attribute missing on /

lang attribute set to 'english' (invalid code)

lang='en' missing on /es/about (Spanish content)

Frequently asked questions

What is the lang attribute?

The lang attribute on the html tag tells browsers and screen readers what language the page is written in. Screen readers use it to choose the right pronunciation voice. Browsers use it for spell-checking and hyphenation.

What value should I use for English?

Use 'en' for general English. Use 'en-US' for US English or 'en-GB' for British English if the distinction matters for your content. All three are valid BCP 47 language codes.

Does every page need a lang attribute?

Yes. The lang attribute should be on each page's html tag. If you set it in your base template or layout file, it applies to each page that uses that template.

Can I check the lang attribute without signing up?

Yes. The free audit checks the lang attribute as part of a full seven-category scan. No signup needed.

Check your page language now