Lang Mismatch

No Comments
Lang mismatch
TL;DR: Lang Mismatch means the language a page declares about itself disagrees with itself. The most common form is the HTML 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.
Code
HR-021
Severity
Medium
Impact
Conflicting signals
Detect
Audit / SF
Fix
Align lang and hreflang

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 fr or fr-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

ALIGNED (good) html lang="de" German hreflang="de" German content German MISMATCH (flagged) html lang="en" says English hreflang="de" says German content German the odd one out

How to detect a mismatch

  • Screaming Frog SEO Spider. It extracts both the html lang value 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 lang under 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.
SignalWhere it livesFormat exampleWho reads it
html langOpening html tagde or de-DEBrowsers, screen readers
hreflanghead link, header, or sitemapde or de-deSearch engines
Visible contentThe page bodyActual German textHumans and Google

How to fix it, step by step

  1. Decide the ground truth: what language is the visible content actually in? The content wins. It is what users read and what Google reads.
  2. Set <html lang> to match that content. Use the correct ISO code, a bare language like de, or language plus region like de-DE if you genuinely serve a regional variant.
  3. 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 uses de-DE. Both refer to the same thing.
  4. 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.
  5. 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.

DO
  • 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
DON'T
  • 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?
Google has said it primarily reads the visible content to determine language and largely ignores the lang attribute for that purpose. So a mismatch rarely changes rankings directly. It still matters for accessibility and for keeping your hreflang setup coherent and debuggable.
Should html lang be just the language or language plus region?
Use the simplest code that is true. If the page is generic German, use 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?
Different specs. Hreflang values are case insensitive and conventionally written lowercase with a hyphen. The html lang attribute follows BCP 47, which conventionally capitalises the region subtag. Both point to the same language and region, so this casing difference is not a mismatch.
What is the fastest way to fix this across a big multilingual site?
Fix the template, not the pages. In nearly every case the wrong lang comes from a master layout that hard codes the default language. Wire the lang attribute to the same locale variable that already sets the content and hreflang, and thousands of pages correct themselves at once.
Get your language signals telling one story

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.

Book an advanced SEO audit

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.

Subscribe to our newsletter!

More from our blog