Improve your WordPress SEO: Write better content and have a fully optimized WordPress site using the Yoast SEO…
About All 404 Redirect to Homepage
The Smart 404 Error Fix & Redirect plugin helps fix random 404 links on your website by redirecting them to the homepage or any other page. This improves your website's SEO ranking and user experience. The plugin is easy to set up and allows you to customize the redirection options.Screenshots




Frequently asked questions
What does this plugin do?
This plugin fixes all random 404 links that appear on your website and redirects them to the homepage or any other page using a 301 SEO redirect.
How do I use the plugin?
After installing the plugin, go to the plugin control panel from the settings menu. Put the link where the plugin should redirect all 404 links in the text box. Select the plugin status to be enabled. Click the button Update Options to save the form. Go to the 404 URLs tab to see the latest 404 links discovered and redirected.
What should I be aware of when using the plugin?
Please make sure that the page you put above in the control panel to redirect all 404 links to is a valid link. If this page is not valid, it will be considered as a 404 link and will result in a redirect loop. In case of a redirect loop, you can simply disable the plugin and check if the page is valid or not.
Changelog
5.8
- Security: Hardened 404 logging against database flooding. The “404 Logging” setting is now honored, URLs longer than 1,024 characters are no longer stored, and the log has a row cap (default 50,000) and retention period (default 90 days) enforced by a daily cleanup task.
- Security: The visitor IP is now taken from REMOTE_ADDR. Forwarded headers are only used when the request comes from a trusted proxy (P404_TRUSTED_PROXIES constant or ‘p404_trusted_proxies’ filter).
- Performance: The plugin options are no longer rewritten on every 404; the hit total is now read from the log table and cached.
- Fixed the one-hour duplicate check using UTC while log times are stored in site time, which created extra rows on sites west of UTC.
- Thanks to Warren Lavallee for responsibly reporting the 404 logging issue.
5.7
- Security: Hardened 404 redirection to use wp_safe_redirect() with URL sanitization, preventing header/CRLF injection and open redirects.
- Security: The infinite-loop warning is now shown only to administrators instead of all visitors.
- Fixed 404 image options being saved to the wrong option key, so stale-image cleanup now works correctly.
- Fixed the settings page showing a false error when image redirection is disabled.
- Fixed a heredoc closing marker that could cause a fatal error on older PHP versions.
- Hardened $_POST handling on the settings page and AJAX handlers (nonce, capability, and isset checks).
- Removed dead code with an undefined database object and an unprepared SQL query.
- Logging now only writes when WP_DEBUG is enabled, keeping production debug logs clean.
5.6
- Fixed false “Suspicious host detected” warnings by allowing www/non-www variants, port numbers, and CDN/proxy forwarded hosts in URL validation.
5.5
- Resolved the CanvasJS loading conflict by removing the hard-coded CDN call from p404_enqueue_canvasjs_safe().
5.4
- Added CanvasJS support for statistics and charts
- Loaded scripts only on plugin settings page to improve performance
5.3
- Bug fixes
- Top bar widget
- 404 statistics
- Enhancements to existing reports
5.2
- Checking with the last version of wordpress 6.7.1
5.1
- Bug fixing in the options
4.9
- Bug fixing in the log
4.8
- Bug fixing in the customizer
4.7
- Checking with the last version of wordpress 6.7.1
- Adding new options
- Adding the ability to clear the log
4.6
- Checking with the last version of wordpress 6.6.1
- readme.txt some fixes
4.5
- Bug fixing in “exclude media” option
4.4
- Introducing a new feature on the plugin options page to prevent the logging of media links.
4.3
- bg fixing in reading htaccess file
4.2
- bg fixing in htaccess file read
4.1
- Checking with the last version of wordpress 6.1.1
- Changing the wording in writing some clarifications to correct the misunderstanding of some users
3.8
- Checking with the last version of wordpress 6.1
3.7
- fix show more link on network sites
3.6
- show alert message if you have many broken links
- compatibility check with wordpress 6.0
3.5
- Bug fixing – PHP 8.1 issue
3.4
- Tested with the latest WordPress Version
3.3
- Addin hint to download our “Broken Images Redirection” Plugin
3.2
- Bug fixes in function prefix
3.1
- New feature – Replace all broken images with a custom image
2.3
- Bug Fixes – Escaping URLs
2.2
- Bug Fixes – sanitizing part 2
2.1
- Bug fixes – sanitizing
1.21
- Bug fixes
1.19
- New GUI
1.18
- Bug fixes in the log report
1.17
- Bug fixes
1.16
- fix upgrade message issue in the plugins page
1.15
- PHP 7.2 compatibility
1.14
- add the ability to hide message
1.13
- PHP 7.x compatibility – Fix deprecated class issue
1.12
- bug in calculating the broken links count (this was affecting the error message)
1.11
- PHP 7.x compatibility
1.10
- Fix deprecated class issue
1.9
- Fix soft 404 url’s
1.8
- Fix for issue that may cause infinite redirect loop
1.7
- Support Handling all 404 error pages when using default permalink structure.