ARIA Hidden: When to Use It & Avoiding Accessibility Issues (2024)

Notice Type: Warning

Relevant WCAG Conformance Levels: A

Did an “ARIA hidden” warning appear in an Accessibility Checker audit of one of your WordPress posts or pages? Read on below for an explanation of this warning, how it impacts your website’s accessibility, and how to fix it.

Table of Contents

  • About the ARIA Hidden Warning
    • What is ARIA?
    • What is ARIA Hidden?
    • What does the ARIA Hidden warning mean?
    • How does Accessibility Checker test for ARIA Hidden?
  • Impact on Accessibility
    • Using ARIA hidden can make content more accessible
    • When ARIA hidden is problematic
    • Relevant WCAG 2.1 Success Criteria
  • How to Resolve an ARIA Hidden Warning
    • What to do (in short)
    • How to find ARIA hidden elements on your WordPress post or page
    • How to assess ARIA hidden warnings for potential problems
      • Example 1: Logo Image With Empty Alt Text (Bad)
      • Example 2: SVG of the X logo (Bad)
      • Example 3: Decorative SVG (Good)
    • A note about ARIA problems and WordPress plugins

What is ARIA?

ARIA stands for Accessible Internet Rich Applications. It is a set of attributes that can be used to create more accessible web content for individuals with disabilities and users with screen readers.

ARIA attributes can be added to HTML elements on a web page in order to fix accessibility errors that HTML alone may not be able to resolve. ARIA attributes are most frequently added to web page elements that are developed with JavaScript, however, they can be added to any type of code that needs to be made more accessible assuming that cannot be accomplished with correct HTML semantics instead.

You can learn more about ARIA on Mozilla’s developer documentation page.

What is ARIA Hidden?

Adding aria-hidden="true" to an HTML element removes that element and all elements nested within it so that it is not visible or announced to users of assistive technology such as screen readers.

What does the ARIA Hidden warning mean?

The ARIA Hidden warning shows up in Accessibility Checker when content on your post or page has been hidden using the aria-hidden="true" attribute. If Accessibility Checker cannot confirm that aria-hidden was used appropriately, it will flag the element as something that needs human review.

How does Accessibility Checker test for ARIA Hidden?

While auditing your page or post content, Accessibility Checker will look at all elements, including those with explicit ARIA attributes. If an aria-hidden="true" attribute is found, the plugin then assesses if it should be ignored or a warning should be flagged.

The following elements are excluded from flagging aria-hidden warnings and will be ignored by this check:

  • WordPress core spacer blocks
  • Elements with role="presentation"
  • Elements within a link or button that has an aria-label
  • Elements within a link or button that contain screen reader text.
  • Elements within a link or button that has visible text.

Impact on Accessibility

Using ARIA hidden can make content more accessible

Removing elements and hiding them from users of assistive technology can improve their experience on your website if the items that are being hidden are extraneous to the meaningful content on the page. Some examples of content that can (and often should) be hidden from assistive technology users include:

  • Icons or images that are purely decorative.
  • Offscreen or collapsed content, such as text in menus or accordions that have not been opened.
  • Repeated text or duplicated content.

When ARIA hidden is problematic

While aria-hidden="true" can be helpful in some use cases, in other instances it should not be used because it is removing necessary functionality from your web page.

If important content, like form controls or links, is hidden using an ARIA attribute, that content will not be found with a screen reader. This can prevent screen reader users from accessing important information and interacting with navigable elements on your website if ARIA hidden is used incorrectly. Accordingly, thefourth rule of ARIA states thataria-hidden="true"should not be used on any focusable elements.

Additionally, it is important to note that aria-hidden="true" hides both the element it is applied to and all of its child elements. Usingaria-hidden="false"will notre-exposethe element toassistive technology if any of its parents specifyaria-hidden="true".

Relevant WCAG 2.1 Success Criteria

4.1.2 Name, Role, Value – Level A

This guideline requires that alluser interface componentsincluding but not limited to form elements, links, and components generated by scripts, must:

  • have anameandrolethat can beprogrammatically determined;
  • states, properties, and values that can be set by the user can beprogrammatically set; and
  • notification of changes to these items is available touser agents, includingassistive technologies.

What to do (in short)

First, install thefreeAccessibility Checker WordPress plugin.

For every ARIA Hidden warning that is flagged on your page, assess the element and determine if it is truly correct to hide the element from assistive technology users. If it is appropriate to hide the element, you can safely “ignore” the warning. If it is not appropriate to hide the element, then you will need to remove aria-hidden="true" from the element’s code.

How to find ARIA hidden elements on your WordPress post or page

For any pages or posts that have an ARIA Hidden warning in the WordPress editor, you can open the details tab in the Accessibility Checker meta box, then expand the ARIA Hidden warning to see a list of code that caused the warning to be flagged.

ARIA Hidden: When to Use It & Avoiding Accessibility Issues (1)

In the screenshot above, you can see four elements that have triggered ARIA hidden warnings in Accessibility Checker’s audit of the post or page.

How to assess ARIA hidden warnings for potential problems

In the example shown above, there are four elements that have aria-hidden="true" on them that have flagged an aria-hidden warning:

  1. A logo image that has empty alternative text.
  2. An SVG of the X logo.
  3. An SVG of the WordPress logo.
  4. An email link.

If this were your website, you would need to look at each of these warnings and determine if the elements should be hidden from assistive technology users. You may need to use your browser’s “inspect element” feature to view the surrounding code.

For each item, ask yourself these questions:

  • Is this item purely decorative?
  • Is the content duplicate or repetitive?
  • Is the item offscreen or collapsed?
  • Is this information that I do not want to be shown to people using screen readers or other assistive technologies?

If the answer to all of the above questions is yes, then ARIA hidden has been properly used and you can safely ignore the warning in Accessibility Checker. If not, then you likely need to remove aria-hidden="true" from your HTML or add an different fix to make element accessible.

Here are explanations of how to assess and what to do about each of the examples above.

Example 1: Logo Image With Empty Alt Text (Bad)

Here is the code for the first warning:

<img class="alignnone wp-image-18 size-full" src="https://websitedemos.net/roofing-services-08/wp-content/uploads/sites/709/2020/08/attab-logo-white.png" alt="" width="138" height="40" aria-hidden="true" />

Clicking “View on Page” in the Accessibility Checker Actions column shows us the image on the website’s front end.

ARIA Hidden: When to Use It & Avoiding Accessibility Issues (2)

In this example, the image that has aria-hidden on it is the website logo above an informational paragraph in the footer. This image is not purely decorative – it tells the user the name of the company in the footer, and so it would not be correct for this image to be hidden from screen reader users unless there was a heading or other text nearby conveying the same information.

For this element, aria-hidden="true" should be removed from the image tag and alternative text should also be added.

Example 2: SVG of the X logo (Bad)

Here is the code for the second warning:

<svg width="24" height="24" viewbox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z"></path></svg>

Clicking “View on Page” in the Accessibility Checker Actions column shows us the X (Twitter) icon on the website’s front end under the heading, “Tweet This.”

ARIA Hidden: When to Use It & Avoiding Accessibility Issues (3)

To assess this, we need to use the “inspect element” feature in our browser to assess the surrounding code. If you are not familiar with this feature, Zapier has a good tutorial on how to inspect elements in various browsers.

When we inspect element on this site, we can see that the SVG being flagged with aria-hidden is contained in a link, but the link does not have any screen reader text or aria-label to add meaning to it.

ARIA Hidden: When to Use It & Avoiding Accessibility Issues (4)

In this instance, it’s not good that the SVG is hidden from screen readers, because it’s resulting in an empty link. However, you likely don’t want to remove aria-hiden=”true” from the SVG, instead you should add an accessible name to the link. There are two ways to do that.

First, by adding an aria-label to the link like this:

<a href="https://twitter.com/" class="wp-block-social-link-anchor" aria-label="Click to tweet this post"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z"></path></svg></a>

The second option is to add screen reader only text inside the link like this:

<a href="https://twitter.com/" class="wp-block-social-link-anchor" ><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z"></path></svg><span class="sr-only">Click to tweet this post</span></a>

Either option is sufficient, and once you implement one and then rescan the page, your warning will go away.

Example 3: Decorative SVG (Good)

This third example is from the WordPress Accessibility Day website. The pages on that website have an SVG that is a collection of icons on the right of the page header.

ARIA Hidden: When to Use It & Avoiding Accessibility Issues (5)

In this instance, the image is purely decorative and adds no important meaning or value to the page. In this instance, it is correct to have aria-hidden="true" on the SVG, so this is a warning that should be “ignored” in Accessibility Checker.

A note about ARIA problems and WordPress plugins

Depending upon how you’re adding content to your WordPress website, it is likely that you may encounter an incorrectly added ARIA hidden attribute that is being inserted into your WordPress site by a third-party plugin. If this is the case, you may not be able to remove aria-hidden="true" and correct the error.

If you encounter accessibility errors that are caused by a third-party plugin you cannot control, please reference “What to do if a Plugin You’re Using has Accessibility Errors” for ideas on how to proceed.

ARIA Hidden: When to Use It & Avoiding Accessibility Issues (2024)

FAQs

ARIA Hidden: When to Use It & Avoiding Accessibility Issues? ›

While aria-hidden="true" can be helpful in some use cases, in other instances it should not be used because it is removing necessary functionality from your web page. If important content, like form controls or links, is hidden using an ARIA attribute, that content will not be found with a screen reader.

When should you use aria Hidden? ›

When an element has aria-hidden="true" , it will not be presented to screen reader users. However, it will still be visible to sighted users. This can be useful when there are elements that are just for decorative purposes or if there is redundant information that should not be read out loud by screen readers.

When should you use or recommend aria roles or attributes to solve an accessibility issue? ›

ARIA should be applied when native HTML cannot solve accessibility issues. For example, complex web controls that couple together or web page content that changes.

When not to use aria? ›

ARIA can actually make a website less accessible when used incorrectly. In fact, the number one rule of ARIA is to not use ARIA. This just means if there's an HTML element or attribute that'll get you the behavior you're looking for, then just use that HTML element or attribute.

What is the use of aria in accessibility? ›

For example, ARIA enables accessible JavaScript widgets, form hints and error messages, live content updates, and more. Warning: Many of these widgets are fully supported in modern browsers. Developers should prefer using the correct semantic HTML element over using ARIA, if such an element exists.

What is the difference between ALT and aria-hidden? ›

An alt attribute should always be used to provide a text alternative for an img element in HTML. An aria attribute can be used as an additional text alternative, but doesn't replace the requirement for an alt attribute.

Do SVGs need aria-hidden? ›

Hiding SVGs

For example, a layout table might be given a role of presentation because you don't want assistive technologies to read out row and cell information, but users can still access the content in the cells. In order to hide an SVG, it is best to give it an attribute of aria-hidden='"true".

How do you handle accessibility issues? ›

Accessibility testing checklist
  1. Make sure your HTML is as semantically correct as possible. ...
  2. Check that your content makes sense when the CSS is turned off.
  3. Make sure your functionality is keyboard accessible. ...
  4. Make sure your non-text content has text alternatives.
Aug 11, 2024

What is the common incorrect usage of aria attributes? ›

Incorrect spelling for attributes or values: Attributes are often spelled incorrectly. For example, aria-label might be spelled out as “aria-lable”. As a result, screen readers fail to announce the accessible name of the control.

When should we use an aria attribute? ›

ARIA is useful for revising or correcting the role of an element when a different role is necessary to expose to users. However, it is rarely in the user or author's best interest to try and use ARIA to override an interactive element, for instance a button , with a role generally exposed by a non-interactive element.

What is the point of aria hidden? ›

About the ARIA Hidden Warning

It is a set of attributes that can be used to create more accessible web content for individuals with disabilities and users with screen readers. ARIA attributes can be added to HTML elements on a web page in order to fix accessibility errors that HTML alone may not be able to resolve.

What happens if aria hidden is false? ›

Visually hiding elements with display or visibility hides content from the screen and from assistive technologies. Using aria-hidden="false" will not re-expose the element to assistive technology if any of its parents specify aria-hidden="true" .

What is the first rule of aria use? ›

First Rule of ARIA: Don't use ARIA. Well, actually, it says "if you can use a native HTML element or attribute... then do so." So, if you need a textbox, use an input, if you need a dropdown, use a select, if you need a button, use a button.

What is aria-controls and aria-hidden? ›

  1. aria-controls. The aria-controls attribute creates a cause and effect relationship. ...
  2. aria-hidden ≠ hidden. The hidden attribute is use to hide the content for any user. ...
  3. aria-expanded. The aria-expanded attribute is use to indicate the expanded status of element(s) for blind users. ...
  4. aria-selected.

Should I use aria disabled? ›

Now, if you have a form submit button that is not ready yet because the form needs to be completed first, then aria-disabled attribute is certainly better. This way, the button remains discoverable (it can be tabbed to) and interactive (it can be used to trigger form validation).

What is aria invalid used for? ›

The aria-invalid attribute is used to indicate that the value entered into an input field is not in a format or a value the application will accept. This may include formats such as email addresses or telephone numbers. aria-invalid can also be used to indicate that a required field is empty.

When should I use an aria labels? ›

aria-label can be used in cases where text that could label the element is not visible. If there is visible text that labels an element, use aria-labelledby instead. The purpose of aria-label is the same as aria-labelledby . Both provide an accessible name for an element.

What is the difference between role presentation and aria-hidden? ›

Unlike aria-hidden, role="presentation" actually doesn't remove the element from the accessibility tree altogether, but strips it of its semantic meaning, leaving the element like a <span>. Applying this role to an element, automatically spreads also to all its children.

What is the difference between aria-expanded and hidden? ›

When a menu is displayed, the button object that toggles the visibility of that menu has aria-expanded="true" set. When the menu is hidden, aria-expanded can be omitted. If specified when the menu is hidden, it should be set as aria-expanded="false" .

Top Articles
3 Red-Hot ETFs That Show No Signs of Cooling Off
Bitcoin ETFs have been a runaway hit. Will we see an Ethereum ETF before long?
The Tribes and Castes of the Central Provinces of India, Volume 3
Lakers Game Summary
Cintas Pay Bill
Booknet.com Contract Marriage 2
Azeroth Pilot Reloaded - Addons - World of Warcraft
Simple Steamed Purple Sweet Potatoes
Https //Advanceautoparts.4Myrebate.com
Leeks — A Dirty Little Secret (Ingredient)
finaint.com
Nutrislice Menus
Las 12 mejores subastas de carros en Los Ángeles, California - Gossip Vehiculos
1v1.LOL - Play Free Online | Spatial
Keurig Refillable Pods Walmart
Persona 4 Golden Taotie Fusion Calculator
Ratchet & Clank Future: Tools of Destruction
Bible Gateway passage: Revelation 3 - New Living Translation
3Movierulz
The 15 Best Sites to Watch Movies for Free (Legally!)
Milwaukee Nickname Crossword Clue
Paris Immobilier - craigslist
Geico Car Insurance Review 2024
Great ATV Riding Tips for Beginners
2004 Honda Odyssey Firing Order
Shiny Flower Belinda
Login.castlebranch.com
Cinema | Düsseldorfer Filmkunstkinos
Rays Salary Cap
Ff14 Sage Stat Priority
Pfcu Chestnut Street
Southern Democrat vs. MAGA Republican: Why NC governor race is a defining contest for 2024
Nsu Occupational Therapy Prerequisites
Trebuchet Gizmo Answer Key
Craigslist Lakeside Az
Pitchfork's Top 200 of the 2010s: 50-1 (clips)
Are you ready for some football? Zag Alum Justin Lange Forges Career in NFL
Soulstone Survivors Igg
Überblick zum Barotrauma - Überblick zum Barotrauma - MSD Manual Profi-Ausgabe
Registrar Lls
Pa Legion Baseball
Ds Cuts Saugus
60 Days From May 31
Candise Yang Acupuncture
Movie Hax
Dancing Bear - House Party! ID ? Brunette in hardcore action
Dayton Overdrive
ESPN's New Standalone Streaming Service Will Be Available Through Disney+ In 2025
WHAT WE CAN DO | Arizona Tile
Gameplay Clarkston
Koniec veľkorysých plánov. Prestížna LEAF Academy mení adresu, masívny kampus nepostaví
Latest Posts
Article information

Author: Jeremiah Abshire

Last Updated:

Views: 5633

Rating: 4.3 / 5 (54 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Jeremiah Abshire

Birthday: 1993-09-14

Address: Apt. 425 92748 Jannie Centers, Port Nikitaville, VT 82110

Phone: +8096210939894

Job: Lead Healthcare Manager

Hobby: Watching movies, Watching movies, Knapping, LARPing, Coffee roasting, Lacemaking, Gaming

Introduction: My name is Jeremiah Abshire, I am a outstanding, kind, clever, hilarious, curious, hilarious, outstanding person who loves writing and wants to share my knowledge and understanding with you.