The HTML element must have a lang attribute
Estimated effort: about 5 minutes.
The page's HTML needs to declare which language it is written in so screen readers use the correct pronunciation rules. Without this, a screen reader may read the text using the wrong language's sound library, making it hard or impossible to understand.
How to fix it
- View the page's rendered HTML and locate the opening <html> tag.
- Add a lang attribute with the correct language code, e.g. <html lang="en"> for English.
- If the site serves a specific regional variant, use the more specific code, e.g. lang="en-US" for American English.
- If a section of the page is written in a different language than the rest of the page, add a lang attribute to that specific element too, e.g. <span lang="es">.
- Confirm the attribute is present by viewing the page source after saving.
Before and after
Before
<html>
After
<html lang="en">