Duplicate Skip Nav IDs

Duplicate Skip Nav IDs

WCAG Focus: WCAG 2.4.1 (A), 1.3.1 (A), 4.1.2 (A)

When a parent theme template and a page-builder layout or plugin both inject a container with id="content" or id="main", activating the skip link lands keyboard focus on the wrong element—or fails completely because browsers stop at the first matching ID.

Why This Pattern Violates WCAG

HTML requires every id attribute on a page to be unique. Duplicate skip-link target IDs break WCAG 2.4.1 Bypass Blocks (Level A) by sending keyboard focus to an empty wrapper or header div instead of the actual main content.

Code Comparison

Duplicate Skip Target IDs on Page

<a href="#content" class="skip-link">Skip to content</a>
<div id="content" class="header-spacer"></div>
<main id="content"><h1>Real Article</h1></main>

Single Unique Target ID on Main Landmark

<a href="#main-content" class="skip-link">Skip to content</a>
<div class="header-spacer"></div>
<main id="main-content" tabindex="-1"><h1>Real Article</h1></main>

How to Fix It in WordPress

  • Inspect rendered page HTML for multiple occurrences of the skip link’s #target ID.
  • Ensure only the primary <main> element uses that unique ID.

Finding This Issue Automatically

Mixing parent theme headers with third-party page builders is the number-one cause of duplicate skip-nav IDs. The WP ADA Compliance Check plugin flags duplicate skip nav IDs immediately during scans so keyboard users always jump to the real content landmark.

Subscribe

Subscribe to receive daily Web Accessibility - Did you know? articles in your inbox.

Cart Accessibility Tools
hide