To leave a comment, please Login or Register

1: How to Redirect 404 Page to Home Page Using Code

You can redirect all 404 pages to homepage by using custom code in your site. Simply, you need to add the code to your WordPress file.

First, you need to create a new file in your WordPress theme folder and name it 404.php. If your theme already has a 404.php file, you'll need to edit the file.

And then you need to add the following code to your 404.php file:

header("HTTP/1.1 301 Moved Permanently");

header("Location: ".get_bloginfo('url'));



After this save your 404.php file. Now, when a visitor visits the 404 page of your site, he/she will be redirected to the home page.

2: How to Redirect 404 Page to Home Page Using Plugin

If you are afraid of adding code to your site, you can use a plugin.

First of all install and activate Redirection plugin on your site. After activating the plugin, click on Tools >> Redirection and follow the below screenshot.

Here you add your 404 Error Page in the Source URL field and add the Home Page URL in the Target URL field. After that leave the rest of the settings as default.

After adding your URL click on “Add redirect”. Now to test it, you can click on the URL with 404 not found.
5 months ago   0

Related Questions

3. Why is blogging so popular?

Blogging is popular for many things like - anyone can write anywhere - source of income - freelance - you are the boss - can...

4. The Definitive Guide to Accelerated Mobile Pages (AMP)

Everything is good in your site, but despite that it is very important for your site to load fast, because there are many users, i...

5. What is a WordPress Parent Theme?

If the duplicate version of an original theme is a child theme, then the original theme is called a parent theme. Most of the Gene...