• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Equalize Digital Home

Equalize Digital

Website Accessibility Consulting, Training, and Development

  • My Account
  • Swag Shop
  • Checkout
  • Services
    • Accessibility Audits
    • User Testing
    • Accessibility Remediation
    • VPAT & ACR Preparation
    • Accessibility Monitoring
    • Web Accessibility Training
    • Accessibility for Agencies
  • Accessibility Checker
    • Overview
    • Features
    • Pricing
    • Documentation
    • Support
    • Buy Now
  • Company
    • About Us
    • Our Team
    • Industry Expertise
    • Accessibility Statement
    • Contact Sales
    • Become An Affiliate
  • Learn
    • Online Courses
    • Accessibility Meetup
    • Articles & Resources
    • Accessibility Craft Podcast
    • Upcoming Events
    • Office Hours
    • Custom Accessibility Training
    • Global Accessibility Awareness Day
  • Contact Sales
  • My Account
  • Checkout
Home / Accessibility Checker / Missing Language Declaration

Missing Language Declaration

Notice Type: Error
Relevant WCAG Conformance Levels: AA, A

Did a “Missing Language Declaration” error appear in an Accessibility Checker audit of one of your WordPress posts or pages? Read on below for an explanation of these errors, how they impact your website’s accessibility, and how to fix them.

Table of Contents

  • About the Missing Language Declaration Error
    • What is a language declaration?
    • What does the Missing Language Declaration error mean?
    • How does Accessibility Checker test for the language declaration?
  • Impact on Accessibility
    • Why are language attributes important?
    • Relevant WCAG 2.1 Success Criteria
      • 3.1.1 Language of Page – Level A
      • 3.1.2 Language of Parts – Level AA
  • How to Fix a Missing Language Declaration Error
    • What to do (in short)
    • Note: language changes within content should also be declared
    • Language codes

About the Missing Language Declaration Error

What is a language declaration?

A language declaration is an HTML attribute that denotes the default language of the content on a page or post. Language declarations should be coded into your website theme and appear automatically in the head of the website (the first section of code that contains information about a web page’s properties).

Language declarations are available to search engines and assistive technology but are not visible on the page.

Here is what a language declaration for an English web page looks like in XHTML:

<html xmlns="http://website.com/xhtml" xml:lang="en" lang="en">

And here is how it looks in HTML5:

<html xml:lang="en" lang="en">

The language declaration should immediately follow the doctype declaration.

What does the Missing Language Declaration error mean?

If you have a post or page with a Missing Language Declaration error that means that the page or post is not outputting the required language attribute on the HTML tag and assistive devices will not know what language the page is in.

How does Accessibility Checker test for the language declaration?

While auditing your post or page, Accessibility Checker finds the <HTML> tag and checks to see if lang or XML:lang is present in the tag and that the attribute is not empty.

Impact on Accessibility

Why are language attributes important?

It is important to declare the language of your page because it is used in a variety of ways by assistive technology and without this declaration, blind and visually imparied users may not be able to access the content on the site.

Screen readers use the language attributes to read the content of a page. Without an attribute, the screen reader may have a difficult time determining which language the page or post is in, and may miss sections of text or convey them incorrectly.

Braille keyboards and refreshable braille displays use language attributes to substitute control codes for accented characters, ensuring that the user understands words, phrases, and sections of text correctly.

Some speech synthesizers support multiple languages, and need the language attribute to orient themselves and use the correct pronunciations and syntax of a certain language. Without a language attribute, a speech synthesizer is likely to mispronounce the text and a user may have difficulty understanding it.

In addition to helping people with disabilities, language attributes also help people who speak other languages and may be translating your website, and they can be used by search engines to understand your content and determine your ranking.

Relevant WCAG 2.1 Success Criteria

3.1.1 Language of Page – Level A

The default human language of each Web page can be programmatically determined.

3.1.2 Language of Parts – Level AA

The human language of each passage or phrase in the content can be programmatically determined except for proper names, technical terms, words of indeterminate language, and words or phrases that have become part of the vernacular of the immediately surrounding text.

How to Fix a Missing Language Declaration Error

What to do (in short)

First, install the free Accessibility Checker WordPress plugin.

To fix a Missing Language Declaration error, you will need to edit your theme files to add the missing language attribute to the HTML tag at the very top of your website header. If you’re using a theme that receives updates, then you’ll need to make the change in a child theme to ensure the fix does not get overwritten when you next update your theme.

This is a change that will likely require a developer’s assistance. If you don’t know how to make this change yourself, please see our article discussing what to do if there are accessibility errors in your theme.

Note: language changes within content should also be declared

Just as it is important to declare the language of the whole page, if you change language mid-way through a post or page, it is also important to declare the language change when that change happens.

Accessibility Checker does not currently test for language changes mid-page (though may in a future release), but it is still important that you tag any language changes as they happen.

If your main website is in English, for example, but you provide Spanish translations following your English content, you need to alert screen readers and other assistive technology that the language is changing. This notification can be done by adding the language declaration in a <div> or a <span> or <p> tag that wraps around content in the new language, which will ensure that your user’s assistive technology can accurately convey the text in the second language.

Here is an example of how you can communicate a change in language mid page:

<p>Here is a sentence in English. Most of my content is in English and the main document language is declared to be English so this paragraph does not need a language declaration.</p>

<p lang="es" xml:lang="es">Aquí hay una oración en español. Usamos el traductor de Google, así que espero que sea correcto. Debido a que este párrafo está en un idioma nuevo, lo hemos notado en el HTML del párrafo.</p>

Notice the last paragraph has language declarations to tell assistive devices that we have changed from English to Spanish. In case you’re curious, that paragraph reads: “Here is a sentence in Spanish. We used Google translate so hopefully it is correct. Because this paragraph is in a new language, we have noted that in the HTML for the paragraph.”

Language codes

When denoting the language for the page or a section of the page, you need to use the recognized two or four letter language code a.k.a “language culture name.”

Base languages are two letters but you can add additional letters to denote dialect or regional differences in the language. For example, the HTML code for English is “en”, but you can denote American English with “en-US” or British English with “en-GB”.

Here are some language codes for languages most spoken in the world:

LanguageCode
Englishen
Chinesezh
Spanishes
Frenchfr
Hindihi
Arabicar
Portuguesept
Russianru
Japaneseja
Bengalibn
Indonesianid

Find more language codes on W3 Schools.

Primary Sidebar

Equalize Digital Accessibility Checker. Start making your WordPress Website Accessible Today. Get Accessibility Checker Now.

Frequently Asked Questions

  • How to Install & Activate Accessibility Checker
  • Getting Started Quick Guide
  • Why Do We Say 100% Passed Tests, Not 100% Accessible?
  • Manual Accessibility Testing: How You Can Check Website Accessibility
  • When and How to Ignore Accessibility Errors or Warnings
  • What to do if There are Accessibility Errors in Your Theme
  • What to do if a Plugin You’re Using has Accessibility Errors
  • How to Get Support for Accessibility Checker
  • Can I Hire Equalize Digital to Fix Accessibility Issues on My Website?
  • Additional Resources for Learning About Accessibility
  • How to Test Accessibility Checker for Conflicts with Themes or Plugins
  • What Does “Unlimited Dev Sites” mean?
  • Is there an Accessibility Conformance Report (ACR) or VPAT available for Accessibility Checker?
  • How to Get the Audit History Plugin – Legacy Customer Instructions
  • How does Accessibility Checker align with WCAG?
  • What to do if Accessibility Checker is not Scanning Your Site
  • Known Conflicts
  • Ensuring Accessibility Checker Fixes Work with JavaScript Optimization Plugins

Rule Documentation

  • A Slider is Present
  • A Video is Present
  • Ambiguous Anchor Text
  • ARIA Hidden
  • Blinking or Scrolling Content
  • Broken ARIA Reference
  • Broken Skip or Anchor Link
  • Duplicate Alternative Text
  • Duplicate Form Label
  • Empty Button
  • Empty Heading Tag
  • Empty Link
  • Empty or Missing Form Label
  • Empty or Missing Table Header
  • Empty Paragraph Tag
  • iFrame Missing Title
  • Image Animated GIF
  • Image Empty Alternative Text
  • Image Long Alternative Text
  • Image Map Missing Alternative Text
  • Image Missing Alternative Text
  • Improper Use of Link
  • Incorrect Heading Order
  • Insufficient Color Contrast
  • Link Opens New Window or Tab
  • Link to MS Office File
  • Link to Non-HTML File
  • Link to PDF
  • Linked Image Missing or Empty Alternative Text
  • Long Description Invalid
  • Low-quality Alternative Text
  • Missing Language Declaration
  • Missing Subheadings
  • Missing Title
  • Missing Transcript
  • Possible Heading
  • Readability & Simplified Summary
  • Tab Order Modified
  • Text Justified
  • Text Too Small
  • Underlined Text
  • Zooming and Scaling Disabled

Easier, Faster Accessibility Testing

Equalize Digital Accessibility Checker gives you real-time accessibility feedback in the WordPress editor. Learn accessibility and make fixes earlier in the dev and content creation process. Full-site accessibility scanning without the per page fees.

Get Accessibility Checker

Footer

Equalize Digital Websites for Everyone

Your WordPress accessibility team. Accessibility plugins, rapid audits, and consulting to help you make your website usable by people of all abilities.

  • Facebook
  • GitHub
  • LinkedIn
  • Twitter
  • YouTube

Company

  • About Equalize Digital
  • WordPress Accessibility Meetup
  • Accessibility Statement
  • Blog
  • Events
  • Contact Us

Services

  • Accessibility Audits
  • User Testing
  • Remediation
  • Ongoing Monitoring
  • VPAT & ACR Preparation
  • Accessibility Training
  • For Agencies
  • Website Development

Accessibility Checker

  • Features
  • Pricing
  • Documentation
  • How to Get Support
  • My Account
  • Affiliate Dashboard
  • Become an Affiliate

© 2025 Equalize Digital · Privacy Policy · Terms of Service · Software Terms & Refund Policy

International Association of Accessibility Professionals member