DEV Community


Posted on

ways to Disable WooCommerce Reviews Tab In WordPress

When working with plugin like WooCommerce, it is hard to avoid customization, a lots of it. In my recent project, I adopted WooCommerce to achieve product management without shopping cart experience. You guessed it, disable and hide so many options.

Option 1: Using a Plugin

Disable Comments is a plugin that allows administrators to globally disable comments on any post type, including custom post type. As review is just using comments feature for Product (custom post type). So we can disable product review and hide the tab in product page by just disabling comment on Product.

Option 2: woocommerce_product_tabs filter

The other way is to use woocommerce_product_tabs filter provided by WooCommerce plugin. The filter gives us direct control to hide the tab(s) we don’t need.

// Disable product review (tab)
function woo_remove_product_tabs($tabs) {
    unset($tabs['description']);                // Remove Description tab
    unset($tabs['additional_information']);     // Remove Additional Information tab
    unset($tabs['reviews']);                    // Remove Reviews tab

    return $tabs;

add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );

Enter fullscreen mode Exit fullscreen mode

Reference Blog
ways to Disable WooCommerce Reviews Tab In WordPress

Top comments (0)