Links must have text

ZMD007

Ensure every <a> element includes descriptive text to convey its purpose and destination.

✅ Good

<a href="/privacy">Read our Privacy Policy</a>

❌ Bad

<a href="/privacy"></a>

When: An <a> contains no text content

Warning: <a> tag missing link text

Solution: Add descriptive link text

Why it matters

Accessibility: Empty or generic links prevent screen-reader users from understanding link purpose :contentReference[oaicite:12]{index=12}.

SEO: Non-descriptive anchors offer no keyword context to search crawlers, reducing link value :contentReference[oaicite:13]{index=13}.

In brief

  • Goal: Make link destinations clear from the link text itself.
  • What to do: Provide concise, context-specific text inside each <a>; avoid empty anchors or vague phrases.
  • Why: Users rely on link text to decide whether to follow it; empty links provide no context.

Intent

Prevent ambiguous or empty anchors so that assistive technologies can accurately convey link purpose.

Benefits

  • Screen-reader users can list and activate links based on meaningful descriptions :contentReference[oaicite:8]{index=8}.
  • Keyboard-only users understand where each link leads without surrounding context :contentReference[oaicite:9]{index=9}.
  • Search engines index link text as part of page relevance signals, boosting SEO :contentReference[oaicite:10]{index=10}.

Techniques

  • H30: Use <a> element text that clearly describes its target per WCAG 2.4.4.
  • G203: Ensure anchor text provides enough context to stand on its own.

HTML Semantics

The anchor’s text content becomes the element’s accessible name; it must describe the hyperlink’s function or target :contentReference[oaicite:11]{index=11}.

Tips & edge cases

  • Avoid vague texts like “click here” or “learn more”; instead, describe the destination :contentReference[oaicite:14]{index=14}.
  • Use unique link text for different links—even if they point to the same URL—to reduce confusion :contentReference[oaicite:15]{index=15}.
  • For icon-only links, pair aria-labelledby with visible text elsewhere rather than aria-label :contentReference[oaicite:16]{index=16}.