Accessible Content Constraints
Accessible Content Constraints blocks saving content that has common accessibility errors in text and image fields, such as skipped heading levels, empty links, or images without alternative text. The rules are enforced on save, so editors can't ignore them, and they also apply to content saved through REST, JSON: API, or migrations.
Why this module
This module comes from years of accessibility remediation on large Drupal sites, mostly for universities. On project after project, audits flagged the same problems in content: tables without header cells, images without alternative text or with a file name as alt, skipped heading levels, H1s inside the body, empty links, and untitled video embeds.
Fixing them once was not enough. The same errors came back with every new page, because editors either didn't know the rules or ignored the warnings of browser checkers. We needed a way to prevent them from being saved at all, not only to find them in the next audit. This module enforces those rules on save.
Features
Rules are enabled per field. Each one checks a clear WCAG failure:
- Heading levels in order: no skipped level, such as H2 followed by H4, with a configurable starting level (WCAG 1.3.1).
- No H1 headings: the page title is the H1 (1.3.1).
- No empty headings (1.3.1, 2.4.6).
- No links without text: a link needs an accessible name from its text,
aria-label,aria-labelledby,title, or an image with alt text (2.4.4, 4.1.2). - Images have an alt attribute:
alt=""is allowed for decorative images (1.1.1). - Alternative texts are not file names or generic words, such as
IMG_1234.jpgor "image". Also checked image fields, media image fields, and alt overrides of embedded media (1.1.1). - Tables have header cells and no empty header cells (1.3.1).
- Embedded frames have a title:
<iframe>elements such as videos and maps (4.1.2).
All the errors of a field are reported at once, with the offending text, as a list on the entity form.
Typical use cases: university, government, and other sites that must meet WCAG 2.x AA, ADA or Section 508, where accessibility audits require that known errors never reach production.
Post-Installation
There is no global settings page. Rules are enabled per field:
- Go to "Manage fields" of an entity bundle, for example, Structure » Content types » Article » Manage fields.
- Edit a text (formatted), text (formatted, long), text with summary, or image field.
- Open "Accessibility constraints", enable the rules to enforce, and, for the heading order rule, set the starting heading level.
- Save the field settings.
The rules also apply when existing content is edited. Users with the "Bypass accessibility constraints" permission (and administrators) can save content that breaks them, for example, to save legacy content or run migrations. Test the rules with an editor account.
Additional Requirements
- Drupal 10.3 or 11
- Core Field and Text modules. Image fields are supported when the core Image module is enabled.
Recommended modules/libraries
Editoria11y, to give editors live feedback while they write, before the save is blocked.
Similar projects
- Editoria11y and CKEditor Accessibility Auditor check content in the browser and warn editors, who can ignore the warnings. This module enforces the rules on the server when content is saved. They work well together.
- Accessibility Filters hides empty headings and links when content is displayed. This module prevents them from being saved.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 1.0.0-alpha2 | Pre-release | 10–11 | Oct 7, 2026 |