First of all, 404 pages are common in the web world. Very few of the 404 errors in a website are natural. But it is not a good practice to keep tons of 404 error pages in your website in order to keep your visitor closely engaged. The visitors may go to your competitors’ websites when you are 404. For this reason, the experts suggest redirecting the 404 pages into the homepage or another related or valuable page.
But losing the SEO is another big issue when it comes to the 404 error page. So, our primary concern is to redirect 404 pages in WordPress. In this step-by-step tutorial, we will learn How to redirect 404 pages in WordPress automatically without losing SEO.
Hopefully, now Google is working for 301 redirects for 404 error pages to the homepage. We suggest doing it carefully.
What are 404 pages?
In general, we see different terms regarding 404 pages that include HTTP 404, Page Not Found, or Server Not Found, and 404 error pages. It happens when a user seeks something and a website is unable to process the HTTP request. Although the browser can access the server, unable to find the desired content.
The common reason for getting the 404 pages is maybe the user is typing wrong URLs or clicking on an old post which has got a new title or URLs. Even the URLs no longer exist.

Why 404 Pages Are Bad For Your Website?
Firstly, the 404 page is a blank page where the desired content is not available. So, when the users are coming following that link, it makes them disappointed. They are bound to go back into another website. So, it is not good for your brand.
Secondly, the link is worthless. It does not give any juice for SEO. As the links point to a 404 page, the search engine will deindex the page.
If you have tons of 404 pages, the search engine may take it as spammy. Similarly, the users will get bad experiences which ultimately hamper the reputation of your brand.
How to redirect 404 pages in WordPress automatically
Stats show that 11% of 404 pages redirected on the homepage get a positive impact on sales. One the other hand, the users will surely get a resourceful page where they may find out their related services or content.
We will see the two most reliable ways of redirecting the 404 error pages.
Using Plugin To Redirect The 404 Pages
This is a simple and straightforward method. It will automatically redirect all 404 pages to the Homepage without writing a line of code. Some of the plugins work for some custom facilities. That means redirecting to other posts or pages. If I mention, you will get plugins including Redirection, All 404 Redirect to Homepage, and Safe Redirect Manager.
How To Configure Redirection Plugin:
Now, we will see redirection of 404 pages into new pages. For example, your current 404 error page is example.com/2020/old-link and now the existing URLs that you want to point to are example.com/new-link. Need to tell that 301 redirects are the best, as it tells the search engine that its previous URLs are no longer exists in the website and needs to point another essential one. So, the engine also redirects the SEO juice to the new page.
If you are fighting to redirect the old 404 error pages, it is better to follow the below easy steps where I showed you with the most popular plugins of John Godley’s Redirection. If you have not downloaded or installed (/wp-content/plugins) it on your website, do it right now. It is simple as like other reliable plugins. When you will activate the plugin from the plugin management page, the setting or customization menu will come under the Tools of WordPress Dashboard.
- So, now go to the options from the
Tools/Redirection
page to configure the plugin as you need to redirect the 404 pages. - Now from Add New Direction gives the source URL (404 error page link) and then add the Target URL. You can create a Group to find the desired URLs in one place. It will help you to change or modify the URLs easily. (Please see the screenshot for close look)
- Thus you can add as many URLs as you want. you can check and test as well.
- You can monitor the URLs also.
It is the simplest way to redirect the web pages with a 404 error.
Adding Code On 404 Page
This is another popular method who knows the advanced use of WordPress. Though it is simple, but keep in mind if you make any fault, you may lose your personal data or related things. So, keep a backup of your website. At the same time, just do it when you know how WordPress Editor works.
- First, go to
Appearance/Theme Editor
and find out 404_page.php options. - At the last of the page, add the below code and it will automatically redirect the 404 error page into the home page.
<?php header("HTTP/1.1 301 Moved Permanently"); header("Location: ".get_bloginfo('url')); exit(); ?>
- Now check the 404 pages and it will work fine. The search engines also try to crawl the new URLs with the SEO juice.
Those who do not like to use Plugins a lot, they can do it. It will redirect all 404 error pages into home pages without any hassle. At the same time, you can give a smooth redirection to the visitors.
Conclusion
Finally, now it’s your turn. If you are struggling to redirect 404 error pages for 301 redirections or redirecting to homepages without losing any SEO juice. Hopefully, it would help you. If you face any issues or have any further queries related to these issues, never hesitate to make a comment or contact us. We may help you freely regarding these issues from Speed Host. Thanks a lot.