Not every product needs a review section. If you sell items where customer feedback isn’t useful, or you want to keep certain product pages cleaner, you can turn off reviews just for those categories without affecting the rest of your store.
In this guide, you’ll learn how to use a simple WooCommerce snippet to disable product reviews for selected categories. It’s a practical way to manage reviews more precisely while keeping them available wherever they matter.
Why Disable Reviews for Selected WooCommerce Categories?
A review form can build confidence on one product page and feel out of place on another. Choosing where customer feedback appears lets you keep useful reviews while avoiding clutter or irrelevant comments in parts of your catalog.
Products and situations suited to category-level review controls
Some products naturally invite opinions, while others are purchased for practical reasons or have little variation in customer experience. Category-level controls help you match the review experience to the kind of product being sold.
For example, you might keep reviews enabled for apparel, where fit and feel can guide future buyers, but disable them for categories such as:
- Digital downloads or service-related products that don’t have a physical experience to assess.
- Replacement parts and technical components where compatibility details matter more than general opinions.
- Custom or made-to-order items whose specifications vary from one purchase to another.
- Clearance or discontinued products that are no longer part of your active range.
This approach can also help when reviews are managed through another channel or when a category contains products with sensitive, highly specific use cases. Consider how shoppers use each category before turning off feedback, since reviews may still provide valuable reassurance for unfamiliar products.
Once you’ve identified where reviews don’t serve shoppers, the next choice is whether to change one store-wide setting or apply a more targeted rule.
How WooCommerce disable product reviews by category differs from global settings
WooCommerce’s global review setting applies broadly across your product catalog. Turning reviews off there can remove the review option from products where customer feedback is still helpful, so it may be too blunt for stores with varied inventory.
A category-based snippet takes a more selective approach: it checks a product’s assigned category and disables reviews only when that category matches your chosen rules. This lets you keep reviews available elsewhere without changing the store-wide setting for every product.
Before adding the snippet, check products assigned to multiple categories. A product may match a category where reviews are disabled even if it also appears in a category where they remain enabled. Testing a few representative product pages helps confirm the behavior fits your catalog.
WooCommerce disable product reviews by category with a PHP snippet
Once you know which parts of your catalog should stay review-free, the next step is connecting that choice to WooCommerce. A small PHP snippet can check each product’s categories and hide its review tab when it matches your list.
First, identify the category slugs you want the rule to cover. Then add and test the code in a way that’s easy to maintain.
Find the product category slugs to target
The snippet uses category slugs, not the category names shoppers see. Slugs are usually lowercase and use hyphens instead of spaces, making them straightforward to add to a PHP array.
In your WordPress dashboard, go to Products → Categories. Find the category and check its slug in the table, or open it to view the slug field. For example, “Digital Downloads” might have the slug digital-downloads.
Write down each slug you want to target, and check for spelling or punctuation differences. A mismatched slug won’t cause an error, but the rule won’t apply to that category.
Add the WooCommerce disable product reviews by category code safely
With your slugs ready, add the code below using a child theme’s functions.php file or a trusted snippets plugin. A snippets plugin can make the code easier to switch off if you need to troubleshoot.
addfilter( 'commentsopen', 'mydisablecategoryproductreviews', 10, 2 );
function mydisablecategoryproductreviews( $open, $postid ) {
if ( 'product' !== getposttype( $postid ) ) {
return $open;
}
$disabledcategories = array(
'digital-downloads',
'replacement-parts',
);
if ( hasterm( $disabledcategories, 'productcat', $postid ) ) {
return false;
}
return $open;
}
addfilter( 'woocommerceproducttabs', 'myremovecategoryreviewstab', 98 );
function myremovecategoryreviewstab( $tabs ) {
if ( isproduct() ) {
$disabledcategories = array(
'digital-downloads',
'replacement-parts',
);
if ( hasterm( $disabledcategories, 'productcat', gettheID() ) ) {
unset( $tabs['reviews'] );
}
}
return $tabs;
}Replace the example slugs with yours, keeping each inside quotes and separating entries with commas. Back up your site first, and test the change on a staging site if one is available.
How the snippet checks each product’s categories
The first filter checks whether the item is a product, then uses hasterm() to compare its assigned categories with your list. When a match is found, it closes comments; otherwise, it returns the existing setting unchanged.
The second filter removes the reviews tab for matching product pages. This matters because products with existing reviews may otherwise still show the tab. The snippet does not delete existing reviews; it prevents new review access through the product page.
Customize the category list without affecting other products
To change which categories are covered, update the slug arrays in both parts of the snippet. Keep the two lists identical so the review form and tab follow the same rule.
A product assigned to several categories will match if any assigned category is listed. To avoid surprises, test a product from each targeted category and one from a category where reviews should remain enabled.
Test and Maintain Your Review Settings
The code is in place, but a quick check can catch category mismatches or display quirks before shoppers do. A few targeted tests will help confirm the rule works across your catalog and remains reliable after site updates.
Start with a product from a category on your list, then compare it with one that should still accept feedback.
Confirm reviews are disabled for products in selected categories
Open a targeted product page in a private or logged-out browser window. Check that the reviews tab is gone and that no review form appears; then visit a product outside the selected categories to make sure its review option remains available.
Also test products assigned to multiple categories. Because the snippet matches if any assigned category is on the disabled list, a product in both “Apparel” and “Digital Downloads” will have reviews disabled if the latter is targeted. If results differ from what you expect, verify the slugs and category assignments in the dashboard.
Once the basic behavior checks out, look for factors that can make the storefront display an older or theme-specific version of the page.
Troubleshoot caching, themes, and existing reviews
If the tab still appears, clear your site, server, and browser caches, along with any cache managed by a CDN. Then reload the product page. A cached page can show the previous layout even when the snippet is working correctly.
Some themes or review-related extensions customize product tabs or review forms. Temporarily test with a default theme on a staging site, or disable related extensions one at a time, to identify a conflict. The snippet does not erase existing review data; it closes comments and removes the tab on matching product pages. Reviews may still be visible through custom layouts, widgets, or other plugins, so check those separately.
If maintenance becomes difficult, or your rules need more than category matching, a plugin may offer a clearer way to manage them.
When to choose a plugin over WooCommerce disable product reviews by category
The snippet is a good fit when you need a simple, stable rule and are comfortable maintaining a small amount of PHP. A plugin may be preferable if non-technical staff need to change settings, or if review behavior depends on several conditions.
Consider a plugin when you need controls such as per-product exceptions, role-based permissions, or different rules for imported products. Before installing one, check that it supports your WooCommerce version and theme, and confirm whether it hides reviews or deletes them. Choose one method of control where possible; overlapping snippets and plugins can make troubleshooting harder.
Keep Reviews Where They Help—And Turn Them Off Where They Don’t
Disabling reviews by category gives you more control than WooCommerce’s global setting, helping you keep useful feedback available while creating cleaner product pages for categories where reviews add little value. A small PHP snippet can apply that rule without deleting existing review data.
Before making the change, confirm your category slugs, add the code safely, and test products both inside and outside the selected categories—including items assigned to multiple categories. If the results look wrong, check caching, theme behavior, and review-related plugins.
For straightforward category rules, this approach offers a practical way to manage WooCommerce product reviews. If you need non-technical controls or more complex conditions, consider a compatible plugin instead. Choose the method that best fits your store, and make sure shoppers can still find reviews wherever their feedback matters most.