lang attribute missing
Pages without a lang attribute on <html>. The language attribute tells screen readers which voice and pronunciation to use, and browsers which language the page is in; WCAG requires it. Google says it does not use it to tell a page’s language, which it reads from the visible text.
WarningONPAGE-009 · On-page · checked on every page
The html lang attribute: who reads it, and what Google says it ignores
Updated 16 October 2026.
The lang attribute on a page’s <html> element says which language the page is written in. This check finds pages whose <html> has none. It is worth being clear first about who reads it, because it is not mainly Google.
What Google says. Google works out a page’s language from its visible text, and says it does not use any code-level language information such as lang attributes (Google). For telling it about versions of a page in other languages, the tool is hreflang, not lang. So a missing lang does not hide a page from Google or put it in the wrong language’s results.
Who does read it:
- Screen readers and text-to-speech. They pick the voice and the pronunciation from it. A Romanian page marked lang="en" is read aloud with English pronunciation, which makes it hard to follow.
- Accessibility rules. WCAG makes it Level A, its first and lowest tier: the default language of each page must be programmatically determinable (WCAG 3.1.1). Accessibility audits fail a page without it.
How to write it (W3C):
- On the <html> element, not on <body>, which does not cover the <head>.
- As a language tag: en, fr, ro; with a region or a script only when it changes the text, as zh-Hans does.
- Not as a <meta http-equiv="Content-Language">: the W3C advises against it, and lang is what decides.
- A passage in another language gets its own lang, on the element around it, a <span> if there is nothing else.
<html lang="en"> … <p>The motto reads <span lang="la">festina lente</span>.</p>
Ours, as it is. trakis.io and the demo shop both open with <html lang="en">, set once in the layout every page shares, which is where it belongs on any site: one line in the main template covers every page.
Mistakes to avoid.
- The template’s language, not the page’s. A theme made in English and used for a site in another language keeps lang="en", and every page is then read aloud in the wrong voice.
- A name instead of a code: lang="english" is not a language tag.
- One language for a multilingual site. Each language version declares its own.
How the audit decides.
- It reads the lang attribute of the <html> element on each page that loads. Missing or empty is ONPAGE-009, a warning, for the reasons above rather than for Google. Until 16 October 2026 this page’s own explanation said search engines match pages to searches by it; Google says otherwise, and we corrected it.
- The value is not checked against the language tag registry, so lang="english" passes, and neither is it compared with the language of the text.
- Pages from one template are one finding: the attribute lives in the template.
Sources, read on 16 October 2026: Google Search Central, Managing multi-regional and multilingual sites · W3C WAI, Understanding Success Criterion 3.1.1: Language of Page · W3C Internationalization, Declaring language in HTML.
How common it is
In our study of 330 small sites, read from Common Crawl’s October 2026 archive (up to 100 pages a site), 20.0% of them had this problem on one page or more. On 61 of those sites the audit rated it a warning or worse; on the rest, a notice.
Where it usually comes from
Hand-written templates and older themes that start with <html> and nothing else.
If your SEO tool says…
The same problem, under the names other tools give it. Where a tool draws its line elsewhere, the note says how:
- Semrush: “Pages with no hreflang and lang attributes”. Only when a page has neither; this check asks for the lang attribute alone. Semrush’s page.
Wording from each tool’s own documentation, read on 13 October 2026.
How to fix it
- Declare the language on the <html> element, in the layout every page shares.
<html lang="ro">
Shown for an example shop at www.example.com. In a Trakis report the same fix comes with your own addresses and the list of your pages it applies to.
How to check it yourself
View the page source: the first tag should look like <html lang="en"> or the code of the site's language.
What it looks like in a report
Warning The <html> element has no lang attribute. · whole site
One attribute in the theme’s main template covers every page. (An example shop; the numbers are illustrative.)
How the audit counts it
ONPAGE-009 is a warning in the on-page category, and weighs lightly in that category’s score. When it appears on many pages built from the same template, the report shows it once, with the number of pages it covers — because one change in the template fixes all of them.
If the finding is deliberate on your site, it can be accepted as intentional in the report. It then leaves the list and the score, and comes back on its own if what it shows changes.
Other on-page checks
- Many impressions, very few clicks · GSC-001
- Close to the first page · GSC-002
- Page with traffic that asks not to be indexed · GSC-003
- Pages competing for the same search · GSC-004
- Title missing · ONPAGE-001
- Title too long · ONPAGE-002
- Title too short · ONPAGE-003
- Meta description missing · ONPAGE-004
- Meta description outside the useful range · ONPAGE-005
- H1 missing · ONPAGE-006
- Several H1 elements · ONPAGE-007
- Skipped heading level · ONPAGE-008
- meta viewport missing · ONPAGE-010
Find it on your site
A free Trakis audit runs this check and the other 66 on your site, and tells you on how many pages each one sits. Or go back to all the rules.