This project is not covered by Drupal’s security advisory policy.

Automatically handles empty alt attributes on image fields using one of two configurable behaviors: inject the entity label (node title, taxonomy term name, etc.) as fallback text, or mark the image as decorative by adding role="presentation". No manual alt text entry required for images that already have a descriptive title.

Features

  • Two fallback behaviors. For each field you can choose to fill the empty alt with the parent entity's label (Entity label), or add role="presentation" to signal that the image is decorative (Role presentation). Images that already have a non-empty alt value are never touched.
  • Global default with per-field overrides. A site-wide default behavior is set once at the top of the settings form. Individual fields can inherit that default or override it with any of the available options.
  • Per-field precision. Processing is applied only inside the specific field wrappers you configure — not globally across the whole page — so unrelated image fields on the same entity are unaffected.
  • Works with Media reference fields. Supports both raw image fields and entity_reference fields pointing to Media entities, which is the most common pattern in modern Drupal sites.
  • Multi-entity support. Works across content types (nodes) and taxonomy terms.
  • Zero template changes. The fix is applied in a post-render callback, so no Twig templates need to be modified.
  • Media Alts view. A bundled view at Administration › Content › Media Alts (/admin/content/media-alts) lets editors browse all media items, filter by alt status (empty / not empty), type, language, and published status, and jump directly to edit any item. It appears as a tab alongside the core Media tab.

Use this module when:

  • Your editorial workflow does not enforce alt text entry and you want a reasonable default rather than an empty alt="" (which screen readers skip entirely).
  • Some image fields are purely decorative and should carry role="presentation" instead of a text fallback.
  • You are migrating a site from an older version of Drupal or another CMS where alt text was not required or not stored, and fixing every image at the source is not feasible.
  • You want a low-effort baseline for accessibility compliance (WCAG 2.1 SC 1.1.1) while still allowing editors to provide more descriptive alt text where it matters.

Note: the ideal long-term solution is to store meaningful alt text directly on the File or Media entity so it travels with the asset regardless of where it is used. This module is best suited as a safety net or a transitional measure while alt text is being backfilled at the source.

Post-Installation

After enabling the module, visit the settings page:

Administration › Configuration › Media › Image Alt Fallback (/admin/config/media/image-alt-fallback)

The form is organised in three levels:

  1. Default behavior. A select list at the top of the form that applies to all fields configured as "Default". Choose between Entity label and Role presentation.
  2. Entity type / Bundle. Supported entity types (Node, Taxonomy term) expand into their bundles.
  3. Field. Each image field in a bundle is shown as Label (machine_name) — for example Image (field_image) — with a select list offering four options:
    • None — take no action on this field (default selection; fields left as None are not saved to configuration).
    • Default — use whatever the global default behavior is set to.
    • Entity label — fill the empty alt attribute with the parent entity's label.
    • Role presentation — add role="presentation" to images that have an empty alt and no existing role attribute.

Example: for the Article content type, set field_image to Default so it inherits the global setting, and set field_images (an image gallery) to Role presentation to mark those images as decorative.

No template changes, additional hooks, or configuration exports are needed beyond saving the form.

Media Alts View

The module ships a view accessible at Administration › Content › Media Alts (/admin/content/media-alts), available as a tab next to the core Media tab. It provides:

  • A filterable table of all media items showing thumbnail, name (with alt text inline), type, author, status, and last-updated date.
  • An Alt attribute filter to quickly isolate items whose thumbnail alt is empty or not empty.
  • Additional filters for media name, type, language, and published status.
  • An Operations column for direct edit access to each item.

Use this view to audit and fix missing alt text across the media library without needing to browse items one by one.

Additional Requirements

  • Drupal core 10 or 11.
  • Views module (included in Drupal core).
Supporting organizations: 

Project information

Releases