404 Image Redirection (Replace Broken Images)
404 Image Redirection (Replace Broken Images)
Description
404 Image Redirection (Replace Broken Images) prevents broken image icons from appearing on your WordPress site. When a visitor requests an image that no longer exists, the plugin either serves a default replacement image or removes the broken image from the page entirely — your choice.
Why this plugin?
Broken images hurt your site:
* They damage user experience — visitors lose trust instantly
* They hurt your SEO — search engines penalize 404 errors
* They look unprofessional — especially on product and content pages
Key Features
- Replace broken images with a default image of your choice
- Hide broken images entirely — JavaScript removes them from the DOM along with their links and captions
- Custom redirection rules — map specific broken image URLs to specific replacement images
- Server-level performance on Apache — uses a small
.htaccessrule, zero PHP overhead per request - PHP fallback for Nginx and LiteSpeed — works on any host, even if
.htaccessis unavailable - Clean uninstall — removes only what the plugin added, never touches WordPress or other plugins’ rules
- Master kill switch — when you toggle the plugin off, it truly stops working
How it works
On Apache servers, the plugin writes a small rewrite rule to your wp-content/.htaccess file. When a visitor requests a missing image, your server serves the replacement image instead of returning a 404. This is fast (no PHP execution per image) and SEO-friendly (the response is a real 200 OK with a real image).
On Nginx, LiteSpeed, or hosts with a non-writable .htaccess, the plugin automatically falls back to a PHP-based handler that does the same job via WordPress’s template_redirect hook.
Two display modes
1. Replace mode (default): Show your chosen default image whenever a broken image is requested. Best for visual consistency.
2. Hide mode: Remove broken images from the page entirely, along with their parent link and surrounding <figure> or caption wrapper. Best for clean layouts where missing images should leave no trace.
Privacy
This plugin does not collect, store, or transmit any data outside your WordPress installation. No tracking, no analytics, no external requests.
Installation
Automatic Installation
- Go to Plugins Add New in your WordPress admin
- Search for “404 Image Redirection”
- Click Install Now, then Activate
- Go to 404 Image Redirection in your admin menu
- Toggle the plugin status to ON, choose your mode, upload a default image (for Replace mode), and save
Manual Installation
- Download the .zip file
- Go to Plugins Add New Upload Plugin
- Select the .zip file and click Install Now
- Activate and configure under the 404 Image Redirection menu
Screenshots
Faq
No. On Apache, the rewrite happens at the server level with zero PHP execution per image request. On Nginx or LiteSpeed, the PHP fallback only runs when an image returns a 404 — healthy images are unaffected.
Yes. After changing any setting, clear your caching plugin and CDN cache so visitors see the change immediately. The plugin shows a reminder modal after each save with the recommended steps.
Replace mode shows your chosen default image in place of any broken image — best for visual consistency. Hide mode removes the broken image element from the page entirely, along with its link and caption — best for clean layouts.
Your SEO improves. Instead of returning 404 errors that search engines penalize, broken image URLs now return a 200 OK response with a real image (in Replace mode) or are removed cleanly from the rendered page (in Hide mode).
Yes. The plugin auto-detects when .htaccess rules can’t be applied and falls back to a PHP-based handler that produces the same result.
The plugin removes every rule it added to .htaccess — surgically. WordPress’s own rules, other plugins’ rules, and any custom rules you or your host added remain completely untouched. Your settings and custom redirection rules stay in the database so you can reactivate later without losing your config.
A complete cleanup runs: the plugin’s database table, its options, and all its .htaccess markers are removed. Your site is returned to exactly the state it was in before installing the plugin.
No. Zero data leaves your server. No tracking, no analytics, no phone-home.
Reviews
Replaces image but not broken icon
By dannyg82 on July 25, 2024
By the way the last review here is incorrect. Replace broken image does work and has exactly the same effect as this plugin. Both put a new image in place but don't remove the broken image icon.
This Worked 🙂
By macksix on October 14, 2022
Changelog
2.0
- NEW: “Hide broken images entirely” mode + PHP fallback for Nginx/LiteSpeed servers
- NEW: Cache-clearing reminder modal after save, “Settings” link on Plugins page, and SEO Redirection cross-promo
- SECURITY: CSRF nonce verification on all forms, switched to
manage_optionscapability, prepared SQL statements, and Path Traversal protection - IMPROVED: Master kill switch (plugin truly stops when disabled), surgical .htaccess cleanup on deactivate, atomic file writes, and proper uninstall.php
1.4
- Tested with WordPress 6.7.1
1.3
- Tested with WordPress 6.1
1.2
- Tested on the latest WP release
1.1
- Initial version


