The dreaded 404 page can be a headache for anyone who manages a website. And sometimes figuring out how to handle such errors when using a CMS such as WordPress can be even more challenging.
WordPress has default settings for handling 404 errors, but they leave a lot to be desired. So how does one go about making improvements to that standard handling? And more importantly, how do you prevent 404 errors in the first place?
This is a quick guide to 404 errors in WordPress including information on why they happen, why they’re such a big deal, how to prevent them, and more. We’ve included a number of plugins that make handling WP 404 errors nearly painless and a selection of additional resources at the end. Handling your 404 errors should be a breeze after reading this.
404 pages in WordPress are most often caused by a change in the permalink structure of the site. If a site owner changes the permalink structure of their WP blog, they’re going to end up with incoming links pointing to pages that are no longer located at a particular address.
This means that the incoming visitors will be given a 404 page instead of the content they were looking for.
Other causes of 404 pages may be in the code of your index.php or search.php files. If there’s an error in the code in either file, it may return results with invalid addresses (or it may not return results at all).
If you’ve made customizations to your index.php or search.php files, it’s a good idea to check and make sure they’re not serving up invalid addresses and that all of your pages are still working. Always save a backup of the previous version of each file before making changes in case you need to roll back to an earlier version.
Another common reason for getting a 404 page has to do with mod_rewrite not being installed on your server. In order to use Pretty Permalinks, you have to have mod_rewrite working on your server. If you’re trying to use Pretty Permalinks and are getting errors, this is the first thing to check.
The most obvious damage caused by a 404 page has to do with the bounce rate on your site. If a visitor follows a link to your site and they get a 404 page rather than the content they were looking for, it’s unlikely they’ll search your site to find it. They may assume that it no longer exists and simply look elsewhere.
If your site is filled with 404 errors, it’s possible you’ll take a hit in search engine rankings, too. If search engine spiders are constantly presented with non-existent pages, they’ll penalize your site for having invalid links.
One or two 404 pages may not have much of an impact, but if half the pages the search engine thinks should be there aren’t, you’ll take a bigger hit.
The best way to prevent 404 pages is to be proactive. First of all, set up your permalinks properly from the start. If you take the time when you first launch a blog to set up well-structured permalinks, it’s unlikely that you’ll need to change them in the future.
Be proactive about incoming links that aren’t correct. Send a quick note to the person who runs the site with the link and ask them to change it to the correct link. Most site owners will be more than happy to do so.
Don’t take down old content. If you have to take something down, rather than deleting it entirely, create a custom page at that address that provides some information on what used to be there, or links to other posts and pages that might be of interest to the visitor.
There are a variety of plugins out there that can help you prevent and manage 404 pages. Following are some of these plugins that can go a long way toward preventing your visitors from ever seeing a 404 page.
All of these plugins are free and range from plugins that automatically redirect your visitors to ones that simply log 404 errors.
The Smart 404 plugin helps eliminate 404 pages automatically. If a visitor reaches a page that will return a 404 error, this plugin searches the requested URL to see if there’s some other post that likely to match.
If there’s more than one potential match, it can return a list of possible links and goes a long way to help rectify a high bounce rate caused by 404 errors.
This plugin monitors 404 errors and lets you map them to 301 redirects. It also allows you to set a custom redirection that lets you pass a URL through to a different page, file or website and creates a full log of all redirections.
It can be used to redirect both nonexistent pages and ones that exist and it can be set to redirect based on login status or other parameters.
404 to 301 is a simple plugin that will handle all 404 errors to any page on your website or a custom URL. Redirects may be set to 301, 302, or 307.
Furthermore, you can also enable logging that will provide information on how the redirects were performed such as the IP, user agent, the URLs.
It will automatically redirect all 404 to the homepage. This plugin just works and does even not provide settings. A good plugin for those who do not want to bother with configuring settings.
If your site is using Genesis theme, this plugin may come in handy. This plugin provides a shortcode
[genesis-404-search] shortcode to easily customize the 404 page on this theme with a search to the page. Adding a search form on the 404 page may improve the user experience on your site.
A free WordPress plugin that allows you to create a custom and nicer look 404 page without requiring coding skills. It provides several options on the WordPress Customizer to edit and customize the 404 page that allows you to create 404 page that fit into your website’s design.
Another plugin to handle redirect for the 404 page with some very smart features. It can redirect the 404 page to the best possible match for the URL the visitor was trying to reach as well as automatically remove if it matches with a new page created. This plugin has great balance for simple and advanced usage.
This plugin provides an all-in-one solution to handle redirection with a special built-in feature for 404 pages. The plugin will automatically log all the 404 pages along with the information like IP, source URL, number of hits, referrer, etc. You can then redirect these pages to the most relevant pages on your site.
A plugin to manage redirects easily and safely. It’s built with performance so it works for large scale websites. With that, it also provides some advanced features too such as a special WordPress filter to handle 404 and redirect loop.
This plugin works out of the box. The plugin will first automatically redirect every 404 pages it found to the homepage. If you need more granular handling, you can examine the log from the plugin and start redirecting the 404 pages to the custom page.