Skip to content
Nazmul Nikhil
Menu

<html> Element Does Not Have a [lang] Attribute (PageSpeed Insights): How to Fix

PageSpeed flags pages that don't declare their language. Screen readers may mispronounce the text. Here's the fix on every major platform.

Nazmul Nikhil

By

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

Published 1 min read
<html> Element Does Not Have a [lang] Attribute (PageSpeed Insights): How to Fix
Photo: Javier Allegue Barros on Unsplash

In short

Every page should say what language it's in. Without lang on the <html> element, screen readers guess and may read English with the wrong accent, and browsers can't offer accurate translation. Add lang="en" (or the right code). Weight 7.

<html lang="en">

Use a region when it matters: en-US, en-GB. For a Bangla page, bn.

WordPress: set Settings > General > Site Language; the theme prints it. If missing, the theme's header is outdated. Shopify: set by the store language; check theme.liquid. Webflow: Site settings > General > Language. Wix: set by site language. Custom builds: in the base layout (and the SSR template).

This guide isn't affiliated with or endorsed by Google.

Sources and references

TAGSPageSpeed InsightsHtml element does not have a lang attributeHtml lang attributeDeclare page language
Nazmul Nikhil

About the author

Nazmul Nikhil

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.

Need help with this?

Get it fixed with Technical SEO

I find the issues that cost you traffic and fix them, starting with the pages that matter most.

Keep reading

Related articles

All Page Speed & Core Web Vitals posts →

Get the next guide in your inbox

One email when a new SEO or AI search guide goes live.

Ready to grow?

Get a free audit of your website, or book a 30-minute call to talk through your goals.

Nazmul Hasan

Talk to Nazmul directly

Reply within 24h

WhatsApp +880 1682835118
nazmulnikhil@gmail.com