Redirecting WordPress 404 Pages to a Home Page

If there are too many 404 page not found errors in Google Webmaster Tools, it will cause you to fall in this ranking. You can redirect these incorrect pages to your homepage until search engines remove these nonexistent pages from their index.

Inside your WordPress theme page should .php 404 files. Even if you don’t, you can create it. Then add the following code to this page and save it. (Add .php codes in 404.)

header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo('url'));

Pages with 404 page errors are now directed to the home page.

Benzer Yazılar

Leave a Comment