3

In WooCommerce, add to cart URLs are like example.com/?add-to-cart=3061. These URLs are set to nofollow, which IMO, means they shouldn't cause any SEO related issues. I went on a little WooShop hunt to see how other shops handle it. Every Shop I found uses the same kind of URLs to add products to the cart from within a category grid or the shop page.

My "SEO guy" is trying to tell me that these URLs are an issue and we need to remove them which (correct me if I'm wrong) isn't possible without rewriting WooCommerce core stuff. Can anybody give me a definitive answer as to why or why not these URLs are an issue?

1
  • "and we need to remove them" - Did the "SEO guy" suggest what to replace them with?
    – MrWhite
    Oct 19, 2021 at 18:09

1 Answer 1

3

nofollow doesn't mean a link won't cause any SEO related issues. nofollow means the link won't pass PageRank. However:

I no longer use nofollow as a tool to manage any internal links. nofollow is best suited for marking external links in user generated content and for marking paid links. Now Google suggests using rel=ugc and rel=sponsored for those, so I don't plan to use nofollow ever again.

I would recommend preventing "add to cart" URLs from getting crawled by disallowing them in robots.txt:

Disallow: /?add-to-cart
Disallow: /*?add-to-cart

If Googlebot can't crawl the URLs they are very unlikely to have much SEO impact. You would still "lose" PageRank that might have gone to those URLs, but in all the testing I've done that doesn't seem to matter. Discarded PageRank doesn't seem to hurt the rankings of other pages on your site.

Google might occasionally index an "add to cart" URL that it is disallowed from crawling. However, I think that is a risk worth taking. That usually only happens when the URL gets external links and when it happens it often only shows up in site: search results on Google. If you don't disallow the "add to cart" URLs Googlebot has to crawl each one of them to see that (I think) they redirect back to the product page.

I also surveyed a couple WooCommerce shops from their example sites page. Many of the sites don't use links. It looks like it is possible to use forms with buttons:

<form class="cart" action="/product/buy" method="post" enctype="multipart/form-data">
  <button type="submit" name="add-to-cart" 
  value="3061" class="single_add_to_cart_button button alt">
  Add to cart</button>
</form>

This might be preferable to a "add to cart" link:

  • Googlebot doesn't try to crawl POST forms.
  • It would eliminate any dropped PageRank.
  • It would eliminate most of the risk of the "add to cart" URLs getting indexed despite being blocked by robots.txt
1
  • thanks a lot for your helpful comment :-)
    – Lablads
    Oct 20, 2021 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.