WooCommerce: Disable Product Review Tab

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.

As it is just a product showcase, review is not required on single product detail page. There are actually two ways to disable the reviews tab.

woocommerce-proudct-page-tabs

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.

Disable-comments-screenshot

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 );

To hide just reviews tab, you guessed it, keep line 5, and comment out line 3 & 4.

Test environment:

Comments are closed.

Post Navigation