---
title: "Page is missing a language attribute"
date: "2025-03-13T10:00:13+00:00"
summary: "Ensure proper language detection for accessibility with correct HTML lang attributes. Improve screen reader accuracy and SEO."
image:
type: "page"
url: "/web-governance/page-missing-language-attribute"
id: "833d266d-1769-49b5-af3b-11c9e1199c18"
---

Table of contents will be added

3.1.1 Language of Page

Introduction
------------

This document provides information about the Acquia Web Governance accessibility check:
=======================================================================================

*   Page is missing a language attribute.
    =====================================
    
*   HTML page has lang attribute.
    =============================
    

What
----

Every HTML document must have a lang attribute on the `<html>` element to indicate the primary language of the page. This helps assistive technologies such as screen readers to determine how to pronounce and interpret the text correctly.

The lang attribute should:

*   Be present in the <html> element.
*   Contain a valid BCP 47 language code, for example _en_ for English, _fr_ for French, _es_ for Spanish, and so on.

### When is this applicable?

This check applies to all HTML documents.

Why
---

Valid `lang` attributes improve accessibility and usability in the following ways:

*   **Ensure correct screen reader pronunciation**   
    Without a language declaration, screen readers may use the wrong pronunciation rules.
*   **Support text-to-speech tools**  
    Some assistive technologies adjust pronunciation and reading patterns based on the language.
*   **Enhance SEO and translation tools**  
    Search engines and translation services rely on the lang attribute to provide relevant results and accurate translations.

Who
---

### Affected users

This check primarily benefits:

*   Screen reader users: Who rely on correct pronunciation.
*   Multilingual users: Who need accurate translations.
*   Search engine users: Who depend on correct language indexing.

Examples
--------

This section provides pass and fail examples for this check.

### Pass examples 

*   #### A document with a valid lang attribute
    
        <html lang="fr">
        <head>
          <title>Exemple de page</title>
        </head>
        <body>
          <p>Bonjour le monde !</p>
        </body>
        </html>
    
    The `lang="fr"` attribute correctly identifies the page as French.
    
*   #### A multilingual document with language changes
    
        <p>This is an English paragraph.</p>
        <p lang="es">Este es un párrafo en español.</p>
    
    The `lang="es"` attribute correctly marks the Spanish text.
    
*   #### A correct `lang` attribute
    
        <html lang="en">
        <head>
         <title>Example Page</title>
        </head>
        <body>
         <p>Hello, world!</p>
        </body>
        </html><head>
        <title>Example Page</title>
        </head>
        <body>
         <p>Hello, world!</p>
        </body>
        </html>
    

### Fail examples 

*   ####  Missing lang attribute on the `<html>` element
    
        <html>
        <head>
          <title>Example Page</title>
        </head>
        <body>
          <p>Hello, world!</p>
        </body>
        </html>
    
    Without a lang attribute, screen readers may use the wrong pronunciation rules.
    
*   #### Empty or incorrect lang attribute
    
        <html lang="">
        <head>
          <title>Example Page</title>
        </head>
        <body>
          <p>Hello, world!</p>
        </body>
        </html>
    
    An empty lang attribute is invalid and does not provide useful information.
    
*   #### Invalid language code
    
        <html lang="english">
    
    Ensure that there is a valid language code, for example, `english` is not a valid language code. The correct code is `en`.
    

How
---

This section provides information about how to review and fix a lang attribute.

### How to review it

1.  Check for a lang attribute on the `<html>` element.
    *   Open Developer Tools (F12) → Elements Tab.
    *   Locate the `<html>` tag and confirm that there is a lang attribute with a valid value.
2.  Ensure that language changes are marked in the content.
    *   If a webpage contains multiple languages, ensure that the different languages are marked with the lang attribute on relevant elements.

### How to fix it

1.  Add a valid `lang` attribute.  
    If the attribute is missing, add the correct language code to the `<html>` tag:
    

    <html lang="en">

1.  Fix any empty or incorrect `lang` attribute values.  
    Ensure that the `lang` attribute contains a valid BCP 47 language code, such as:
    
    *   en (English)
        
    *   fr (French)
        
    *   de (German)
        
    *   es (Spanish)
        
    *   zh-CN (Simplified Chinese)
        
2.  If the page contains multiple languages, apply `lang`attributes where needed:
    
        <p lang="it">Questo è un testo in italiano.</p>
    

Additional resources
--------------------

For the official list of language tags, visit: [IANA language subtag registry](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).

### WCAG success criteria[¶](https://docs.acquia.com/acquia-optimize/accessibility/2-4-3-focus-order/logical-focus-order#section-wcag-success-criteria "Permalink to this heading")

[3.1.1 Language of Page](https://www.w3.org/WAI/WCAG22/Understanding/language-of-page.html).