If you want to disable reviews only for selected WooCommerce products instead of disabling them across your entire store, you can use a product ID condition.
Steps
- Open your theme’s
functions.phpfile. - Replace
123with the product ID where you want to disable reviews. - Add the code below.
- Save the file.
Done — reviews will be disabled only for the selected product.
function disable_reviews_for_specific_product( $open ) {
$product_id = 123;
if ( is_product( $product_id ) ) {
return false;
}
return $open;
}
add_filter(
'comments_open',
'disable_reviews_for_specific_product',
10,
2
);