Fix guides · Accessibility
How to fix “aria-hidden elements contain focusable descendants”
Hidden menus, slides and pop-ups that keyboard users can still tab into, but screen readers won't announce. How to hide them properly.
- Time to fix
- 20–60 minutes
- Skill needed
- Developer
- Who notices
- Keyboard and screen reader users
Why it matters
aria-hidden="true" removes an element from what screen readers announce. But links and buttons inside it can still receive keyboard focus, so a visitor tabs onto something invisible and silent.
This often happens with closed mobile menus, off-screen carousel slides, duplicated logos and closed pop-ups. In the worst case, aria-hidden on the <body> hides the entire page from screen readers.
“Using the aria-hidden="true" attribute on an element removes the element and ALL of its child nodes from the accessibility API making it completely inaccessible to screen readers and other assistive technologies.”
Before you start
- If something is hidden from everyone (a closed menu or dialog), hide it fully: display: none, the hidden attribute, or the inert attribute. That removes it from both screen readers and the tab order.
- If something is visible but repeated (an icon next to text), keep aria-hidden, but make sure nothing inside it is focusable (add tabindex="-1" to its links, or don't make it a link).
- Never put aria-hidden on <body>. Pop-up scripts sometimes do this to the page behind a dialog; the inert attribute is the modern way.
Fix it on your platform
Shopify
- Check which element your report lists: slideshows, mobile menu drawers and cart drawers are the usual ones.
- If it's part of your theme, the fix is in its JavaScript or Liquid; ask your theme developer, or update the theme. If it belongs to an app, contact the app's developer.
WordPress
- Check which element is listed. Sliders, mega menus and pop-up plugins are common causes; update them, or switch to one that handles hidden content correctly.
- Fixes in your own theme belong in its JavaScript: hide closed menus with the hidden attribute or inert, not aria-hidden alone.
Webflow
- Check custom code and interactions that set aria-hidden, and hide closed content with display: none instead.
- If the element belongs to one of Webflow's built-in components (navbar, slider, tabs), contact Webflow support.
Wix Managed by the platform
- Wix defines ARIA attributes for the elements it provides. If an app or your custom code (Velo or Custom Code) is listed, fix or remove that code.
Squarespace Managed by the platform
- Squarespace generates the code for its own elements. If code injection or an extension is listed, fix or remove that code; otherwise contact Squarespace support.
Next.js
- Don't render closed menus and dialogs at all, or use the inert attribute on hidden content. Use the native <dialog> element, which handles this for the page behind it.
<nav id="mobile-menu" hidden={!open} inert={!open}>
…
</nav>Any other site
- Use hidden or inert for content that's closed, and keep focusable elements out of anything with aria-hidden.
<!-- Off-screen slide: not focusable, not announced -->
<div class="slide" inert>…</div>
<!-- Decorative duplicate: hidden, nothing focusable inside -->
<span aria-hidden="true">★★★★☆</span>Check that it's fixed
- Press Tab through the page: focus should never land on something you can't see.
- Re-run your StudioLNC audit: the issue should be gone.
Find every issue like this on your site
Free audit of performance, accessibility, SEO and security, with fixes for your platform.