404 error is one of the most common errors we face not only in WordPress but with other web-based applications as well. It simply tells the resource that what we are looking for doesn’t exist or it has been moved from the designated place. In this post, we are going to focus on the 404 error for WordPress and will see all the aspect of this error such as;
- The reasons behind this 404 error
- How to correct it
- What sources can create 404 error
Usually, with WordPress when you get this 404 error, your WordPress admin area will work normally and all other blogs also. But you will find out that this 404 error affects certain pages or posts on your blog. If you’re experiencing this, don’t get panic, your posts or pages are all there and the issue is mainly due to the .htaccess file. Either it has been deleted or some kind of rewrite rule has been changed.
Once you restore the .htaccess file or make changes to the permalink, you will be able to get rid of this 404 error. This error basically tells the user that, the URL you were looking for no longer exists. There can be various reasons behind this. The website 000webhost has also written a dedicated post on this and you can have a look for the reference.
What are 404 Error Pages?
A 404 error page is nothing but a default error message page telling the user that the page or URL they are looking for, doesn’t exist. But the question is how these 404 error pages are being generated?
The answer is simple!
Let’s assume you are cleaning your WordPress dashboard and in the process you mistakenly had a certain post or page deleted. And along with this, you have also deleted certain categories or menu items. Now if someone tries to access the tags, categories or pages you deleted, the system will result in a 404 error message.
There can be different messages associated with this error or if you have made a change to your theme to show a custom message while getting the error 404, it will show there. Many people including me, have designed some really cool looking 404 error page. For example, I have shown a custom message and at the end, I have shown some links where I want the user to redirect (e.g. Homepage) and also I have shown few important pages and posts which user can browse in case they have landed to the 404 error page.
But make sure you don’t have a lot of pages there, else you will start facing issues both from the user point of view and search engine point of view. If in anyway the number of pages on your 404 error section starts increasing, you will start getting messages from the Google webmaster. This raises another question.
So, are 404 error pages bad for a website?
Well, ideally they are not bad but they provide really bad user experience and you do know this can kill a website. Google puts more focus on a website’s user experience when it comes to search engine ranking. So it’s recommended to fix any occurrence of 404 error page on your website.
Also Read: 5 Best Online Broken Link Checker Tools for your Website.
Apparently, the 404 error pages are neither good for your users nor for the search engine and you should avoid getting them as much as you can. Another reason I found for the 404 error is this, if you make changes to your permalink then you will find some issue with certain URLs and those needs to be fixed manually. Either you can fix those manually or redirect those lost URL to some active pages to avoid an increase in 404 error pages.
Fixing the 404 Error Pages
Here are some of the quick and easy methods to fix 404 error pages on any WordPress site.
Use 301 Redirection to solve the issue
This is the easiest method you can achieve. Even, there are few WordPress plugins available to get this job done. These plugins will easily detect all occurrences of 404 pages and will redirect them to the home page or to the page you want to redirect them to.
Here are few recommended plugins to do 301 redirections easily-
Also, be sure to fix the permalink structure before using this plugin as that will set a common URL pattern for all the existing and upcoming pages and post and will streamline the structure.
Finding the 404 error pages are pretty straightforward as you will need to login to your Google webmaster account. (I hope you already have a Google webmaster account setup. If you don’t have one, please create it since it’s required).
Once you are on the Google webmaster dashboard, select the respective domain name for which you want to perform the analysis. Then follow this path; Crawl > Crawl Errors.
Here you will find 2 tabs on the page, so you’ll need to select the “not found” tab where all the 404 error pages will be shown. Once you click on any URL, it will show you all the details relating to it. Like when the page was last crawled and to what destination the 404 error page is linked to and accordingly, you can act.
Once you have identified all the 404 error pages, you can come back to your 301 plugin and there click on the redirect option and manage the redirection. Once this is done, go back to the Google webmaster and select the URL for which you have made the redirection and mark it as fixed. When next time Google bots crawl your website, it will crawl it and will remove that URL from the 404 error list. That’s it!.
Check spelling and Names
Many times it has been seen that due to some spelling mistakes or naming issue, this error is coming. So, make sure all these are coming correctly and if required, make the suitable changes.
Conclusion
This was all about finding and fixing 404 error pages. I hope you got a clear idea to identify and fix these pages easily. Analyze your website for the similar issues and make sure you fix all occurrences of 404 error pages before it’s too late.