How to fix aria roles on Adobe Commerce (Magento)

Audit every element that has a `role` attribute and replace any invalid, misspelled, or non-existent ARIA role value with a valid WAI-ARIA role from the official specification.

Steps for Adobe Commerce (Magento)

  1. Via SSH or SFTP, navigate to your theme directory: `app/design/frontend/<Vendor>/<theme>/`.
  2. Search all `.phtml` and `.html` (Knockout/UI Component) template files for `role=` using: `grep -r 'role=' app/design/frontend/<Vendor>/<theme>/`
  3. Also search the base Luma/Blank theme at `vendor/magento/theme-frontend-luma/` or `vendor/magento/theme-frontend-blank/` for the original template, then override it in your custom theme rather than editing core files.
  4. Fix invalid role values in the relevant template file within your custom theme folder, or create a template override if editing a core/vendor template.
  5. For issues in JavaScript UI components (`.html` KO templates under `Magento_*/view/frontend/web/template/`), locate and override the component template in your theme.
  6. Run `bin/magento cache:clean` and `bin/magento setup:static-content:deploy`, then verify with axe DevTools.
Official Adobe Commerce (Magento) documentation ↗
<!-- ❌ INVALID — role value does not exist in WAI-ARIA spec -->
<div role="card">Featured Product</div>
<nav role="navagation">...</nav>
<div role="flyout">...</div>

<!-- ✅ VALID — use correct WAI-ARIA role or native HTML element -->
<div role="region" aria-label="Featured Product">Featured Product</div>
<nav>...</nav>  <!-- <nav> has implicit role="navigation" — no role attr needed -->
<div role="dialog" aria-modal="true" aria-label="Quick view">...</div>

What is aria roles?

ARIA roles are special HTML attributes (e.g., `role="button"`) that tell screen readers and other assistive technologies what an element *is* and how it should behave. The WAI-ARIA specification defines a strict list of allowed role values — words like `button`, `navigation`, `dialog`, `alert`, `banner`, etc. An invalid ARIA role means you've used a value that doesn't exist in that list (for example, a typo like `role="navagation"`, an invented word like `role="card"`, or an outdated value). When a role is invalid, assistive technology simply ignores it, stripping away the accessibility context you intended to provide. WCAG Success Criterion 4.1.2 (Name, Role, Value) requires that all user interface components have roles that can be understood by assistive technology.

Screen reader users — who are often customers with visual impairments — rely entirely on ARIA roles to understand your page's structure and interactive elements. An invalid role means a screen reader may announce an element incorrectly (e.g., as plain text instead of a button), or skip it entirely, making menus, modals, forms, and key navigation landmarks unusable. This creates a direct barrier for disabled shoppers, exposes your store to legal risk under laws like the ADA (US), AODA (Canada), EAA (EU), and UK Equality Act, and can result in costly litigation or regulatory complaints. Google also uses accessibility signals as part of its quality assessments, so pages with broken ARIA markup can underperform in organic search compared to well-structured competitors.

See the complete Aria roles guide for every platform and the full background.

Not sure if your Adobe Commerce (Magento) store has this?

Run a free SEOLZ audit — we’ll find aria roles and every other issue across your whole site.

Scan my site free

Fix aria roles on another platform