Use This PHP Code and Fix 404 Errors in Search Console & Google Webmaster Tool

Hi, Reader, Hope you my last article about Google Analytics Account Set Up. Today, I am going to share information about 404 errors. 404 Errors are one of the biggest problems for bloggers and webmasters. Because it harms the website and effect ratings in Google SERPs. 404 errors appears on website when content was not found. It’s one solution is, find 404 errors and redirect that links. If your website is installed in WordPress, then for finding broken links and 404 links, you can use wordpress plugin Broken Link Checker. And for redirect, you can use SEO Redirection plugin.

Must CheckIdeas to Get and Increase Traffic on Website or Blog

Use This PHP Code and Fix 404 Errors in Search Console & Google Webmaster Tool

Use This PHP Code and Fix 404 Errors in Search Console & Google Webmaster Tool

Fix 404 Errors in Webmasters

Must Check: 5 Simple Steps to Add and Verify Website in Google Search Console

Here in this post, i am going to share a code, which you have to paste in your 404.php file in your WordPress theme’s editor, and that’s it.

PHP Code For Fix 404 Errors in Search Console:

<?php
header(“HTTP/1.1 301 moved permanently”);
header(“location:”.get_bloginfo(‘url’));
exit();
?>

This is a code which you have to paste in your theme’s 404.php. Keep in mind, if you change your theme, then you have to again paste this code in your new theme.

Find 404.php File:

Finding 404.php file is not difficult in wordpress. But still i am sharing here, how you can find 404.php file.

Dashboard > Appearance > Editor > 404 Templates (404.php), that’s it.

You have to remove previous code and just paste this code.

Must Check5 Simple Steps to Add and Verify Website in Google Search Console

Hope you like this post and information, but, still if you have doubts in your mind, comment here below the post and i will reply as soon as possible.

Leave a Reply

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