Are you currently facing too many errors like 404, soft 404 error e.t.c on your WordPress, probably after migrating from Blogger to WordPress? You now have an absolute solution to clean up your entire website and restore back your SEO and traffics.
404 error can hurt a website SEO – Search Engine Optimization, it means the requested URL cannot be found. However, this could be the result of a broken link from image or a typo when inserting a link and also, it could be from a changed link.
A 404 error doesn’t mean something is wrong with your website but it can affect users experience, affect your Alexa ranking and others and can affect earnings. A site with 404 errors cannot convert, or get traffics. Instead, users will continue to leave till the downfall of the website.
So, a website owner need to always review his or her blog for any errors or use Google webmaster console for quick notification.
In this article, you’ll be acquainted on how to fix 404 errors with just a 301 redirect code on your header. With this code, you don’t need to always edit 404 error one by one, and it will help you redirect all those broken links and restore back your lost traffics and SEO.
Let’s see how…
STEP 1: Login into your WordPress dashboard.
STEP 2: Go to your Appearance and click on “Theme”.
STEP 3: Then, locate 404.php error document file.
STEP 4: And paste this code, just after the first line of the code. As shown below:
<?phpheader(“HTTP/1.1 301 Moved Permanently”);header(“Location: “.get_bloginfo(‘url’));exit();?>
STEP 5: Now, save the file.
Note: If you notice your WordPress version doesn’t allow you to edit your theme, kindly install “Theme Editor plugin” and follow the steps above.
STEP 6: Now, go to your website 404 error page and it will successfully redirect you back to your homepage. That means the 301 redirect is active.
So, within a month, your SEO will get back to its previous status and your rank will get better and higher.
Benefits of 301 redirect code
1. It helps you fix 404 and other errors hurting your website.
2. It fix broken links and images.
3. Since 301 redirect means “Moved Permanently”, it helps you tell Google that you have moved permanently from one website to another.
4. It helps you transfer SEO from one website to another.
5. And many more.
Have your say in the comment section below!