Pawan Kumawat

How to Remove Product Tabs on Product Page

To remove product tabs on the WooCommerce product page, you can use the `woocommerce_product_tabs` filter. This filter allows you to modify or remove the default product tabs provided by WooCommerce. By removing the tabs you don’t want, you can customize the product page layout to suit your needs.

Here’s an example of how to remove the product tabs from the product page:

// Remove product tabs on the product page
function remove_product_tabs( $tabs ) {
    unset( $tabs['description'] ); // Remove the "Description" tab
    unset( $tabs['additional_information'] ); // Remove the "Additional Information" tab
    unset( $tabs['reviews'] ); // Remove the "Reviews" tab

    return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'remove_product_tabs', 99 );

 

Add the above code to your theme’s `functions.php` file or a custom plugin. The `remove_product_tabs` function removes the product tabs by unsetting them from the `$tabs` array.

In the example above, we’ve removed the “Description,” “Additional Information,” and “Reviews” tabs. If you want to keep some tabs and remove others, simply remove the corresponding `unset` lines for the tabs you want to keep.

By using this filter, you can easily customize the product page layout and remove any unnecessary tabs to create a more streamlined and focused product page for your WooCommerce store.

Categories

Related Blogs

Upload Any File in My Account Registration Form

To allow users to upload a file in the My Account registration form in WooCommerce, you’ll need to customize the registration form and add a file upload field. We’ll use a custom function and a hook to achieve this. Here’s a step-by-step guide: