Technical pillar / check html-lang
Page language attribute: does the page say what language it is in?
We check that the html element of each page carries a language code such as lang="en". Screen readers and browsers use it, and Google says it does not, so we treat this as a check for your visitors that has no bearing on rankings.
By Shimon Alex Carroll, Founder and CEO, Own The Climb · Last updated
This is how we check it
We check that each page says which language it is written in, with a code such as lang="en" on its <html> tag.
- We check that the language code is well formed and flag a mismatch when the page text or main content declares another language.
- It fails when the code is missing, empty or not a code, such as "english".
- Google says it does not use this attribute. We evaluate it for visitors who rely on correct language labels.
Our reasoning behind this
Screen readers use the language code to pick the right pronunciation, and browsers use it to offer translation. The accessibility standard WCAG asks for it at its most basic level.
“We don't use any code-level language information such as lang attributes”
What a pass and a finding look like in our reports
Each example shows a piece of markup and the finding title our audit uses for it. We explain the example underneath so you can understand the result in your own report.
<!DOCTYPE html> <html lang="en"><head><title>Estate planning</title></head><body><p>This is an example page about estate planning for families in Maryland, written in plain English for people who want to protect their homes and savings.</p></body></html>PassThe page declares its language (lang="en")
The page says it is in English, so there is nothing here for you to change.
<!DOCTYPE html> <html><head><title>Estate planning</title></head><body><p>This is an example page about estate planning.</p></body></html>lowThe page does not declare its language
The <html> tag has no lang attribute, so a screen reader has to guess.
How we would fix it on your site
- Set the site language in your content system or site builder.
- Or add it to your template: <html lang="en">.
- Use a regional code such as "en-GB" only when the content is written for that region.
Once your change is live, run the audit again and review the new findings alongside the pages it covered.
What we want you to review
- Set a lang attribute when a theme omits it.
- Check that a copied lang value matches the language of this page.
- Use the language code in lang; the full language name is not the required value.
The exact rules our audit applies
We wrote this part for your developer or your SEO specialist. It sets out the inputs, scoring rules and confidence limits we publish for this check, together with the full explanation of how we would fix a finding.
The inputs we describe for this check
The lang attribute of the <html> element, read as written. It passes when it is a language tag by the BCP 47 grammar, such as "en", "en-US" or "zh-Hant-TW", and fails when it is missing, empty or not a code (for example "english").
Our full reasoning
The accessibility standard WCAG 2.2, success criterion 3.1.1 at level A, says "The default human language of each web page can be programmatically determined", so that "Screen readers can load the correct pronunciation rules" and browsers can offer the right translation. Google says "Google uses the visible content of your page to determine its language.
We don't use any code-level language information such as lang attributes", so we never present it as a ranking factor.
How we score what we find
Measured, LOW, on every page we read. It never affects how Google ranks the page, so it never costs more than a low finding.
How sure we are of each result
HIGH: read from the html element of the page as we received it, before any script runs. The mismatch finding compares it with the lang of the element that holds most of the page text, and reads only real language codes, never code blocks.
How to fix it, in full
Set the site language in your CMS or site builder, or add it to the template: <html lang="en">. Use a regional code such as "en-GB" only if the content is written for that region.
The sources we rely on
What we have changed on this page
- · Rewritten in plain words: what we check, why it matters and how to fix it come first, and the full rules sit one click down. We corrected the full rules to describe only what we check today.
- · Language tags are read by the BCP 47 grammar (RFC 5646), so grandfathered tags (i-klingon), extensions (en-US-u-ca-gregory) and private-use subtags (en-US-x-twain) pass, while a word such as "english" is still not a code.
- · A page whose html element says one language while the element holding most of its text says another (lang="en" around lang="es") is now a low finding: screen readers would read the content with the wrong pronunciation. Code blocks and values that are not language codes (lang="php") never count. A page tagged English whose running text plainly reads as another language, with no element marking it, is a low finding too, at medium confidence because it is read from the words; a page that mixes languages is never flagged.
- · Initial publication, part of the checks added to match the free Seobility checker and the gaps our 2026-10-21 benchmark found.