NO BUG: Woocommerce /?remove_item links in google search console

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.
URL: Link to a page that illustrates this issue
Video: Short screen recording that illustrates this issue (free tool: jam.dev)

The /?remove_item links on the woocommerce cart page uses a lot of crawl budget in google search console.

Is there a way to prevent this?
The page is in no-index.

Hi John,
Thanks so much for your report!

Yes, you can try the following:

  1. Block those URLs in robots.txt

User-agent: *
Disallow: /*?remove_item=

This tells crawlers not to fetch any URL containing ?remove_item=.
Google respects this and will stop crawling these URLs over time (they may still appear in the crawl stats for a while, but activity drops quickly).

  1. Add rel=“nofollow” to the “Remove” links

You can filter WooCommerce’s remove-item link and add a nofollow attribute, for example in your child theme’s functions.php or a code snippets plugin:

add_filter( 'woocommerce_cart_item_remove_link', function( $link, $cart_item_key ) {
    return str_replace( '<a ', '<a rel="nofollow" ', $link );
}, 10, 2 );

That prevents link equity and crawler focus from following to those URLs.

Best regards,
timmse