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;
}

2 thoughts on “Hide compare Button for Specific Products

Leave a Reply

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