Fix link-name in WordPress
WordPress themes frequently render <a href='<?php the_permalink(); ?>'> around a featured image whose Media Library alt field is blank, or output bare FontAwesome social links in footer.php. Including .screen-reader-text with the_title() or an explicit aria-label guarantees every anchor has discernible text.
Before and after
<?php // footer.php (Broken WordPress social icon link) ?>
<a href="https://github.com/example" class="social-link">
<i class="fa-brands fa-github"></i>
</a><?php // footer.php (Fixed WordPress social link with .screen-reader-text) ?>
<a
href="https://github.com/example"
class="social-link"
rel="noopener noreferrer"
>
<i class="fa-brands fa-github" aria-hidden="true"></i>
<span class="screen-reader-text"><?php esc_html_e( 'Visit our GitHub profile', 'mytheme' ); ?></span>
</a>Fixed vs. broken example
Open the VoiceOver Web Rotor (Control+Option+U) or NVDA Elements List (NVDA+F7) to confirm every icon anchor shows a clear destination label.
Playwright + axe-core check
import { test, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";
test("WordPress header, archive, and footer links pass axe-core link-name", async ({ page }) => {
await page.goto("/");
const results = await new AxeBuilder({ page })
.withRules(["link-name"])
.analyze();
expect(results.violations).toEqual([]);
});Template deduplication tip
An unlabeled icon link in footer.php or empty thumbnail link in archive.php generates violations across every category, tag, and post page. A11yDrift condenses those into one WordPress template cluster.
What NVDA and VoiceOver announce
Screen-reader users routinely pull up a rotor or links list to jump straight to destinations. Bare icon anchors, empty product-image wrappers, or unlabeled social links appear as meaningless raw URLs or blank entries.
NVDA (Windows)
"link, #social-demo" (raw href fragment read verbatim)
"View A11yDrift on GitHub, link"
VoiceOver (macOS / iOS)
"link" (or raw URL path)
"View A11yDrift on GitHub, link"
Common questions
Why does WordPress's featured-image link fail link-name on archive pages?
Do Gutenberg's core Social Icons blocks pass axe-core link-name?
What if a WordPress 'Back to Top' anchor only contains an arrow icon?
Test a URL for link-name
Enter any public URL for a free WCAG 2.2 AA check—no account or credit card required.
Managing WordPress client sites? Monitor 15 sites on one flat plan with white-label portals and branded executive PDFs—$1,140/yr ($95/mo billed annually, 24-month rate lock + onboarding) for Founding 10 agencies.