Give every link a name that says where it goes

Links must have discernible text is the message for axe's link-name rule, and it means a link has no accessible name, so screen reader users can't tell where it goes. It happens when a link's only content is an icon, an image with no alt text, or text hidden from assistive technology. Give each of those links words for its destination, through visible text, the image's alt text or an aria-label on the link.

Empty link examples and their fixes

FailsPasses
<a href="/"><img src="logo.svg"></a><a href="/"><img src="logo.svg" alt="Yoursite home"></a>
<a href="/cart"><svg> … </svg></a><a href="/cart" aria-label="Cart"> <svg aria-hidden="true"> … </svg></a>
<a href="/help"><i class="icon"></i></a>The same link with aria-hidden="true" on the icon and a <span class="sr-only"> holding the word Help after it
<a href="/blog"><img src="b.png" alt=""></a>The same link with alt="Our blog" on the image, or visible text inside the link

What gives a link its name, and what hides it

  • Text inside the link

    The words between the opening and closing tags, including the alt text of any image inside. Prefer this name, because sighted visitors see the same words.

  • An aria-label or aria-labelledby

    Either one replaces the link's content as its name. They suit icon links, and when the link also shows words, those words belong in the name too.

  • Text hidden with CSS or ARIA

    Text inside display: none or aria-hidden isn't read, so a link whose only text is hidden that way has no name. Off-screen text from a visually hidden class still counts.

  • A title attribute

    axe accepts a link's title as its name, but W3C's naming guide treats title as a fallback and recommends naming the link directly instead.

Deque's link-name rule lists what hides link text, and W3C's names and descriptions guide ranks the ways to name an element.

Write link names that make sense out of context

  • WCAG's Link Purpose (In Context) asks that a link's purpose be clear from its text, or from that text together with the paragraph, list item or table cell around it. A link called Read more passes axe, which only confirms that a name exists, but ten of them on one page all sound alike to someone listening.

  • For a logo, name the destination rather than the picture, as W3C's functional images tutorial does with W3C home. Leave out the word link: the naming guide says not to put the role in the name, since screen readers announce it already.

How to fix an empty link

  1. Locate the linkUse the selector in the result to find it. Check headers, footers and rows of social icons first, since a template repeats those links on every page.
  2. Decide what the link should sayName where it goes, such as Cart, Instagram or Yoursite home. Links that go to the same place should share the same name.
  3. Add the name the simplest wayPrefer visible text. For an image link, write alt text. For an icon, put an aria-label on the link or visually hidden text inside it, and hide the icon itself from screen readers.
  4. Delete links that go nowhereAn anchor left behind by a template with no destination worth naming should be removed rather than labeled.
  5. Listen to the links togetherRerun axe, then open a screen reader's list of links on the page. Every entry should say where it leads without the text around it.

Frequently asked questions

Is an empty alt attribute on a linked image an error?

Yes, when the image is the only thing in the link. An empty alt hides the image from screen readers and leaves the link with no name, which W3C lists as failure F89. Use alt="" only when text inside the same link already names it.

Should an icon link use aria-label or hidden text?

Both pass, and W3C's naming guide prefers visible text over either. If the link shows any words, WCAG's Label in Name asks that its name contain them, ideally at the start, so someone using speech recognition can activate it by saying what they see.

How common are empty links?

WebAIM's 2026 Million report found empty links on 46.3% of the top million home pages. It also found that one in four linked images had no alt text, and that linked images made up 45% of all the images missing it.