AccessLens

How to fix: “Buttons must have discernible text”

Buttons with no label, explained in plain English, with the exact fix and code you can copy.

Scanner rule:
button-name
Standard:
WCAG 4.1.2 Name, Role, Value (Level A)

What this error means

A button needs a name so that assistive technology can announce what it does. A button that contains only an icon, such as a hamburger menu or an 'X', has no name. A screen reader says 'button' and nothing else, so the user has to guess.

Empty buttons were found on 30.6% of home pages in the WebAIM Million 2026 report. Source: WebAIM Million

Who it affects

Screen reader users and voice-control users, who rely on the button's name to find and press it. Without a name, 'click menu' simply does not work for them.

Where it usually hides

  • The mobile menu (hamburger) button
  • Close buttons on pop-ups, cookie banners and chat widgets
  • Search and cart icon buttons
  • Carousel arrows and play/pause buttons
  • Submit buttons written as <input type="submit"> with no value

How to fix it

  1. Find the flagged button from the scan report. It is nearly always an icon-only control.
  2. Add an aria-label that describes the action: 'Open menu', 'Close dialog', 'Search', 'Next slide'.
  3. Alternatively put visually hidden text inside the button. That also helps people who translate pages.
  4. For <input type="submit"> or type="button", set the value attribute to the label you want.
  5. Mark the decorative icon inside with aria-hidden="true" so it is not announced.

Before and after

Before

<button class="menu-toggle">
  <svg viewBox="0 0 24 24">...</svg>
</button>

Announced as just 'button'.

After

<button class="menu-toggle" aria-label="Open menu">
  <svg viewBox="0 0 24 24" aria-hidden="true">...</svg>
</button>

Announced as 'Open menu, button'.

On your website platform

Themes, page builders and plugins

Most of these buttons come from your theme or a plugin (a chat widget, cookie banner or slider). If you cannot edit the code, report the exact error to the theme or plugin author. This is a quick fix for them, and it is worth asking for.

Common mistakes

  • Using the same label ('button') for every button.
  • Making the label describe the icon ('three lines') instead of the action ('Open menu').
  • Changing the label when the state changes without updating it. A toggle that opens and closes needs a label that reflects the current state, or aria-expanded.

How to check your fix

  • Re-run a scan and confirm the flagged buttons are gone.
  • Tab to each icon button and check in Chrome DevTools (Accessibility tab) that the Name field is filled in.
  • Try voice control on a phone: say 'tap' plus the button's name and see if it works.

Is this on your site?

Run a free scan and see every page and element affected. No account needed.

Questions people ask

What is the difference between aria-label and visible text?

Visible text helps everyone, including sighted users who do not recognise an icon. Use aria-label only when the design genuinely needs an icon-only button.

Does a title attribute count as a name?

Technically it can, but support is inconsistent and it does not show on touch screens. Use aria-label or real text instead.

Keep reading

Automated scans catch only part of what WCAG covers, and fixing a scan result is not a legal guarantee of compliance. Last reviewed November 16, 2026.