Accessible design in the block editor: contrast, headings, focus, alt text

The block editor makes many accessibility basics easier, but not automatic. Practical checks for contrast, heading structure, focus and alt text.

Accessible design means people with different abilities, devices and situations can use your site. The block editor helps by producing mostly semantic markup and by centralising design choices, but it does not make a site accessible by itself. Many problems come from content and design decisions made after the theme is installed. This article walks through four areas where small habits make a large difference.

Colour contrast

Text must stand out clearly from its background. The Web Content Accessibility Guidelines (WCAG) set a minimum contrast ratio of 4.5:1 for normal text and 3:1 for large text at level AA. The same 3:1 applies to meaningful interface elements such as form field borders and focus indicators.

The best place to solve this is the palette. If every colour pair in your theme.json palette that editors can combine meets the ratios, authors cannot easily pick a poor combination. Test pairs with a contrast checker, including text over images, hover states and disabled-looking elements. Do not rely on colour alone to convey meaning: an error should say “Error” as well as turn red.

Heading structure

Screen reader users often navigate by headings, so they work like a table of contents. Use one main heading (H1) per page, normally the page title, then H2 for main sections and H3 for subsections beneath them. Choose heading levels for structure, not for size. If a heading looks too large or small, change its style rather than its level.

The editor’s List View shows the outline of a page and makes skipped levels easy to spot. Check it before publishing. Also avoid bolding a paragraph to fake a heading, and make sure headings describe the section that follows them.

Focus and keyboard use

Many people navigate with a keyboard, a switch device or voice control. Everything interactive must be reachable and operable, and the current position must be visible. Browsers provide a default focus outline, and a common mistake in custom CSS is removing it without a replacement.

  • Tab through each page and confirm the order matches the visual flow.
  • Keep a visible focus style with enough contrast against its surroundings, and style it in theme.json or your stylesheet.
  • Check menus, modals and sliders, which are the usual trouble spots, especially in third-party blocks.
  • Provide a skip link so keyboard users can jump past repeated navigation.

Alt text

Alternative text conveys the purpose of an image to people who cannot see it. Describe what the image contributes in context, not everything it contains. A photo of a team on an About page might need a short description, while a decorative flourish needs none at all. For purely decorative images, leave the alt text empty so assistive technology skips them; the Image block has a setting for this in recent versions.

Image typeAlt text approach
Informative photoShort description of what matters in context
Linked image or icon buttonDescribe the destination or action, not the picture
Chart or diagramSummarise the key finding and give the data in nearby text
Decorative imageEmpty alt attribute

Make it routine

Automated tools catch only a portion of accessibility issues, so combine them with manual checks: keyboard-only navigation, a screen reader pass on key templates, and zooming to 200 percent. Build accessible defaults into your patterns, and write short guidance for editors on headings and alt text. The W3C’s WCAG overview is the authoritative reference, and the WordPress accessibility handbook on make.wordpress.org covers practices specific to the platform.

A Greater Star

Need help with your WordPress site?

The people behind this site build and look after WordPress sites every day at A Greater Star – new sites, custom plugins, support agreements, hosting, security and speed.