If you want to hide the Add to Compare button for specific products you can use the following filter hook:

add_filter( 'woocommerce_better_compare_show_add_to_compare_button' ,'hide_compare_btn', 10, 2);
function hide_compare_btn( $show, $product ){
    
    if($product->get_id() == 123) {
		$show = false;
	}	
	
    return $show;
}

4 thoughts on “Hide compare Button for Specific Products

    • Daniel Barenkamp

      The Real Person!

      Author Daniel Barenkamp acts as a real person and verified as not a bot.
      Passed all tests against spam bots. Anti-Spam by CleanTalk.
      says:

      Into your child theme functions.php for example

  1. Ivan says:

    I wanted somehow to disable product comparison on some pages, because a woocommerce catalog and we created some product pages where we want to buy the products, but as it is the page when selecting only products it doesn’t work, so I need to release it for the entire site.

    Is there any way?

Leave a Reply

Your email address will not be published. Required fields are marked *