When a user attempts to access a broken or dead link or a link which doesn’t exist, WordPress redirect such requests to special page called “404.php”. However some bloggers prefer to redirect all 404 errors to home page. If you are one of them, Here is an easy way to do this,
1. Go to your theme’s folder.
2. Open your 404.php file, if it doesn’t exist, then create one.
3. Delete all the code and text inside that file.
4. And paste the following code in that file and save it.
<?php //Redirect 404 page to the home page header("HTTP/1.1 301 Moved Permanently"); header("Location: ".home_url()); exit(); ?>