The page body must not have aria-hidden="true"

Setting `aria-hidden="true"` on `<body>` hides the whole page from assistive technology. Remove it so screen reader users can read and use the content.

Rule IDaria-hidden-body
ImpactCritical
Success criterion 1.3.1 Info and Relationships · A
4.1.2 Name, Role, Value · A
StandardsWCAG 2.0 · WCAG 2.1 · WCAG 2.2 · Section 508 · EN 301 549
Readabler fix Fixed automatically

Example

Before
<body aria-hidden="true">
  <h1>Spring collection</h1>
  <a href="/shop">Shop now</a>
</body>

A screen reader finds nothing to read; keyboard focus lands on links it cannot announce.

After
<body>
  <h1>Spring collection</h1>
  <a href="/shop">Shop now</a>
</body>

A screen reader reads “Spring collection, heading level 1” and “Shop now, link”.

Why it matters

aria-hidden="true" removes an element and everything inside it from the accessibility tree. On the body, that is the entire page. Blind users hear silence or “blank”, cannot list headings or links, and cannot fill in forms. Keyboard focus still moves through links and buttons, but the screen reader cannot say what they are.

This rarely happens on purpose. It is usually left behind by a modal or menu script that hides the page while an overlay is open and fails to remove the attribute, or that hides body instead of the page wrapper. Sighted users notice nothing, so the bug can stay live for months while the site is unusable for screen reader users. It also blocks some voice control and accessibility testing tools.

How to fix it

Remove the attribute from <body> and hide only what needs hiding.

Static markup. Delete aria-hidden from the body tag in your layout or template.

Modal and menu scripts. Hide the page wrapper, not the body, and make sure the dialog sits outside that wrapper:

<body>
  <div id="page" aria-hidden="true">…site content…</div>
  <div role="dialog" aria-modal="true" aria-labelledby="t">…</div>
</body>

Always remove the attribute again when the overlay closes, including when it closes with Escape or a click outside.

Modern alternative. Use the native <dialog> element with showModal(), which makes the rest of the page inert without any ARIA, or set the inert attribute on the wrapper:

<div id="page" inert>…</div>

Third-party scripts. If a plugin adds the attribute to the body, update or reconfigure it; most popular modal libraries let you choose which element is hidden.

Checklist

  1. Remove aria-hidden from the body element.
  2. Hide a page wrapper, not body, when a modal opens.
  3. Remove aria-hidden again when overlays close.
  4. Consider the dialog element or inert instead of aria-hidden.

How the check works

The check looks at the <body> element of the page and fails when it has aria-hidden="true". Any other value, or no attribute, passes. Because scripts often add the attribute only while a modal or menu is open, run the check again with overlays open and closed.

Resources

Updated October 27, 2026