Skip to main content

"Links must have discernible text": how to fix empty links on your website

Published · Updated

“Links must have discernible text” is the error you’ll see in axe. Lighthouse calls it “Links do not have a discernible name”, WAVE calls it “Empty link”, and the Tabwise scan calls it “Links with no readable name”. They all mean the same thing.

An empty link is a link with no words in it, like a little Facebook icon or your logo. You can see where it goes. Someone who can’t see the screen gets told “link” and nothing else.

It’s a common accessibility problem. Six in ten Irish business websites we tested (61% of 6,576) had at least one empty link. It was the second most common problem in every study we’ve run.

What a screen reader user hears

A screen reader is software that reads the page aloud. Blind people and many people with low vision use one on their phone or computer.

When it reaches a link, it reads out the link’s name. For a text link, that’s the words you can see, like “Opening hours”. For an icon or image with no name, it says “link”, or reads out a jumble of the web address.

Imagine your footer read aloud as “link, link, link, link”. Nobody can tell which one is your Instagram page and which one is the phone number.

Who this affects

  • People using screen readers, who hear “link” with no clue where it goes.
  • People using voice control, who move around a page by saying the name of a link out loud. “Click Facebook” doesn’t work if the link has no name.
  • Search engines. Google reads the name of a link to learn what the page it points to is about.

Why it happens on so many sites

Four things cause most of it:

  • Social media icons in the footer. A row of little Facebook, Instagram and TikTok logos with no text behind them.
  • The logo. Your logo usually links to your homepage. If the logo image has no alt text (a written description of the image), the link has no name. Our guide on how to write alt text explains what alt text is.
  • Slideshow arrows. The little arrows on a homepage slideshow or product carousel.
  • The cart or basket icon. Often a picture of a bag with a number on it, and nothing that says “Basket”.

In our study of Irish online shops, 66% of 2,385 had empty links, partly because shops have more icons. Among local services it was 58% of 5,794.

How to fix it

The fix is the same everywhere: give each icon or image link a short name that says where it goes. “Our Facebook page”. “Home”. “Basket”.

Most website builders have a field for this. It might be called alt text, label, text or accessible name.

Shopify

Your logo is an image in your theme’s header. To add it, open the theme editor, click the header section, then edit the logo image. Shopify’s guide to adding alt text to theme images has the details. Use your business name.

Social icons, the cart icon and slideshow arrows usually come from your theme. Look in the theme settings for a label field. If there isn’t one, contact your theme’s developer, then run our free scan again once they’ve fixed it.

WordPress and WooCommerce

If you use the WordPress Social Icons block, click each icon and fill in its Text setting. The Social Icons block guide shows how. You can choose to show the text or keep it hidden. Screen readers get it either way.

For a logo or any image that’s a link, add alt text in the image’s settings. Social icons added by your theme or a plugin are up to that theme or plugin. Look for a label field in their settings, or ask their developer.

Wix

For any image that links somewhere, click it, open Settings and fill in “What’s in the image?”. For a linked image, describe where it goes, like “Home” or “Book a table”.

Wix’s Accessibility Wizard can scan your site and list problems for you. If it flags icons that have no field to fix them, contact Wix support.

Squarespace

Add alt text to your logo and any linked image blocks. For an image block, open the block’s settings and use the “Image alt text” field.

If our scan flags social icons or the cart icon and you can’t find a field to name them, contact Squarespace support. Tell them which icons are affected, and run the free scan again after they reply.

If someone else built your site

Copy this and send it to your web person:

Our website has links with no accessible name, which fails WCAG 2.1 AA (success criteria 2.4.4 and 4.1.2). Please give every icon and image link a name that says where it goes: the logo, social media icons, slideshow arrows and the cart icon. Can you send me a list of what you changed?

Google says that when an image is a link, it uses the image’s alt text as the link text. So naming your image links helps Google understand your site a little better too.

It won’t move you to the top of the results. But it costs nothing, and it’s the right thing to do anyway.

How to check it’s fixed

Run our free scan again. It lists any links that still have no name. It checks your homepage and up to four pages linked from it, so check your other main pages too.

The free WAVE checker from WebAIM works on any page. Type in the address and look for “Empty link” in the results.

For your web developer

The relevant rule is WCAG 2.1 success criterion 2.4.4, Link Purpose (In Context), plus 4.1.2 for the missing name. axe reports it as link-name.

  • Icon links need an accessible name. Hide the icon itself from screen readers:
<!-- Before -->
<a href="https://www.facebook.com/yourpage">
  <svg>…</svg>
</a>

<!-- After -->
<a href="https://www.facebook.com/yourpage" aria-label="Our Facebook page">
  <svg aria-hidden="true" focusable="false">…</svg>
</a>
  • A visually hidden text span works just as well as aria-label, and survives automatic translation better.
  • A linked logo needs alt text on the image: <img src="logo.png" alt="Your Business Name, home">.
  • Check carousel arrows, cart links and “back to top” links. If a control does something on the page instead of going somewhere, it should be a <button>, not a link. See our guide to buttons with no name.

Check your own website for free

We'll scan your homepage and a few key pages and email you a plain-English report in minutes.

Free Report by email in minutes Privacy