Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

decorative_image_widget

4,057 sites Security covered
View on drupal.org

This module provides a solution for site builders that want to make the option of leaving an image's alternative text blank explicit (by checking a new "Decorative" checkbox) rather than implicit (by simply leaving the alt text field blank).

In other words, editors are forced to affirm that the reason they're leaving alt text empty is because the image is decorative and should be hidden from screen readers.

If the new "Decorative" checkbox is not checked and no alt text is provided, the form will fail validation.

How to Use

  1. Enable the module.
  2. Edit an image field and make sure alt text is enabled and NOT required.
  3. Edit the form display settings for the image and enable the option to force the image to be marked decorative when no alt text is provided.*
  4. Add an image and observe you users cannot leave alt text blank without checking the "Decorative" checkbox.

*Assumes your selected form widget is the one provided by core, or one that extends it.

Features

  1. Adds a "Decorative" checkbox to image widgets that must be checked if the user wants to leave the alt text empty.
  2. Forces users to stop and think about alternative text rather than leaving it blank.
  3. Works with any existing image widget that extends from core's default. For example, you can use this with the default image widget or the one provided by Image Widget Crop.
  4. Does not require any data model changes - the state of the "Decorative" checkbox is inferred entirely from the value of the alt text.

A note on Media module usage

Most Drupal 8 and newer sites are using core's Media and Media Library modules, which decouple images from the entity (e.g. a content type), allowing the same media to be used in many places on your site by reference.

It's important to keep in mind that good alternative text varies depending on the context it is used. A content author should describe a picture of fireworks differently when displayed in an article about photography techniques vs an article about the event in general.

As such, while this module works just fine with the Media module, it's best not to rely on it if your site uses the same image in multiple different contexts, as you won't be able to change the alt text per context.

Further Reading

There is an effort to make similar functionality available in Drupal core: #2934405: [META] Improve workflows for image alternative text

Activity

Total releases
1
First release
Jan 2026
Latest release
3 months ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
1.0.3 Stable Jan 12, 2026