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

Calculate distance between 2 address using latitude and longitude

To calculate the distance between two locations using their latitude and longitude coordinates, you can use the Haversine formula. The Haversine formula is commonly used to calculate the great-circle distance between two points on the surface of a sphere (such as the Earth) given their latitude and longitude.

How to add custom order status in WooCommerce

To add a custom order status and customize its email template using `register_post_status`, `wc_order_statuses`, `woocommerce_email_actions`, and `woocommerce_email_classes`, you can follow these steps:

How to Add Google reCAPTCHA

To use Google reCAPTCHA in your website, you need to obtain a reCAPTCHA API key and secret. Follow these steps to get your reCAPTCHA credentials:

How to know “Who created this coupon?”

What to do when your client ask “Who created this coupon?” . in WooCommerce.  But we don’t have any default things in WooCommerce  which automatically show author of coupon .