Ensuring Skip Links Across WordPress Themes
23K reputation · 11 Sept 2022, 02:26 UTC
Goal
We want to guarantee that every page served by a WordPress site provides a functional skip link so that keyboard and screen‑reader users can bypass repetitive navigation and jump directly to the main content.
Constraints
Twenty Twenty‑Three ships with a <a href="#content">Skip to content</a> element, whereas earlier core themes omit it. Custom Gutenberg blocks can generate non‑semantic markup, and the block toolbar sometimes traps focus on alignment controls. WordPress core does not enforce WCAG compliance for color contrast or skip links, leaving enforcement to theme developers or plugins.
Unresolved Questions
- Which strategy best guarantees the presence of a skip link on every page without requiring manual theme edits?
- Can a lightweight plugin inject the skip link into the page head or body while respecting theme wrappers and avoiding duplicate IDs?
- How can we programmatically detect and correct focus traps in Gutenberg alignment controls across all browsers?