404 tag errors on Google Search Console
-
I could barely find the same problem that’s close to mine in stackoverflow but unfortunately there were no answers !!: Tag pages are causing Crawl Errors (Not found) for Doubleclick Ads
The thing is I recently received many 404 errors regarding tags. all of them contain two tags coming after each other linking from https://website.com/tag/mytag/feed/ like the following:
website.com/tag/my-tag-1/my-tag-2
(I had my feed disabled by WP Hide Security Enhancer. but I’m not sure if this is the reason why)
On the other side I have some internal links in my posts as well that are some sort of connected to the issue. I used the following piece of code for my internal links:
<a href="../myslug/" rel="noopener" target="_blank">my des text here</a>
I replaced my web link with ../ because I thought that I might change the domain name some day so that I didn’t have to replace them. I believe that’s why I’m seeing such issues because every tag is sort of related to those pages having these internal links and since I stopped using ../ for my new posts I didn’t come up with any errors!
This may have something to do with Yoast sitemap as well because I guess it all started when I set the sitemap and put the links in my robot.txt like this :
User-agent: * Allow: /wp-content/uploads/ Allow: /wp-admin/admin-ajax.php Disallow: /readme.html Disallow: /wp-admin/ Disallow: /wp-content/plugins/ Disallow: /refer/ Sitemap: https://website.com/post-sitemap.xml Sitemap: https://website.com/page-sitemap.xml Sitemap: https://website.com/category-sitemap.xml Sitemap: https://website.com/post_tag-sitemap.xml
Can someone please explain to me why this is happening and how to fix it ?!! I got no single idea how to fix this. should I replace ../ with my web address and redirect them one by one using a Redirection plugin ?!! but the problem is I have no idea which tag is related to my issue not to mention that I’m not sure enough that those internal links are the cause of the issue.
or maybe I should redirect the all to my home page using this in my theme 404.php file :
<?php header("HTTP/1.1 301 Moved Permanently"); header("Location: ".get_bloginfo('url')); exit(); ?>
Any idea on this would be helpful.
- The topic ‘404 tag errors on Google Search Console’ is closed to new replies.