The Description, Reviews and Information tabs can be a nuisance, especially to a simple woocommerce store setup. Because WooCommerce doesn’t provide a specific class for this, you can’t simply remove the code from showing with CSS as it will effect the entire site. The easiest and simplest way is to add a function that removes the code for you. You can choose between hiding 1 or all 3 of the tabs.

You will need to edit your Themes Functions php file. It is highly recommended that you backup this file prior to editing. If you can modify it via FTP that is an even safer route as a mistake in the functions.php file can result in not being able to access your wordpress backend. If FTP is not an option simply browse to the EDITOR link, located in APPEARANCE, look on the right for THEME FUNCTIONS (functions.php). At the very end of the code, copy and paste the code and edit accordingly.

The 2nd example is how you can rename the tabs

The 3rd example shows how you can reorder the tabs.

For the original article please visit:
https://wpbeaches.com/hide-the-description-and-reviews-tabs-in-woocommerce-products/

//Remove WooCommerce Tabs - this code removes all 3 tabs - to be more specific just remove actual unset lines
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
 unset( $tabs['description'] );      	// Remove the description tab
 unset( $tabs['reviews'] ); 			// Remove the reviews tab
 unset( $tabs['additional_information'] );  	// Remove the additional information tab
 return $tabs;
}
//Rename WooCommerce Tabs - this code renames tabs - just include the tab line you want renamed and change the name in paranthesis, ie 'More Information' etc
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
 $tabs['description']['title'] = __( 'More Information' );		// Rename the description tab
 $tabs['reviews']['title'] = __( 'Ratings' );				// Rename the reviews tab
 $tabs['additional_information']['title'] = __( 'Product Data' );	// Rename the additional information tab
 return $tabs;
}
//Re-order WooCommerce Tabs - this code reorders tabs - the higher the priority(lowest number) goes first
add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {
 $tabs['reviews']['priority'] = 5;			// Reviews first
 $tabs['description']['priority'] = 10;			// Description second
 $tabs['additional_information']['priority'] = 15;	// Additional information third
 return $tabs;
}

Having Similar Issues?


Leave a Reply

Your email address will not be published. Required fields are marked *