WordPress fix

Before and after

Broken — before
/* Broken WordPress theme.json / child-theme style.css */
.entry-meta,
.wp-block-post-date {
  color: #9ca3af; /* 2.43:1 on #f9fafb — fails WCAG 1.4.3 */
  font-size: 0.875rem;
}

.woocommerce a.button.alt,
.wp-block-button__link {
  background-color: #38bdf8;
  color: #ffffff; /* 2.14:1 — fails WCAG 1.4.3 */
}
Fixed — after
/* Fixed WordPress theme.json palette + child-theme style.css */
:root {
  --wp--preset--color--muted-ink: #475569; /* 7.58:1 on #ffffff */
  --wp--preset--color--brand-cta: #0369a1; /* 5.93:1 with #ffffff */
}

.entry-meta,
.wp-block-post-date {
  color: var(--wp--preset--color--muted-ink);
  font-size: 0.875rem;
}

.woocommerce a.button.alt,
.wp-block-button__link {
  background-color: var(--wp--preset--color--brand-cta);
  color: #ffffff;
}
Live preview

Fixed vs. broken example

Passes color-contrastContrast: 7.58:1 body / 5.93:1 CTA (Passes 4.5:1 AA)
Accessibility tree: paragraph "Free shipping..." (#475569 on #ffffff = 7.58:1 PASS AAA) · button "Add to Cart" (#ffffff on #0369a1 = 5.93:1 PASS AA)

Inspect the foreground and background colors in Chrome DevTools Color Picker to verify the live WCAG AA (4.5:1 normal text, 3:1 large text) contrast badges.

Automated test

Playwright + axe-core check

tests/a11y-color-contrast.spec.ts
import { test, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";

test("WordPress post archive & WooCommerce CTA pass color-contrast", async ({ page }) => {
  await page.goto("/shop/");
  const results = await new AxeBuilder({ page })
    .withRules(["color-contrast"])
    .analyze();
  expect(results.violations).toEqual([]);
});

Template deduplication tip

A single low-contrast .entry-meta or .woocommerce a.button rule in style.css repeats across thousands of /blog/* and /product/* URLs. A11yDrift's template fingerprinter rolls every post violation into one root WordPress stylesheet fix.

Who this affects

Low-vision readers, older users with presbyopia, people with color-vision deficiencies, and anyone viewing a screen in bright sunlight struggle or fail to read muted gray captions, pale badges, and low-contrast CTA buttons.

NVDA & VoiceOver transcript

Screen readers announce the same copy for both versions; this rule primarily impacts low-vision readers, screen magnifiers, and visual legibility.

NVDA (Windows)

Broken

Screen readers still speak "Free shipping on orders over $75" and "Add to Cart, button", but screen magnifier and low-vision users cannot visually locate or read the faded copy and pale blue button.


Fixed

Screen readers announce "Free shipping on orders over $75" and "Add to Cart, button", while sighted low-vision and ZoomText users clearly distinguish both the 7.58:1 body copy and 5.93:1 CTA.

VoiceOver (macOS / iOS)

Broken

VoiceOver speaks "Add to Cart, button", yet users combining VoiceOver with Zoom or macOS Increase Contrast experience severe glare washout on the 2.14:1 sky-blue fill.


Fixed

VoiceOver speaks "Add to Cart, button", and the 5.93:1 darkened surface stays legible across macOS Zoom, mobile sunlight, and high-brightness displays.

Common questions

How do I lock Gutenberg editors into accessible colors in WordPress?
Define an audited color palette in theme.json under settings.color.palette and set custom: false (or constrain presets) so content authors pick pre-verified foreground/background pairs.
Why do WooCommerce notices and 'Sale!' badges often fail axe-core contrast?
Default WooCommerce skins frequently place white text on bright lime or cyan .onsale pills. Override .woocommerce span.onsale in your child theme with a darkened fill like #047857 (5.48:1 with #ffffff).
Does Gutenberg's built-in editor contrast warning catch every issue?
No—it only checks inline block color combinations inside the post editor, missing theme header links, plugin widgets, WooCommerce templates, and text overlaid on background images.