Skip to content
WordPressRule: aria-required-attr•Reviewed Oct 2026

Include all required ARIA attributes for custom widgets in WordPress

Elements using custom ARIA roles (e.g. `checkbox`, `combobox`, `slider`) must include all mandatory attributes.

What's wrong

Omitting required attributes like `aria-checked` on `role="checkbox"` causes assistive technologies to malfunction.

Who it affects

Screen reader users cannot tell whether a filter is selected or what range a slider represents.

How to fix on WordPress

Verify theme tab scripts or accordions output required attributes like `aria-selected` and `aria-controls`.

Code example

Problematic Code
PHP
<div role="slider" class="price-slider"></div>
Recommended Accessible Code
PHP
<div
  role="slider"
  aria-valuemin="0"
  aria-valuemax="1000"
  aria-valuenow="<?php echo esc_attr( $current_price ); ?>"
  tabindex="0"
  class="price-slider"
></div>

How to check your fix

Validate custom controls with axe DevTools to confirm all required ARIA attributes are present and dynamically updated.

Check if your site has this issue

Scan any public store page free against WCAG 2.2 AA in 30 seconds.

Your session has ended

Sign in again to carry on. Anything you typed on this page is kept.

Signed in another way? Use another method (opens a new tab)