HTML Lang Attribute Missing

Screen readers use the lang attribute to select the correct pronunciation engine — without it, they apply default language rules that mispronounce words and ignore language-specific grammar. Browser translation tools also rely on lang to detect when to offer translation. It's a single attribute on the html element that takes 5 seconds to add.

HTML Lang Attribute Missing featured image

Start here

Before you fix it: what this check means

Scavo checks the main language declared on the HTML element. This helps screen readers choose pronunciation; the scan does not verify the language of every sentence. Scavo reads `lang` (or `xml:lang` fallback) from the `<html>` element and validates format.

Why this matters in practice: checking the reported setting helps you keep the site working as intended.

Use this as evidence, not a final verdict. This result covers what the scan could observe at that time, not every page or visitor situation. Check the live site first. Open the published page and ask your developer to inspect the reported request or setting Make one controlled change. Set `lang` in shared base layout. Re-scan the same URL and compare the finding; check the feature yourself as well.

Background sources

TL;DR: The HTML lang attribute is missing, so screen readers use the wrong pronunciation rules and translation tools can't detect your language.

Screen readers use the lang attribute to select the correct pronunciation engine — without it, they apply default language rules that mispronounce words and ignore language-specific grammar. Browser translation tools also rely on lang to detect when to offer translation. It's a single attribute on the html element that takes 5 seconds to add.

What Scavo checks (quick version)

Scavo reads lang (or xml:lang fallback) from the <html> element and validates format.

Current logic:

  • Warning: no language attribute found
  • Warning: language value exists but format is invalid
  • Pass: valid language tag format detected

Accepted format is based on BCP 47 style patterns (for example en, en-gb, fr, es-419).

How Scavo scores this check

Scavo assigns one result state for this check on the tested page:

  • Pass: baseline signals for this check were found.
  • Warning: partial coverage or risk signals were found and should be reviewed.
  • Fail: required signals were missing or risky behavior was confirmed.
  • Info: Scavo could not gather enough reliable evidence on this run to score pass/fail confidently.

In your scan report, this appears under What failed / What needs attention / What is working for language_attribute, followed by Recommended next steps and Technical evidence (for developers) when needed.

  • Scan key: language_attribute
  • Category: TECHNICAL

Why fixing this matters

Language metadata helps assistive technologies, translation systems, and browser processing behavior.

Missing or malformed language tags can reduce accessibility quality and international correctness.

If you are not technical

  1. Ask your developer to confirm <html lang="..."> exists on live pages.
  2. Check localized versions use matching language tags.
  3. Ensure the value reflects real page language.
  4. Re-run Scavo and confirm pass.

Technical handoff message

Copy and share this with your developer.

Scavo flagged Language attribute (language_attribute). Please add/fix the root <html lang="..."> declaration using a valid BCP 47 language tag and verify localized routes use correct values.

If you are technical

  1. Set lang in shared base layout.
  2. Use locale-aware rendering for translated routes.
  3. Validate generated language tags from locale config.
  4. Keep lang synchronized with actual content language.

How to verify

  • View source and confirm <html lang="..."> on key templates.
  • Validate tags for locales (for example en-gb, fr-fr, es-419).
  • Confirm no malformed custom codes are emitted.
  • Re-run Scavo and confirm pass.

What this scan cannot confirm

  • It does not validate translation quality.
  • It does not verify full international SEO implementation.
  • It checks format/presence, not semantic correctness of every phrase.

Owner checklist

  • [ ] Assign owner for locale metadata in base templates.
  • [ ] Keep locale-code mapping centralized.
  • [ ] Add release checks for missing/invalid lang values.
  • [ ] Re-test after localization routing changes.

FAQ

Is xml:lang enough?

This check uses it as fallback, but standard lang on <html> should be present.

Can one site have different lang values by route?

Yes, and that is expected for multilingual sites.

Why does format matter?

Malformed tags can be ignored by tools that rely on standardized language codes.

What is the safest default for English-only pages?

Use an explicit value like en (or a region-specific variant if appropriate).

Sources


Need help mapping URL locales to valid language tags? Send support your locale config.

More checks in this area

404 Page Returns Wrong HTTP Status Code featured image
not_found_status

404 Page Returns Wrong HTTP Status Code

When a deleted or broken URL returns HTTP 200, search engines index it as a real page — polluting your index with dead content and wasting crawl budget. This is called a "soft 404" and Google specifically warns against it. Your 404 page should return a proper 404 status code while still showing a helpful message to users.

Open guide
Analytics Not Installed or Not Firing featured image
analytics_instrumentation

Analytics Not Installed or Not Firing

Without analytics, every business decision about your website becomes a guess. You can't see which pages convert, where users drop off, which channels drive traffic, or whether changes improve performance. This is the foundation of data-driven optimization — if it's missing, you're flying blind.

Open guide