Redirect 404 page to homepage

I have a WordPress blog that has several missing posts that I’ve deleted because they contained outdated information that was either incorrect or no longer relevant.

My blog now has lots of requests going to the 404 error page because those posts no longer exist.

WordPress typically redirects broken links and calls to missing pages or posts on your blog to a special 404 error page

404’s are part of every website. we will show you how to redirect 404 page to home page in WordPress.

Redirect 404 Error Pages to Home Follow the steps :

1 – Rename your theme’s existing 404.php file to something different. You’ll typically find this file in your WordPress blog’s active theme folder:

/wp-content/themes/theme name/

To make things simple you can just rename the file to 404-real.php. That way if you ever decide to revert back to the real 404 error page, you can just delete the new file you’re about to create and rename the original file back to 404.php.

2 – Open Notepad, then copy and paste the following into a new document:

put this code in 404.php file


3 – Click File>Save As and name the newly created file 404.php.

4 – In the Save as type: dropdown box, select All Files.

5 – Click Save.

6 – Upload your new 404.php file to your blog’s active theme folder, which again is typically found at:

That’s all. Now when a user hits a 404 page will be redirected to the homepage.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face – we are here to solve your problems.

I, Dayanand Saini,the founder and chief editor of,have been working as a software engineer from last 4+ years. It's my hobby to learn new things and implement on live environment.

Leave a Reply

Your email address will not be published. Required fields are marked *

− 5 = 2

%d bloggers like this: