You are here:  » Google webmaster tools 'urls not followed' warning for sitemap links


Google webmaster tools 'urls not followed' warning for sitemap links

Submitted by kempo on Fri, 2011-10-28 18:31 in

Hi David,
I was getting the following warning for my sitemaps since the installation:

"When we tested a sample of URLs from your Sitemap, we found that some URLs redirect to other locations. We recommend that your Sitemap contain URLs that point to the final destination (the redirect target) instead of redirecting to another URL."

I have found the following solution:
Change the line 35 in pto_sitemap.php from:
 print "<loc>".pto_common_productHREF($product)."</loc>";
to:
print "<loc>".pto_common_productHREF($product)."/</loc>";
Now all the warnings has been disappeared.
So, please put this mod in Beta4
Cheers,
kempo

Submitted by support on Sat, 2011-10-29 11:03

Hi Kempo,

That will happen when using a Permalink format that does not end in "/". If you do wish permalinks to end in "/" then as an alternative to your solution I would suggest changing the return value of pto_common_productHREF as this will prevent WordPress from issuing a redirect. To do this, look for the following code at line 30 of pto_common.php:

return get_bloginfo('url').$pto_config_productBaseHREF.pto_common_hyphenate($product->normalised_name).".html";

...and REPLACE with:

return get_bloginfo('url').$pto_config_productBaseHREF.pto_common_hyphenate($product->normalised_name).".html/";

Alternatively, if you go to wp-admin > Settings > Permalinks and then either select an alternative format (numeric is ideal, you still get clean textual URLs) or of course remove the trailing forward slash from your preferred format and the sitemap links will then exactly match the product page links.

Cheers,
David.