Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Alt Text Validation

436 sites Security covered
View on drupal.org

This module helps improve image alt text by providing an auditable report of existing alt text and implementing customizable validation rules. It can warn editors about potential issues or prevent content from being saved until problems are resolved, ensuring better accessibility and content quality.

Introduction

This module helps prevent editors from writing bad alt text on images. This module does a few things:

  • Provide a report of all alt text attached to images for auditing purposes.
    • Filterable
    • Downloadable to CSV
    • Report generation controlled by cron or manual
    • Finds images in ALL image fields, and all text fields that support html across all entities.
  • Provide customizable rules to validate alt text against during save.
  • Server side validation of the rules against submitted alt text upon saving.
    • "Warn" rules do not prevent saving content but give warnings about any issues.
    • "Prevent" rules will not allow saving until the issues are resolved.
    • Individual rules can be turned off.
    • A main switch allows rules validation to be turned off, while still allowing to them to be used by the report,

Table of contents

  • Requirements
  • Installation & Configuration
  • Alt Text Report
  • Drush Commands
  • Launch Strategies
  • Developers and Contributors

Requirements

This module requires

Installation & Configuration

Configuration steps are minimal:

  1. Install the module as you would any other module.
  2. Go to /admin/config/content/alt-text-validation and configure to your needs.
  3. Assign permissions for administering the module and viewing the report to Roles.
  4. Go to /admin/config/content/alt-text-validation/rules to add/edit rules. Give careful thought to which rules should be "warn" and which rules should be "prevent".

Report

The Alt Text Audit report is present at Reports >> Alt Text Report (/admin/reports/alt-text-report) for properly permed users. This report is a View that can be modified if needed. It requires the Auditor job be run to populate the report. The audit report will show any occurrences of image containing fields on any entity. It also includes any html image tags found within text fields on any entity. Scroll to the bottom of the report to see the CSV icon to download a CSV of the current View.

There are three ways to initialize the report generation. Depending on the size of your site, it may be an intensive process. To populate the report you will need to either:

  1. Enable report generation via cron (/admin/config/content/alt-text-validation) - It will begin the generation with the next cron run.
  2. On the report page, there is a button to run the report using a batch process.
  3. Via Drush command.
drush alt-text-validation:queue-audit
drush cron

It uses the Queue API and may take several cron runs to fully populate the report. You can assess the progress by drush queue:list then look for atv_entity_instances The top of the report contains information about when the report was started and finished.

Drush Commands

  • drush alt-text-validation:queue-audit - this command queues up the entities to audit. It requires cron to run (perhaps more than once) to complete the audit.

Launch Strategies

There are a few possible ways to roll this module out to editors:

  • Info gathering only - Add rules, but turn off "Validate alt text on save". This will let you run the report to collect info and strategize what rules you will put in place.
  • Soft start - Create only a handful of the most important rules and turn them on as warnings. Gradually change a few rules at a time from "warn" into "prevent".
  • Hard-line - Turn it on, add a bunch of Prevent rules and turn on "Validate alt text on save". It might be painful for editors at first, but will get you to full compliance faster.

Other notes related to approaches

  • Rules can also be about content strategy rather than just accessibility. Example: Your company has an abbreviation that happens to match a state. Many screen screen readers will read 'CA' as California, rather than "C A", so you could warn people to use the full name instead of the abbreviation.

Developers and Contributors

This project uses ddev-drupal-contrib

  • Install ddev locally.
  • Clone the alt_text_validation project repository or any issue fork
  • Refer to the ddev-drupal-contrib readme file for instructions on using the plugin and the testing tools it provides (phpunit, phpcs, eslint, etc).

Activity

Total releases
14
First release
Jan 2025
Latest release
1 month ago
Releases (12 mo)
10 ▲ from 4
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.0.3 Stable Jun 5, 2026
1.0.2 Stable Apr 4, 2026
1.0.1 Stable Aug 26, 2025
1.0.0 Stable Aug 21, 2025
1.0.0-beta3 Pre-release Aug 20, 2025
1.0.0-beta2 Pre-release Aug 17, 2025
1.0.0-beta1 Pre-release Aug 15, 2025
1.0.0-alpha9 Pre-release Aug 13, 2025
1.0.0-alpha8 Pre-release Aug 7, 2025
1.0.0-alpha7 Pre-release Aug 6, 2025
1.0.0-alpha6 Pre-release Feb 9, 2025
1.0.0-alpha5 Pre-release Feb 1, 2025
1.0.0-alpha4 Pre-release Jan 27, 2025
1.0.0-alpha3 Pre-release Jan 23, 2025