Page language not declared
What it is
The page’s <html> tag is missing its lang attribute, or has an empty one, so the page does not say what language it is written in. The attribute holds a short language code such as en, nl or en-GB, and it applies to everything on the page unless a part declares a language of its own.
Why it matters
The declared language decides which voice and pronunciation a screen reader uses. Left undeclared, the reader’s own default setting decides instead, so a Dutch page may be read by an English voice and become hard to follow. A page with no language fails WCAG 3.1.1 Language of Page (Level A), and since June 2025 the European Accessibility Act requires many businesses selling to consumers online in the EU to meet it. It is not a search fix: Google says it detects language from visible content and does not use lang.
How Asky checks it
Asky reads the page’s raw HTML and looks at the lang attribute on the <html> tag. The page is reported when the attribute is missing or holds only spaces, and also when the HTML has no <html> tag at all. The xml:lang attribute and the Content-Language HTTP header are not read, lang on other elements does not count, and a value set by JavaScript is not seen. Whether the code matches the language of the text is not checked. A value that is present but malformed is reported as an invalid page language code instead, never both.
Reported as an error with high severity.
How to fix it
- Set the site’s language in your CMS. In WordPress this is the Site Language under Settings, General, which standard themes print into the
<html>tag. - In a custom template, add
langto the<html>tag with the code for the language the page is written in:en,de, or a language and region joined by a hyphen, such asen-GB. - If one template serves several languages, output each page’s own language, not a single fixed value.
- Put the attribute in the HTML the server sends, not in a script that adds it after the page loads.
- Mark passages in another language, such as a quote, with their own
langon the element around them.
Example
https://example.com/blog/pricing-guide is written in English:
<!-- Before: no language declared -->
<html>
<!-- After -->
<html lang="en">