How To Redirect Error 404 Page To Your WordPress Site’s Home Page ?

Yes you can redirect 404 page to your website’s homepage. Open your 404.php file (if it doesn’t exist then create a blank file) and add the following code:

<?php
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: “.get_bloginfo(‘url’));
exit();
?>

That’s all your 404 page is redirected to your site’s home page. Now visitors hitting 404 will get automatically redirected to home.

Leave a Reply

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