Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Image 404 Fallback

Security covered Under active development 25 sites

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
Drupal 10–11

Ask your assistant about Image 404 Fallback

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

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 month ago
Releases (12 mo)
6 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP 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