How to fix: invalid aria values
WCAG 2.2 success criterion 4.1.2 (level A)
Why it matters
Screen readers may announce wrong states or ignore the element.
How to fix
Check that ARIA attributes have allowed values and that referenced ids exist.
<button aria-expanded="false" aria-controls="menu">Menu</button>
<ul id="menu">…</ul>
Test it yourself
- Inspect the element: ids in aria-labelledby, aria-describedby and aria-controls must exist on the page, and true/false values must be spelled exactly.
Common mistakes
- aria-controls pointing to a menu id that changed when the theme was updated.
- aria-expanded="yes" instead of "true".
Check your own site
Find this and other problems on your website in 30 seconds, free.