How to remove tabs in WooCommerce

To remove WooCommerce tabs in WordPress using the functions.php file, you can use the woocommerce_product_tabs filter hook. This hook allows you to modify the tabs that are displayed on product pages in WooCommerce.

Here is an example of how you can use this hook to remove the “Description” and “Reviews” tabs from product pages:

// Remove tabs in WooCommerce
// More snippets at wpunplugged.com 

function remove_woocommerce_tabs( $tabs ) {
    unset( $tabs['description'] ); // Remove the description tab
    unset( $tabs['reviews'] ); // Remove the reviews tab
    return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'remove_woocommerce_tabs', 98 );

In this example, we are using the unset() function to remove the “Description” and “Reviews” tabs from the array of tabs that are passed to the hook. You can use this same approach to remove any other tabs that you don’t want to display on your product pages.

It’s important to note that this code will only remove the tabs from the front-end of your site. If you want to remove the tabs from the back-end as well, you will need to use a plugin or additional code to do so.

Share this post

You might also like...

WP Rocket for WordPress Review
Cache

WP Rocket for WordPress Review

WP Rocket is a popular WordPress plugin that offers comprehensive caching and optimization solutions for WordPress websites. It is designed to help improve website performance,

Read More »
UpdraftPlus for WordPress Review
Backup

UpdraftPlus for WordPress Review

UpdraftPlus for WordPress is a powerful backup plugin that enables users to easily back up their website’s content, including the WordPress database, themes, plugins, and

Read More »

Comment

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