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

Redirect 404 error to Homepage in WordPress (Solved)

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.

Disclaimer: 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.

Leave a Reply

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

Free Newsletter


5 Best Solutions to Text from Your Laptop

The concept of texting, either as SMS or Online Instant Messaging, has ever been attached to the smartphones or cellphones. The enormous-sized desktop computers...

Save money with Google Flight Search and Google Hotel Finder

Google Hotel Finder and Google Flight Search are the latest addition to Google's powerful search tools family. Google Hotel Search and Flight Finder is...

Facebook Chat in Ubuntu Linux using Thunderbird

You can chat with your Facebook friends in Ubuntu using the free email client Thunderbird. Thunderbird is the trusted email client for many users....

How to Share Live Location on WhatsApp?

Live location sharing is a life-saving feature when you are in a trouble to lost in the street. We have already explained how to...

Is Your iPhone Compatible with iOS 13?

Apple announced the iOS 13 with long-waited feature iOS Dark Mode. Advanced photo editing features, video rotation options are the additional features coming with iOS 13. This new iOS 13 is going...

How to Block Your Number on Caller ID: 5 Solutions

Do you want to block your number from caller ID while calling? You can do a caller ID block when you call anonymous numbers?...