Home Blog Redirect 404 error to Homepage in Wordpress (Solved)

Redirect 404 error to Homepage in WordPress (Solved)

MashTips is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission at no extra cost to you.

How do you change your 404 error page to home page? This is useful if you recently deleted any of your web pages and still search engine brings traffic to that page. If your website is for your business, it is annoying that some one searched for a product in your website and finally end up with 404 error.404-error-00

There are several methods to address this issue. You can either redirect the error page to another product page. If you have several missing pages or link, the easy way is to redirect your wrong page traffic to home page.

It is easy to redirect 404 error page to home page. Go to your wordpress dashboard > Appearance > Editor and and select your theme.


Find 404.php file. Select the file to edit. If you don’t have 404.php file, please create one and paste the following code into it.



header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: “.get_bloginfo(‘url’));




That is all, this will redirect all 404 and 301 error to your home page. This is better than ending up with 404 error page or unknown error.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Free Newsletter


Best 8 Messaging Apps for Windows 8.1

Messaging is an important personal and business requirement among the Tablet, Smartphone and Laptop/PC users. No matter whatever the screen size and OS, the...

8 Best iPhone Secondary Phone Number Apps to Hide Primary Number

Second Phone number apps for iPhone are a good choice for those who want to keep their privacy. There are certain occasions where we...

How to Set Password Lock on iPhone

You can use set a 4-6 digit passcode to secure your iPhone, iPad, or iPod. Each time you turn on or wake up the...

8 Best Android Data Saver Browser to Save Data Usage

When you consider data saver browsers, those can compress and deliver the data when you browse the internet. These lightweight Android browsers can save data...

How to Enable Free VPN on Opera Browser for Android

Opera is a small player in the browser market both on the desktop and on mobile. It wasn’t always like this though. At one...

5 Best Song Finder App for Android and iPhone

Whether you are a singer or music lover, looking at the lyrics is a common thing that many of us do. Many songs are...