• 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 / Add “lang” & “dir” Attributes

Add “lang” & “dir” Attributes

Do you think you may need to use our automated fix to add language and text direction attributes to your site’s HTML element? This article explains how to easily add lang and dir attributes to your WordPress site for improved accessibility.

How to fix lang and dir attributes in WordPress

If your website is missing language attributes, this can be easily fixed without writing code using the WordPress Accessibility Checker plugin.

Step 1

Click into the Accessibility Checker plugin settings in your WordPress dashboard (you must be logged in with an administrator account to access these settings).

Arrow pointing to the Settings page in the WordPress admin menu, which can be found under the Accessibility Checker top-level page.

Step 2

Go to the “Fixes” tab in the Settings Tabs navigation.

Arrow pointing to the Fixes page in the Settings tab navigation below the Accessibility Checker Settings H1.

Step 3

Check the box for Add “lang” & “dir” Attributes, then scroll to the bottom of the page and click the “Save Changes” button.

Checkbox labeled: Add the site language (lang) and text direction (dir) attributes to the <html> element.

Note: Automated accessibility fixes use JavaScript or other methods to modify how your website functions. Occasionally, a WordPress theme or extension may conflict with or prevent our fixes from working as expected. We recommend testing these fixes on a local or staging copy of your website first.

Not seeing the fix?

The Add “lang” & “dir” Attributes accessibility fix should start working immediately; however, if you don’t see the fix, it could be because you’re seeing a cached version of your website. Try clearing the cache in any caching plugins and on your hosting account, then look at your site in an incognito window to confirm the fix worked.

Note: Turning on a fix will not instantly remove related issues from Accessibility Checker reports. After turning on a fix, you can clear issues from reports by running a full site scan in Accessibility Checker Pro or by saving any individual post/page to trigger a rescan of that post/page only.

What This Fix Does

When enabled, the Add “lang” & “dir” Attributes fix first checks if the webpage has the language lang and text direction dir attributes in the HTML element. Here is an example of a valid HTML element with these attributes defined appropriately:

<html lang="en" dir="ltr">

If either of the language lang and text direction dir attributes are missing, the fix will define the missing attribute using available site information. The fix will attempt to retrieve this information using built-in WordPress functions get_bloginfo() and is_rtl(). If the fix cannot use the built-in method, it will use JavaScript as a fallback.

Existing language and text direction attributes will not be replaced.

Impact on Accessibility

The language attribute informs assistive technologies about the content’s primary language. Screen readers, for instance, rely on this information to correctly pronounce words and phrases, thus improving the experience for users with visual impairments. Without a language attribute, assistive tools may misinterpret the text, leading to a frustrating user experience.

The text direction attribute specifies the direction in which text should be read (left-to-right or right-to-left). For languages like Arabic or Hebrew, which are read right-to-left, the direction attribute ensures proper text alignment and flow. This is crucial for users who depend on the correct text direction to understand and interact with the content.

Associated Checks

The following checks in Accessibility Checker are associated with this fix:

Missing Language Declaration

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

Wait!

Before you go, join our email list to get

10% off

Accessibility Checker or any online course.

Name(Required)

We promise only to send you trustworthy accessibility content and event invitations. You can unsubscribe anytime, and we won’t share your information with anyone.