Why this matters
Screen readers use the lang attribute to choose the correct pronunciation engine. Without it, a screen reader may read English text with the wrong accent or mispronounce words entirely. It also helps translation tools and search engines understand your content.
Code examples
✗ Incorrect — fails WCAG
<!DOCTYPE html> <html> <head>...</head>
✓ Correct — passes WCAG
<!DOCTYPE html> <html lang="en"> <head>...</head> <!-- Portuguese --> <html lang="pt-BR"> <!-- Spanish --> <html lang="es">
How to fix it — step by step
- 1Add lang='en' (or your language code) to the <html> element
- 2Use the correct BCP 47 language tag — 'en' for English, 'pt-BR' for Brazilian Portuguese, 'es' for Spanish
- 3For WordPress: most themes add this automatically via language_attributes() in header.php
- 4If your page has sections in a different language, add lang= to that specific element
- 5Check your lang value is correct — lang='en' on a Spanish page is also a violation
Reference: WCAG 2.2 Success Criterion 3.1.1 (Level A)
Test it for free
Use WebPossum to automatically detect this violation and every other WCAG 2.2 issue on your site. Free, instant, no signup required.