NeovaPlateforme SEO avancée

aria-hidden=true défini sur l'élément body

Dans Neova S'exécute à partir du crawl lui-même : rien à configurer.

Règle revue le 17 octobre 2026 · Guide mis à jour le 7 juillet 2026

Cela masque tout le contenu de la page HTML aux lecteurs d'écran, ce qui va à l'encontre des critères WCAG 1.3.1 et 4.1.2.

Ce que vous pouvez faire

Retirez aria-hidden de l'élément body. Si un script de fenêtre modale le définit, appliquez-le plutôt au contenu derrière la modale.

Pourquoi Neova le signale

  • Un aria-hidden=true sur body masque toute la page aux lecteurs d'écran, alors qu'elle reste visible à l'écran.
  • Les scripts de fenêtres modales le posent souvent sans le retirer, ce qui laisse la page muette une fois la modale fermée.
  • Cela contredit les critères WCAG 1.3.1 et 4.1.2, tous deux de niveau A.

Sources

Le guide complet

Cette partie est en anglais pour l'instant.

What This Check Flags

This check fails when aria-hidden="true" is set on the <body> element. Because aria-hidden cascades to every descendant, putting it on the body hides the entire page from assistive technology — a screen reader is handed a document with, effectively, nothing in it. For someone relying on that screen reader, your fully rendered page is a blank wall.

This is not a subtle degradation like low contrast. It is an all-or-nothing failure: sighted users see a normal page, screen-reader users get silence. And it is almost never intentional — it is collateral damage from code that was trying to hide something else.

A Real Failing Example, and the Fix

The usual cause is a modal or overlay script that hides the background while a dialog is open, then targets the wrong node or forgets to clean up. Here is the broken pattern:

<!-- Modal open: script hides "the rest of the page"
     but points at <body> instead of a page wrapper -->
<body aria-hidden="true">
  <div id="app"> ... entire site ... </div>
  <div class="modal" role="dialog"> ... </div>
</body>

Since the dialog is inside the hidden body, even the modal the script wanted to show gets hidden from assistive tech. The fix is to never mark the body itself. Wrap the page content in a container, hide that container when the modal opens, and keep the modal a sibling outside the hidden wrapper:

<body>
  <div id="app" aria-hidden="true"> ... page content ... </div>
  <div class="modal" role="dialog" aria-modal="true"> ... </div>
</body>

<script>
  // On close, remove it, never leave it stuck on:
  document.getElementById('app').removeAttribute('aria-hidden');
</script>

Better still, modern browsers support the inert attribute, which removes an element from the accessibility tree and blocks focus and pointer events — a cleaner tool for backgrounding content behind a modal than aria-hidden alone.

aria-hidden Values and What They Do

Half the confusion here comes from misunderstanding what the attribute's values mean. This table clears it up:

On the Body Effect on Assistive Tech Verdict
aria-hidden="true" Entire page removed from the accessibility tree Fails this check — never do this
aria-hidden="false" No-op on body, but a code smell worth removing Passes, but delete it
Attribute absent (default) Page is fully exposed to assistive tech Correct state
aria-hidden="true" on a decorative child Only that child is hidden Fine — and often correct
inert on a background wrapper Hides + blocks focus/pointer, body untouched Preferred for modals

The takeaway: aria-hidden="true" is a perfectly good tool on a decorative icon or an offscreen carousel slide. The problem is exclusively its placement on <body> (or on the root wrapper that contains everything), where it takes the whole page down with it.

How to Detect It

  1. Run an automated checker (axe, Lighthouse). The rule "aria-hidden='true' must not be present on the document body" reports it directly with a clear pass/fail.
  2. Inspect the live DOM, not just the source. This attribute is frequently added by JavaScript after load, so view the rendered <body> in DevTools while the page and any modals are open and closed.
  3. Search your codebase for aria-hidden applied to document.body or to a top-level wrapper, and for scripts that set it on open without a matching removal on close.
  4. Test with an actual screen reader (VoiceOver, NVDA). If it announces nothing on a visibly full page, a body-level aria-hidden is the prime suspect.
  5. Exercise every modal, drawer, and overlay open-and-close cycle — the bug often only appears in the "stuck on after close" state.

How to Fix It

  1. Remove aria-hidden from <body> entirely. The body should never carry it.
  2. To background page content behind a modal, wrap that content in a container and apply aria-hidden (or, better, inert) to the wrapper — keeping the modal outside it.
  3. Guarantee cleanup: whatever adds the attribute on open must remove it on close, including on error paths and route changes.
  4. Audit third-party widgets and modal libraries; some manage focus by hiding the body and never restore it. Configure or patch them to target a wrapper.
  5. Re-test with a screen reader after the change to confirm the page is announced again.

FAQ

Is aria-hidden Always Bad?

Not at all. On a decorative icon, a duplicate offscreen element, or an inactive carousel slide, aria-hidden="true" is exactly right — it stops assistive tech from announcing noise. The failure is specific to putting it on the <body> (or the single wrapper that holds the whole page), which hides everything.

Why Does One Attribute Hide the Whole Page?

aria-hidden inherits down the tree. Setting it on an ancestor hides that element and all of its descendants from the accessibility tree. Since <body> is the ancestor of every visible thing on the page, hiding it hides the lot.

What Should I Use to Hide the Background Behind a Modal?

Apply the hiding to a content wrapper, never the body, and keep the modal as a sibling outside that wrapper. The inert attribute is the modern best choice because it removes the background from the accessibility tree and also blocks focus and clicks, so keyboard users cannot tab into hidden content.

It Is Added by JavaScript, so It Is Not in My HTML Source. Does That Matter?

No — assistive tech reads the live DOM, not your original source. If a script sets aria-hidden="true" on the body at runtime, the page is hidden regardless of what the source file says. Always inspect the rendered DOM.

Does This Hurt SEO?

Search crawlers largely ignore aria-hidden for indexing, so ranking impact is minimal. The real cost is a broken experience for screen-reader users and the legal and reputational exposure that comes with it. It sits in the same family as other structural ARIA mistakes — see required ARIA attributes and the broader accessibility and SEO overview.

Trouvez ce problème sur votre site

Neova lance ce check et tous les autres à chaque crawl, puis rédige la correction sous forme de ticket pour votre équipe.

  • Application de bureau pour Mac, Windows et Linux
  • Les 696 checks, chacun avec sa source
  • Search Console et Analytics 4, connectés en lecture seule
  • Tickets vers Jira, Linear et Asana

Télécharger Neova Offre Desktop Free, ou Solo gratuit pendant 14 jours, sans carte.

Tous les checks de la catégorie Accessibilité · Guides · Bibliothèque des checks

Rédigé par Neova Labs · Retour à la Bibliothèque des checks