# Turn Off Reviews for a Product Category

> Disables reviews on products in chosen categories, such as made-to-order or services, while every other product keeps its Reviews tab.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, reviews, categories
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-close-reviews-for-category/

## Code

```php
$wpide_no_review_cats = array( 'services', 'bespoke' ); // Category slugs.

add_filter( 'comments_open', function ( $open, $post_id ) use ( $wpide_no_review_cats ) {
    return ( $open && 'product' === get_post_type( $post_id ) && has_term( $wpide_no_review_cats, 'product_cat', $post_id ) ) ? false : $open;
}, 20, 2 );

add_filter( 'woocommerce_product_tabs', function ( $tabs ) use ( $wpide_no_review_cats ) {
    global $product;

    if ( $product instanceof WC_Product && has_term( $wpide_no_review_cats, 'product_cat', $product->get_id() ) ) {
        unset( $tabs['reviews'] );
    }

    return $tabs;
}, 98 );
```

## Notes

Existing reviews are kept in the database but hidden along with the tab.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Turn Off Reviews for a Product Category" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
