Elements with visible text labels do not have matching accessible names

How to fix the label-content-name-mismatch accessibility rule. Headings and landmarks.

The message you saw

Lighthouse and PageSpeed Insights
Elements with visible text labels do not have matching accessible names.
axe-core, axe DevTools and this checker
Elements must have their visible text as part of their accessible name (rule label-content-name-mismatch)

Lighthouse runs axe-core inside it, so both are the same check, and the fix below works whichever tool showed you the message.

What it means

A button or link can have two names: the text you see, and an accessible name set with aria-label or aria-labelledby, which replaces the visible text for assistive technology. This message means the accessible name doesn’t contain the visible text. For example, a button showing “Send” has aria-label="Submit form".

WCAG 2.5.3 Label in Name asks that the visible words are part of the accessible name, ideally at the start. axe checks controls that have both visible text and an aria-label or aria-labelledby, and compares the words, ignoring case and punctuation.

Who is affected

The control's visible text isn't part of its accessible name (usually an aria-label replaced it). Voice-control users say what they see, and nothing happens.

Voice-control users (Dragon, Voice Control on Mac and iPhone, Voice Access on Android) press buttons by saying what they see: “click Send”. If the button’s name is “Submit form”, nothing happens. Screen-reader users who can partly see the screen also get confused when the spoken name doesn’t match the words in front of them.

How to find it

  1. Run the checker: each case shows the visible text and the accessible name.
  2. Search for aria-label on elements that already have text inside. Often the aria-label was added for SEO or by a component library default.

How to fix it

  1. Usually the best fix is to remove the aria-label, so the visible text becomes the name.
  2. If you need extra context for screen readers, start the aria-label with the visible words and add to the end: visible “Read more”, aria-label “Read more about pricing”.
  3. Or keep the visible text as the name and give the extra context with aria-describedby.

Examples

Button with a different aria-label

Before

<button aria-label="Submit form">Send</button>

After

<button>Send</button>

Adding context, keeping the visible words first

Before

<a href="/pricing" aria-label="Pricing details">Read more</a>

After

<a href="/pricing" aria-label="Read more about pricing">Read more</a>

Common mistakes

WCAG success criteria

When this rule fails, the page fails:

Check your fix

Scan a web page and the report lists every element that fails this rule, with screenshots outlining where they are, the code, and a selector you can paste into your browser’s developer tools. Scan again after your change: when the rule no longer appears under the problems, the fix worked.

An automated pass means this rule found nothing wrong. It doesn’t prove the page is accessible: some of what WCAG asks for needs a person to check, and the report’s manual checklist lists those steps.

Related fix guides

More detail