Every web page should tell browsers and assistive technology what language it's written in. This is done with a lang attribute on the opening <html> tag. When that attribute is missing, software has to guess — and it often guesses wrong.
Why it matters
Screen readers rely on this attribute to pick the correct voice and pronunciation rules. Without it, English text can be read with a foreign accent or in another language entirely, which makes your content confusing or unusable for people who depend on audio. It also helps browsers offer accurate translation and search engines understand your content.
How to fix it
The fix is to add a lang attribute to the <html> tag. Use the code for your content's language — for example en for English, en-US for US English, fr for French, or es for Spanish.
<html lang="en">
WordPress
WordPress usually sets this automatically from your Settings → General → Site Language option, output through the language_attributes() function in your theme's header.php. If the tag is missing, check that your theme's header.php contains:
<html <?php language_attributes(); ?>>
Setting the correct Site Language in the admin area will then populate it.
Apache
Apache does not write your HTML, so the attribute must be added in the page or template source:
<html lang="en">
Nginx
Nginx also serves your files as-is and cannot add the attribute for you. Edit the <html> tag in your page source or template:
<html lang="en">
Cloudflare
Cloudflare passes your HTML through unchanged, so fix it at the source (your CMS or files). If you can't edit the source directly, you can inject the attribute with a Cloudflare Worker, but editing the page itself is simpler and more reliable.
How to check it worked
Open your page, right-click and choose View Page Source, and confirm the opening <html> tag includes a lang value matching your content's language.