Have you ever wanted to remove or disable a particular tab, or tabs, from your WooCommerce store?
The snippet below will allow you to do just that, from your theme’s functions.php file.
Remove Tabs from WooCommerce
Add the snippet below to your child theme’s functions.php file. Be sure to remove the tabs you wanted (the code below will disable (“unset”) all three tabs: description, reviews and additional information) – it seems likely you won’t want to remove all three. Or maybe you do? If so, leave ’em all in there!
Remove all three tabs from WooCommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
// Remove the tabs from woocommerce - posted by Robin Scott of Silicon Dales @ https://silicondales.com/tutorials/woocommerce-tutorials/remove-tab-woocommerce/
The code below will remove the description tab, but leave the other two tabs:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
// Remove the description tab from woocommerce - posted by Robin Scott of Silicon Dales @ https://silicondales.com/tutorials/woocommerce-tutorials/remove-tab-woocommerce/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
// Remove the reviews tab from woocommerce - posted by Robin Scott of Silicon Dales @ https://silicondales.com/tutorials/woocommerce-tutorials/remove-tab-woocommerce/
Remove the “Additional Information” tab, leaving the other two
The following code will remove only the additional information tab.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
// Remove the additional information tab from woocommerce - posted by Robin Scott of Silicon Dales @ https://silicondales.com/tutorials/woocommerce-tutorials/remove-tab-woocommerce/
As you can see in the examples above, you can mix and match the “unset” parts to achieve your desired result. You could get “clever” and add things like “If” statements to selectively target (say) products in a certain category or tag… but we’ll leave this for another time, as its beyond the scope of this particular post! As the function is called `woo_remove_product_tabs` in all the examples, though, don’t post more than one of the above… unless you rename the function to be something else.
But you’re on the road to becoming a PHP developer once you have your head around this type of function. Have a play with it, and try to build your own in future!
Where to put this code
This code should be placed into the functions.php file in your child theme, assuming you have a child theme (try not to place code into your parent theme – particularly if you don’t know the difference between a child theme and a parent theme!), or a helper plugin, or, a snippets plugin which you install to contain these.
Leave a comment below if this helped or didn’t work to remove a tab or tabs from WooCommerce.
1 thought on “How to Remove a Tab from WooCommerce”
How can I remove “Store Policies” tab . I tried “”add_filter( ‘wcfm_is_allow_product_policies’, ‘__return_false’ );”” But the tab is not removed. Please help
How can I remove “Store Policies” tab .
I tried “”add_filter( ‘wcfm_is_allow_product_policies’, ‘__return_false’ );”” But the tab is not removed. Please help