WordPress Redirect 404 To Homepage Without Plugin

0
29
views
Redirect 404 To Homepage

WordPress Redirect 404 To Homepage Without Plugin: In today’s I will teach you, how to redirect 404 error page to the homepage of your website,  If you are don’t know this method then don’t worry. The only thing that is you has to read this post completely. So let’s start.

You may have seen in your Google Search Console that there are many 404 errors in your crawl area. So this is what we call 404 error. But if you don’t know how to fix it then don’t worry. So in this article, I will tell you in WordPress website how you will redirect your 404 error page to the homepage of your blog.

What is 404 error?

Let assume that your article or page is indexed in Google’s search engine but it is not in your website, and when someone clicks on those links, then it will redirect to you in 404 error page or page not found error page. It is called a 404 error.

Also Read:

How To Redirect 404 To Homepage Without Plugin In WordPress

Step 1: In the first step you have to copy the following code.

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo('url'));
exit();
?>

Step 2: After copying above code you have to open your WordPress dashboard and click on >>Appearance >>Editor. See the screenshot below.

Redirect 404 To Homepage

Step 3: After clicking on the editor, the new window will open in that window you have to click on 404 Template(404.php). See the screenshot below.

Redirect 404 To Homepage

Step 4: After that new window will open and you have to paste the code that you have copied. And update the file. See the screenshot below.

Redirect 404 To Homepage

I hope this article will you help you to redirect your 404 error page to the homepage of your website.

If you have any question about this article you can comment I will give the best answer.

If you know want to more such informational posts and to receive Notifications about new blog posts, please subscribe us.

So if this article is helpful to you then you can share this article on social media networks such as FacebookTwitterGoogle.

Also Read:

LEAVE A REPLY