
lang attribute saying one language while the hreflang annotation or the actual visible content says another. Mixed signals confuse crawlers and assistive tech. Align them all on the real language of the page.What a language mismatch is
A page makes several separate claims about what language it is written in, and they are supposed to agree. Three claims matter:
- The
<html lang="...">attribute in the markup, which tells browsers and screen readers the primary language of the document. - The hreflang value that this page and its cluster use to describe the page's language and optional region, like
frorfr-CA. - The actual visible content, the words a human reads on the page.
A Lang Mismatch is when these disagree. The classic case: <html lang="en"> sits at the top of a page whose hreflang says de and whose body is written in German. The page is German. The lang attribute is lying. Another common variant is a page whose content is French but whose lang attribute was left at the site default of en because a template never got localised.
Why it matters
The lang attribute is not decorative. Two audiences depend on it being honest.
Assistive technology. Screen readers use html lang to pick the correct pronunciation engine. Set French content to lang="en" and a screen reader will read French words with English phonetics, which is close to unusable. This is a genuine accessibility defect, and it shows up in WCAG audits under the "Language of Page" success criterion.
Search engines. Google primarily determines a page's language from its visible content, not the lang attribute, so a mismatch rarely tanks rankings by itself. But it muddies the picture. When your lang attribute, hreflang, and content all agree, you give crawlers a clean, corroborated signal. When they fight each other, you are handing Google a reason to second guess your international setup, and you make your own hreflang debugging harder because you can no longer trust the markup at a glance.
The three signals and where they can drift
How to detect a mismatch
- Screaming Frog SEO Spider. It extracts both the
html langvalue and the hreflang self reference for every URL. Export those columns side by side and any row where they disagree is a candidate. You can also spot pages where lang is empty or set to the site default across a whole non English section. - Manual spot check with content. The tool can compare lang against hreflang, but only a human or a language detection pass confirms which one matches the actual words. Open a sample from each locale and read the first paragraph. If the content is German and lang says en, you have your answer.
- Accessibility auditors. Tools like axe, WAVE, or Lighthouse's accessibility audit flag an incorrect or missing
html langunder the "Language of Page" check. That catches the accessibility side even when SEO tools stay quiet. - Search Console. Useful for confirming which language Google thinks a page is in via the markets it surfaces the page in, though it will not report the mismatch directly.
| Signal | Where it lives | Format example | Who reads it |
|---|---|---|---|
| html lang | Opening html tag | de or de-DE | Browsers, screen readers |
| hreflang | head link, header, or sitemap | de or de-de | Search engines |
| Visible content | The page body | Actual German text | Humans and Google |
How to fix it, step by step
- Decide the ground truth: what language is the visible content actually in? The content wins. It is what users read and what Google reads.
- Set
<html lang>to match that content. Use the correct ISO code, a bare language likede, or language plus region likede-DEif you genuinely serve a regional variant. - Confirm the hreflang self reference and the cluster use the matching language code. Note that hreflang region codes are case tolerant and use the format
de-de, while lang usesde-DE. Both refer to the same thing. - Trace the root cause. Almost always it is a template default: a localised page inherited
lang="en"from a master layout that was never parameterised per locale. Fix the template so lang is driven by the same variable that drives the content and hreflang. - Re-crawl, then run an accessibility check on a sample per locale to confirm the lang attribute now matches the content in every language section.
What good looks like
For every page, the html lang attribute, the hreflang self reference, and the visible content all name the same language. A German page is lang="de", self references hreflang="de", and reads in German. There is no daylight between the three. Screen readers pronounce correctly, accessibility audits pass the Language of Page check, and your hreflang markup is trustworthy at a glance because the lang attribute corroborates it instead of contradicting it.
- Let the actual content decide the true language
- Set html lang to match content on every localised page
- Keep the hreflang self reference aligned with lang
- Drive lang from the same locale variable as the content
- Run an accessibility check per locale after fixing
- Leave every locale at the site default lang="en"
- Trust the markup while lang and content disagree
- Invent a region code like de-DE when you serve plain German
- Fix pages one by one when the template is the cause
- Assume it is only an SEO issue, it is an accessibility defect too
FAQ
Does Google use the html lang attribute to rank pages by language?
Should html lang be just the language or language plus region?
de. Only add a region like de-AT when the content is genuinely tailored to that region. Do not bolt on a region code you cannot back up with the actual content.Why does hreflang use de-de but lang uses de-DE?
What is the fastest way to fix this across a big multilingual site?
We audit lang attributes, hreflang, and content across every locale, find the template that is out of step, and give you a fix that aligns all three at once.
Claude Vincent is a technical SEO consultant focused on crawlability, rendering, and AI-search visibility. He writes the field guides and case studies at SEO ProCheck, with a bias toward the durable, unglamorous work that decides whether search engines and AI answer engines can actually read and cite a site.
About SEO ProCheck
Technical SEO consulting and GEO strategy with 20 years of enterprise experience. Case studies, resources, and tools for search and AI visibility.
Work With Me
Technical SEO audits, GEO strategy, site migrations, and international SEO. Hourly consulting for teams who need hands-on support, not just reports.







