Declare your page language so AI systems know what they are reading
A single lang attribute on the html tag tells crawlers which language your content is in.
What this signal tests
We check that the opening html tag of your page carries a valid lang attribute, for example lang="en" or lang="de-CH". The value must follow the BCP 47 standard, which is the same shorthand used by browsers and translation tools to identify languages and regional variants.
Why it matters for your visibility in AI
When AI systems crawl your page, one of the first things they look for is a clear declaration of the language. That declaration steers tokenization, translation, summarization, and which embedding model gets used. Without it, the system has to guess - and guessing wrong means your English page might be processed by a German pipeline, or a Brazilian Portuguese article might be lumped in with Spanish results. The concrete consequence is dilution: your content competes against a noisier, lower-confidence pool of pages, and AI answers that should cite you cite a clearer competitor instead. SEO crawlers tolerate missing lang attributes; AI ingestion pipelines treat them as a strong, deliberate signal.
Pass criteria at a glance
| Criterion | Passes when |
|---|---|
| lang attribute present AND valid BCP 47 tag. |
How we test it
We fetch the rendered HTML, read the opening html tag, and look for the lang attribute. The value is then matched against the BCP 47 grammar (language code, optional region, optional script). A page passes when the attribute is present and the value parses cleanly. Missing attributes, empty values, or non-standard codes like "english" or "uk" fail the check.
Show technical detection method
Parse <html lang>; validate value against RFC 5646 BCP 47 grammar.
If your site fails: how to fix it
- In WordPress, set Settings → General → Site Language; the theme will emit the correct lang attribute on the html tag automatically across every template.
- In a static site or hand-rolled template, edit the base layout and set <html lang="en-US"> (or your locale equivalent) before any other markup is generated.
- In Next.js, set the lang attribute on the Html component in pages/_document.js, or on the html element in app/layout.tsx for the App Router.
- For multilingual sites, render the lang attribute dynamically from the current page locale rather than hardcoding a single value across all language variants.
- Validate the chosen tag against the IANA Language Subtag Registry to confirm it is a real BCP 47 code; avoid invented values like "uk" for British English (use en-GB).
Quick facts
| Maturity | ESTABLISHED |
|---|---|
| Weight | high |
| Category | Content Clarity |
Primary sources
Related signals
Frequently asked questions
Does this matter if my site is in English only?
Yes. AI systems do not assume English by default the way some older tools did. Without an explicit lang declaration, crawlers run statistical language detection, which can misclassify short or technical pages. A single attribute is a five-second fix that removes that ambiguity for every crawler that visits.
Is lang the same thing as hreflang?
No. The lang attribute on html declares the language of the current page. hreflang annotations on link tags or in sitemaps tell search engines which alternate URLs serve other languages. AI ingestion uses lang for processing the page in front of it, and hreflang for discovering siblings.
Should I use just "en" or "en-US"?
Either is valid BCP 47. Use the shorter form when regional variant does not matter, and the longer form when it does - for example, currency formatting, spelling conventions, or legal context. Both pass our check; consistency across your site matters more than which form you pick.
Will SEO tools flag this the same way you do?
Most SEO audits flag missing lang as an accessibility issue rather than a ranking issue, so it often slides down their priority lists. AI readiness treats it as foundational - language declaration affects every downstream extraction, so we weight it higher than classic SEO tooling does.
Run your own scan
Run a free scan and see how your site grades across all 155 AI-readiness signals.