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.

Start here

Before You Fix It: What This Check Means

The HTML lang attribute helps assistive tech and search systems choose correct language handling. In plain terms, this checks whether the page declares its main language for browsers, search engines, and assistive tools. Scavo reads `lang` (or `xml:lang` fallback) from the `<html>` element and validates format.

Why this matters in practice: operational drift here often causes hard-to-debug regressions across environments.

How to use this result: treat this as directional evidence, not final truth. This result reflects what was observable at scan time and should be verified in your own production context. First, confirm the issue in live output: verify directly in live production output with browser/network tools Then ship one controlled change: Set `lang` in shared base layout. Finally, re-scan the same URL to confirm the result improves.

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 (plain English)

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

redirect_chain_hygiene

Redirect Chain Too Long — Multiple Hops Before the Real Page Loads

Learn how Scavo measures redirect hops, why chains slow users and crawlers down, and how to flatten protocol, host, and legacy URL redirects into cleaner routes.

Open guide
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_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