Fix guide · Visible text doesn't match the name

How to fix “Elements must have their visible text as part of their accessible name”

By · Updated

A link or button shows one set of words but has an aria-label that says something else. Make the aria-label include the visible words, ideally at the start, or remove it and let the visible text be the name.

axe rule
label-content-name-mismatch
WCAG
2.5.3 Label in Name (Level A)
Lighthouse
Google Lighthouse and PageSpeed Insights report it as “Elements with visible text labels do not have matching accessible names.”

What it means

Voice control users click by saying what they see. If a button shows "Get a quote" but its aria-label says "Open contact form", saying "click get a quote" does nothing, because the computer only knows the hidden name.

W3C's Label in Name criterion asks that the visible words are part of the name, and calls it best practice to put them at the start.

Who it affects

People who use voice control software, and screen reader users who can see part of the screen and hear a different name than they read.

How to find it

  1. Run the free checker. It lists each element, and the code shows both the aria-label and the visible text.
  2. Look at header buttons with icons plus text, like phone and email buttons.

How to fix it

  1. If the visible text already says what the control does, remove the aria-label.
  2. If you need extra context, start the aria-label with the visible words and add after them: visible "Read more", name "Read more about overtime pay".

A phone button

Before · fails
<a href="tel:+15555550100" aria-label="Call Us">
  <i class="icon-phone"></i> (555) 555-0100
</a>
After · fixed
<a href="tel:+15555550100">
  <i class="icon-phone" aria-hidden="true"></i> (555) 555-0100
</a>

The visible phone number now is the name, so saying it works. If you'd rather add "Call", use aria-label="(555) 555-0100, call us".

From a real fix

The law firm site I fixed had a header phone button labeled "Call Us" in code while the screen showed the phone number. It was in the header, so it failed on every page. Removing the aria-label, so the visible number became the name, fixed it.

What a scanner can and can’t tell you

Fixing this clears one automated check. It doesn’t mean the page is accessible, and it doesn’t settle any legal question. Automated tests catch only part of the problems. W3C puts it plainly: evaluation tools “can not determine accessibility, they can only assist in doing so.” The rest takes a person working through the site with a keyboard and a screen reader.

Source: W3C WAI, Selecting Web Accessibility Evaluation Tools. Not legal advice.

Sources

All checked November 8, 2026. The rule wording is axe-core 4.14.0’s own.

Related fixes

Every fix guide →

Check a page for free

Scan any page of your site against WCAG 2.1 AA in about 30 seconds. You get the problems automated testing finds, in plain words, with a link to a fix guide for the common ones.

Run the free checkno sign up · one page at a time

Rather have someone fix it for you? Tell me about your site.