Skip to main content

Links & buttons

Link does not go anywhere

WCAG 2.2 success criterion 4.1.2 Name, Role, Value (Level A)

WCAG 2.2
4.1.2 Name, Role, Value
Level
A
Default severity
Needs review
Available in
Free

Why it matters

Links that act as buttons (href="#" or javascript:) confuse screen reader users, who expect a link to go somewhere. Clickable elements with no href cannot be reached with the keyboard at all.

Who it affects: Screen reader users who browse by a list of links, keyboard users, and people using voice control who say a link's words to click it.

What Lumtera flags

Links whose href is "#" or a javascript: address, and anchors with click handlers but no href.

Check ID link-fake — use it to filter the content report or with wp lumtera issues --rule.

How to fix it in WordPress

If it takes the visitor to another page or section, give it a real URL. If it performs an action (opens a menu, plays a video), use a Button block or <button> element instead, which works with Enter and Space and is announced as a button.

Example

Flagged
<a href="#" onclick="openMenu()">Menu</a>
Fixed
<button type="button" aria-expanded="false" aria-controls="menu">Menu</button>

How to check your fix

  1. Update the post. The issue disappears from the Accessibility sidebar on the next check, and from the site report on the next scan.
  2. Press Tab through the page. Every link and button should receive visible focus, and its text should make sense read on its own.

Find this issue across your whole site

Lumtera runs this check in the block editor sidebar as you write, in the Elementor panel, in Review mode on the live page, and across the whole site in the content report and with wp lumtera scan. You can change its severity or turn it off in Accessibility → Settings.

All checks

Start with the free plugin today

All 64 checks, the editor sidebar, Elementor panel and site report — free, with no account and no page limits.