Tab Order Modified Using the Tabindex Attribute

Tab Order Modified Using the Tabindex Attribute

WCAG Focus: WCAG 2.4.3 (A)

Developers sometimes add positive tabindex attributes (such as tabindex="1" or tabindex="5") to WordPress search bars, newsletter inputs, or buttons in an effort to prioritize them. In practice, any positive tabindex overrides the natural DOM reading order—jumping keyboard users erratically around the page before visiting normal elements.

Why This Pattern Violates WCAG

WCAG 2.4.3 Focus Order (Level A) requires that focusable components receive focus in an order that preserves meaning and operability.

Positive tabindex values force the browser to visit tabindex="1", "2", "3" across the entire document first, then return to elements without positive tabindex—creating a disorienting sequence that contradicts visual layout and screen reader reading order.

Code Comparison

Inaccessible Positive Tabindex

<input type="search" name="s" tabindex="1" aria-label="Search site">
<button type="submit" tabindex="2">Search</button>

Compliant Natural DOM Order (No Positive Tabindex)

<input type="search" name="s" aria-label="Search site">
<button type="submit">Search</button>

How to Fix It in WordPress

  • Remove all positive tabindex values (tabindex="1" and above).
  • Reorder elements in your HTML or Gutenberg layout so visual order matches DOM source order.
  • Use only tabindex="0" (for custom interactive widgets) or tabindex="-1" (for programmatic focus targets like modal containers).

Finding This Issue Automatically

Positive tabindex attributes frequently sneak in through form plugins, page-builder widgets, and custom header templates. With the WP ADA Compliance Check plugin, you can locate manually set tabindex attributes across your WordPress site—and its automated filters will automatically fix the issue by removing tabindex attributes that have been manually set.

Subscribe

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

Cart Accessibility Tools
hide