Skip to main content
Login Join
Snippet · PHP

Disable WooCommerce Product Reviews for Specific Products

Shared by Amit Dholiya · August 25, 2026 · @comments_open

2 views
Back to Snippets

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

  1. Open your theme’s functions.php file.
  2. Replace 123 with the product ID where you want to disable reviews.
  3. Add the code below.
  4. 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
);
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments