Skip to content
Nazmul Nikhil
Menu

<html> Element Does Not Have an [xml:lang] Attribute With the Same Base Language as the [lang] Attribute (PageSpeed Insights)

PageSpeed flags pages where xml:lang and lang name different languages. Here's how to make them match, or drop xml:lang.

Nazmul Nikhil

By

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

Published 1 min read
<html> Element Does Not Have an [xml:lang] Attribute With the Same Base Language as the [lang] Attribute (PageSpeed Insights)
Photo: Ziyao Xiong on Unsplash

In short

Some older XHTML-style templates set both lang and xml:lang on <html>. If they name different base languages (for example lang="en" and xml:lang="fr"), assistive technology gets mixed signals. Make them the same, or remove xml:lang, which modern HTML doesn't need. Weight 3.

<html lang="en">

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

Sources and references

TAGSPageSpeed InsightsXml lang mismatchXml:lang lang attributeHtml-xml-lang-mismatch
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