Skip to content
Sentinela

WordPress Accessibility Remediation: Fixing Your Theme Code, Not Adding a Widget

Published · 11 min read

WordPress accessibility remediation means changing the markup your site actually sends: the theme templates, the block or page-builder output, the plugins that add menus, sliders and forms, and the content itself. You fix WordPress accessibility issues by editing code in a child theme (or your own theme's repository), testing on a staging copy, and re-testing after every update. An extra plugin that sits on top of the page doesn't change any of that.

This article covers where WordPress accessibility problems usually live, a remediation workflow, seven before/after code fixes, and what to do about third-party plugins you can't change.

Where WordPress accessibility problems usually live

A WordPress page is assembled from several layers, and each one can introduce barriers.

Theme templates. In a classic theme, files such as header.php, footer.php and template-parts/*.php produce the skip link (or lack of one), the navigation, heading levels for post titles, and the lang attribute. In a block theme, the same structure lives in HTML templates and template parts, and in changes saved through the Site Editor. A template mistake repeats on every page that uses it, which is also why fixing it is efficient.

Page builders and block markup. Elementor, Divi and the block editor (Gutenberg) each generate their own HTML. Common problems: headings chosen for their size rather than their level, icon-only buttons with no text, "Read more" links repeated down a page, and layout sections that should be landmarks but are plain divs. Most builders let you set a heading's HTML tag separately from its visual style; use that.

Plugins. Sliders, contact forms, cookie banners, mega menus, popups and social feeds all inject markup and JavaScript. Typical issues are autoplaying carousels with no pause control, form fields without labels, cookie banners that trap or skip keyboard focus, and dropdown menus that open on hover only.

Content. Missing or unhelpful alt text, skipped heading levels, vague link text such as "click here", and untagged PDFs. WordPress's own accessibility handbook has pages on alternative text, good link text and accessible PDFs, which notes that the same rules for headings, link text and image alternatives apply to PDFs as to HTML. For product imagery specifically, see How to write alt text for product images.

What WordPress itself expects

WordPress's Accessibility Coding Standards say that code integrated into the WordPress ecosystem, including WordPress core, WordPress.org websites and official plugins, is expected to conform to WCAG 2.2 at level AA. That commitment covers WordPress's own code. It doesn't cover your theme, your plugins or your content, which is where most of the issues on a typical site come from.

For themes, the WordPress.org theme directory has an accessibility-ready tag. Its required items include a skip link that is the first focusable element, becomes visible on focus and moves focus to the main content; visible keyboard focus on menus, form fields, buttons and links; and keyboard access to dropdown menus in all responsive views. The requirements were updated in May 2026 to follow WCAG more closely, adding items such as reflow, resize, text spacing, content on hover or focus, and an accessibility statement. The same post is clear that the tag means a theme meets the Accessibility team's minimum standards; it doesn't mean full WCAG AA conformance. It's a useful checklist even if your theme isn't listed in the directory.

Why an overlay plugin doesn't change your templates

Accessibility overlay plugins add a script that runs in the visitor's browser after the page loads. Whatever they adjust is applied at that point, on each visit. Your PHP templates, saved block markup and plugin output stay the same on the server, and so does the HTML that any tool or browser receives before the script runs. If you want the source itself fixed, the work happens in the theme, the builder settings, the plugins and the content. We've set out our view in more detail in Why an overlay widget doesn't fix your theme.

A remediation workflow for WordPress

1. Audit

Start with automated checks to find the obvious issues fast, then test by hand: keyboard only through the main journeys (navigation, search, a contact or inquiry form, and checkout if you run WooCommerce, following our WooCommerce block checkout test), a screen reader, 200% zoom and a 320 px wide viewport. Software can point out likely failures, but automated testing is no substitute for an audit when it comes to deciding whether many success criteria are met. Automated tools only catch part of WCAG, so "no issues detected" is not the same as "meets the criterion". What a free scan finds, and what it can't explains the difference.

2. Prioritize

Fix what blocks people first: anything that stops a keyboard or screen reader user from completing a key task. Then fix template-level issues, because one change in header.php fixes every page. Content issues (alt text, headings, link text) can run in parallel, since editors can do them without touching code.

3. Child theme or parent theme?

If you use a third-party theme, put your changes in a child theme. WordPress's developer handbook explains that a child theme lets you customize a theme without modifying the parent's files, so you still receive parent updates without losing your changes. A template file in the child theme overrides the file with the same name in the parent, and the child's functions.php loads before the parent's. If you edit the parent directly, the next theme update overwrites your edits.

If the theme is your own (built by you or your agency, and nobody else ships updates to it), edit it directly, in version control.

Block themes add one wrinkle: templates you change in the Site Editor are stored in the database, and those changes are lost if you switch theme. Export your fixes into theme files so they are versioned and portable.

4. Work on staging

Make changes on a staging copy of the site, not with the theme file editor on production. Many hosts offer one-click staging; otherwise, clone the site to a separate environment. Test there, then deploy.

5. Fix and re-test

After each fix, repeat the test that found the issue (keyboard, screen reader, zoom), not just the automated scan. Check that the fix didn't break something else, such as a menu that now works with a keyboard but no longer works on touch.

6. Monitor after updates

Theme, plugin and core updates can undo fixes or add new issues. Re-scan after updates and repeat a short keyboard check of your main journeys. Keep a log of what you changed and why, so the next developer doesn't remove a fix by accident.

Seven before/after fixes

The examples assume a classic child theme named my-child-theme. Adapt selectors and file names to your theme.

wp_body_open() (WordPress 5.2+) fires right after the opening <body> tag. It doesn't create a skip link itself, but the skip link belongs immediately after it so that it is the first focusable element.

Before (header.php):

<body <?php body_class(); ?>>
<header class="site-header">

After (copy header.php into the child theme, then edit):

<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<a class="skip-link screen-reader-text" href="#main">
	<?php esc_html_e( 'Skip to content', 'my-child-theme' ); ?>
</a>
<header class="site-header">

And give the main region a matching ID. The theme handbook suggests tabindex="-1" on the target to work around a WebKit focus bug:

<main id="main" tabindex="-1">
.skip-link:focus {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 100000;
	clip: auto;
	clip-path: none;
	width: auto;
	height: auto;
	padding: 0.75rem 1rem;
	background: #fff;
	color: #1d2327;
}

Block themes: core adds a skip link automatically that targets the template's <main> element. Check your templates actually contain one (a Group block with its HTML element set to <main>).

2. Restore visible focus

Before:

a:focus,
button:focus {
	outline: none;
}

After:

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid #1a4fd6;
	outline-offset: 2px;
}

/* Keep focused items from hiding under a sticky header (WCAG 2.4.11) */
html {
	scroll-padding-top: 5rem;
}

Pick an outline color with at least 3:1 contrast against the surrounding background (WCAG 1.4.11), and set scroll-padding-top to roughly your sticky header's height.

3. Make submenus work with a keyboard

The theme handbook gives "dropdown menus hidden with display: none and shown on :hover" as a failing example, because keyboard users can't open them. The W3C disclosure navigation pattern uses a button with aria-expanded instead.

Before:

.main-navigation .sub-menu { display: none; }
.main-navigation li:hover > .sub-menu { display: block; }

After (js/nav.js in the child theme):

document.querySelectorAll('.main-navigation .menu-item-has-children').forEach((item, i) => {
  const link = item.querySelector(':scope > a');
  const submenu = item.querySelector(':scope > .sub-menu');
  if (!link || !submenu) return;

  submenu.id = submenu.id || `submenu-${i}`;

  const button = document.createElement('button');
  button.type = 'button';
  button.className = 'submenu-toggle';
  button.setAttribute('aria-expanded', 'false');
  button.setAttribute('aria-controls', submenu.id);

  const label = document.createElement('span');
  label.className = 'screen-reader-text';
  label.textContent = `${link.textContent.trim()} submenu`;
  button.append(label);
  link.after(button);

  button.addEventListener('click', () => {
    const open = button.getAttribute('aria-expanded') === 'true';
    button.setAttribute('aria-expanded', String(!open));
  });

  item.addEventListener('keydown', (event) => {
    if (event.key === 'Escape' && button.getAttribute('aria-expanded') === 'true') {
      button.setAttribute('aria-expanded', 'false');
      button.focus();
    }
  });
});
.main-navigation .sub-menu { display: none; }
.main-navigation .submenu-toggle[aria-expanded="true"] + .sub-menu { display: block; }
.main-navigation .submenu-toggle::after { content: "\25BE"; } /* visual arrow only */

Load it from the child theme's functions.php:

add_action( 'wp_enqueue_scripts', function () {
	wp_enqueue_script(
		'my-child-theme-nav',
		get_stylesheet_directory_uri() . '/js/nav.js',
		array(),
		'1.0.0',
		array( 'in_footer' => true )
	);
} );

If your parent theme already ships its own menu script, adapt that instead of adding a second one. Test the result on touch devices and in the mobile menu too.

4. Label form fields

A placeholder is not a label: it disappears when someone types and isn't reliably announced. In Contact Form 7, a common pattern is placeholder-only fields.

Before (Contact Form 7 form editor):

[text* your-name placeholder "Your name"]
[email* your-email placeholder "Your email"]

After:

<label> Your name (required)
    [text* your-name autocomplete:name] </label>

<label> Your email (required)
    [email* your-email autocomplete:email] </label>

The autocomplete values help browsers fill the fields and support WCAG 1.3.5 Identify Input Purpose. Contact Form 7's own FAQ notes that its default labels are limited and points to an add-on for fuller label support (vendor source).

For the core comment form, comment_form() outputs a label for each default field. If your comment form has no visible labels, look for a theme function hooked to comment_form_default_fields that replaced them with placeholder-only inputs, and remove or correct it in the child theme.

Before:

<a href="https://www.instagram.com/example/">
  <svg viewBox="0 0 24 24"><path d="…"/></svg>
</a>
<button type="submit" class="search-submit"><i class="icon-search"></i></button>

After:

<a href="https://www.instagram.com/example/">
  <svg viewBox="0 0 24 24" aria-hidden="true"><path d="…"/></svg>
  <span class="screen-reader-text">Instagram</span>
</a>
<button type="submit" class="search-submit">
  <i class="icon-search" aria-hidden="true"></i>
  <span class="screen-reader-text">Search</span>
</button>

WordPress core ships a .screen-reader-text class pattern, and most themes include its CSS. Check yours does before relying on it.

6. Fix heading levels in templates

A common template bug: every post title in an archive is an <h1>, or the site title is an <h1> on every page. The accessibility handbook's content checks ask for one H1 per page and no skipped levels.

Before (template-parts/content.php):

<h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>

After:

<?php
if ( is_singular() ) {
	the_title( '<h1 class="entry-title">', '</h1>' );
} else {
	the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '">', '</a></h2>' );
}
?>

Check widget titles too: register_sidebar() takes before_title and after_title, and a <span> styled as a heading isn't one.

7. Respect reduced-motion settings and let people pause sliders

Before: CSS transitions and animations run regardless of user settings, and a hero slider autoplays.

After:

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

This follows W3C technique C39. Strictly, 2.3.3 Animation from Interactions is a Level AAA criterion, so this is good practice rather than an AA requirement. The AA-relevant part is the slider: content that moves automatically for more than five seconds needs a way to pause, stop or hide it (WCAG 2.2.2, Level A). The CSS above doesn't stop JavaScript-driven sliders, so turn off autoplay in the slider's settings or make sure it has a visible pause button.

Third-party plugins you can't change

Some plugin output can't be fixed from your theme, or can only be patched in fragile ways that break on the next update. You have three options:

  1. Replace it. Look for an alternative that meets your needs and test it with a keyboard and screen reader before switching. Often the simplest fix is to drop the feature altogether, such as an autoplaying slider.
  2. Report it to the vendor. Give the plugin developer the WCAG criterion, the steps to reproduce and the affected markup. For free plugins, use the plugin's support forum on WordPress.org.
  3. Document it. List the known issue, its impact and your workaround (for example, "contact us by email or phone") in your accessibility statement, and review it when the plugin updates.

Some plugins offer template overrides or filters, which let you change their output from the child theme. Use them where they exist, and record them in your change log, because they need checking whenever the plugin updates.

How Sentinela fits in

For WooCommerce stores, Sentinela's remediation is quoted after an audit and done on a staging copy of the site, in a child theme. Nothing is published before you approve it; after publishing, we re-scan production and send a before-and-after report. Third-party plugins and content added later are outside the fixed scope. See /remediation and /audit for details.

Scans and audits also work on WordPress sites that don't run WooCommerce (Sentinela for WordPress). The WordPress report says how to fix each issue: content such as alt text, headings, link text and form labels in the editor, template issues in a child theme, and plugin issues through an update or the plugin's settings first. It recognizes your page builder (Elementor, Divi, WPBakery or the block editor) and says where its fixes are made. Fixes on WordPress are coming: in a child theme, your page builder or plugin settings, never in WordPress core. Until then, the workflow in this article is how you or your developer make those fixes.

Monitoring scans ($29, $79 or $149 a month) work on any public website, at the prices on /pricing. Care Plans, which include plugin and theme updates, are for online stores on Shopify and WooCommerce; see /care.

Sources