Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Image 404 Fallback

24 sites No security coverage Drupal 10–11
View on drupal.org

This module replaces broken image links with a specified fallback image, preventing broken image icons from appearing on your site. It automatically detects missing image requests and serves a configurable fallback, supporting various image formats.

The Image 404 Fallback module automatically replaces 404 (not found) image requests with a configurable fallback image, improving user experience and preventing broken image displays. It intelligently handles both direct file requests and image style derivative requests, ensuring consistent results across your site.

Features

  • Automatically detects 404 image requests (including image style derivatives)
  • Serves a configurable fallback image
  • Supports multiple image formats (JPG, PNG, GIF, WebP, SVG, BMP, ICO, AVIF)
  • Includes default fallback images (SVG and PNG)
  • Configurable fallback path via admin interface
  • Image style aware: Applies requested image styles to fallback images for derivative requests, ensuring correct dimensions and effects
  • Handles both direct file requests and image style derivative requests
  • Proper HTTP headers and browser caching (200 status code instead of 404)
  • Security-aware: Respects Drupal's image style security tokens
  • Graceful fallback for image processing failures

How It Works

The module uses Symfony event subscribers to intercept HTTP requests for missing images:

  • Catches 404 exceptions for direct image file requests
  • Detects and applies image styles to fallback images for derivative requests (e.g., /styles/thumbnail/public/missing.jpg)
  • Serves styled fallbacks with correct dimensions and effects when using raster formats (PNG, JPG, GIF, etc.)
  • Gracefully handles SVG and other non-processable formats by serving the raw fallback
  • Respects Drupal's access control and security protocols

Post-Installation

  1. Navigate to Configuration > Media > Image 404 Fallback Settings (/admin/config/media/image-404-fallback)
  2. Optionally specify a custom fallback image path:
    • Enter an absolute path (e.g., /var/www/html/sites/default/files/my-fallback.png)
    • Or a path relative to the Drupal root (e.g., sites/default/files/fallback.png)
    • For styled fallbacks, use raster formats (PNG, JPG, GIF, WebP) rather than SVG
  3. If left empty, the module will use its default fallback image located at images/placeholder.svg

Requirements

  • Drupal 10.x or 11.x
  • PHP 8.1 or higher

Depends on

Dependencies of the latest stable release

  • image Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
6
Tracked since
Nov 2025
Latest release
1 week ago
Releases (12 mo)
6 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.3 Stable 10–11 Aug 21, 2026
1.0.2 Stable 10–11 May 21, 2026
1.0.1 Stable 10–11 May 20, 2026
1.0.0 Stable 10–11 May 11, 2026
1.0.0-alpha1 Pre-release 10–11 Nov 16, 2025
1.0.x-dev Dev 10–11 Nov 14, 2025