Redirecting the user from the 404 Error page in WordPress: Yes, I am sure you are experiencing a 404 Error page error in your WordPress site and would like to redirect users from the 404 Error page in WordPress to your homepage or any custom page. any. Then this guide will definitely help you.
Ways handle redirect from 404 Error page in WordPress
I know how tired it can be to deal with 404 redirects. So to help you deal with this problem, we have this nice guide that will try to solve all the problems. Your error related to 404 pages.
How to redirect users from the 404 Error page in WordPress:
There are probably two ways you can redirect users from the 404 Error page in WordPress, see both.
Tips 1: Create 404 Error page for WordPress
In this method, you can manually create a 404 redirect page, and whenever a user encounters a 404 page, they will be redirected to your blog’s / home page. So basically it’s a win-win situation for everyone.
See how to create a 404 redirect:
- Log in to your WordPress admin account. For example, your website URL: www.abc.com/wp-admin/ must be the default format.
- Now from Appearance go to Editor.
- This will open your theme editor, where you create the 404 redirect page file.
- It is possible to have a file named 404.php in which case you do not have to create a new file.
- But if you do not have a file, you create a file that you must log into your Cpanel, then go to File Manager, then look for your public_html directory.
- Now from that to wp-content then theme, now browse your current theme folder and create a new file with the name 404.php and move on to the next step.
Now when you’re in the editor or you’ve created a new file, just put the code below into your file and make sure your file does not contain anything other than this code:
<? php header ("HTTP / 1.1 301 has moved permanently"); header ("Location:" .get_bloginfo ('url')); exit(); ?
Tips 2: Redirect 404 Error page by use WordPress Plugin
This is the easiest way for you to redirect users from the 404 page in WordPress to wherever you want on your blog/site. There are many plugins presented to help you with this but I will only talk about the best ones:
This plugin can do anything related to navigation. It’s simple but powerful and so completely free with a whopping 600,000+ active installs one of the best plugins to be present till date.
This plugin is very useful if you are migrating from your hosting account or you are changing the WordPress directory.
Automatically add 301 redirects when the post’s URL changes
Manually add the 301, 302 and 307 redirects to your WordPress post or to any other file
Full regular expression support
Apache .htaccess is not required – works entirely within WordPress
Redirected index.php, index.html, and index.html
The redirects show you the number of redirects that have occurred when it was last seen, who tried to do so, and where they found your URL.
And this plugin is available in most languages, so now you know why this plugin is called one of the best plugins. Come here to download the plugin or you can also install it from within WordPress.
Tip 3: Redirect 404 Error page to Homepage in WordPress
If you are unhappy with the redirect plugin above because the above plugin is charging on your database, do not worry about the 404 redirect plugin specifically for you. It is very simple and has no advanced features like the above plugin but it completely does its job.
With an active install of 90,000+ the best second plugin after it redirects. This plugin allows you to redirect your 404 page to the homepage or any other custom page.
That is all you will learn about How to redirect users from the 404 page in WordPress. If you still have questions related to this post, please ask them in the comments section.
You can also share this post on your social networks to help your family and friends fight the redirection issues.