By default, WooCommerce shows your product’s shipping information on the product page in the “Additional Information” tab. Sometimes this may not be appropriate or necessary for a product, so let’s find a way to remove it! On a default installation of WooCommerce with a Storefront theme, the product page will look something like this:
This Additional Information tab can be used for more than just the shipping information though. On variable products, you will commonly see all the attributes listed here. But attributes aren’t limited to just variable products. You can set up attributes just for the purpose of showing them in this additional information tab. Just ensure this setting is checked:
Remove the shipping information on all pages with a filter
We have a few options few removing this area. The best way, in my opinion, is to use the following filter. With this method, your additional information tab will still show up if there are attributes set to show on the product page. You can paste this in your child theme’s functions.php file:
add_filter( 'wc_product_enable_dimensions_display', '__return_false' );
Remove the whole additional information tab on all pages with some CSS
A quick and dirty way to do this is to just add a little bit of custom CSS to remove the whole tab. Note that this will also remove attributes from showing up in the tabs:
li.additional_information_tab {
display: none !important;
}
Remove the whole tab on all pages with PHP
This method will also prevent any attributes from showing up because we are removing the whole additional information tab. Nevertheless, here is a function to remove the whole tab. Didn’t know you could manage tabs like this? Well, I might just make a blog post about that one day:)
function wc_ninja_hide_additional_info_tab( $tabs = array() ) {
unset( $tabs['additional_information'] );
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'wc_ninja_hide_additional_info_tab', 10 );
Conditionally remove the shipping information with the filter
But what if you just want to remove the shipping information for a specific product? Well look no further:
function wc_ninja_hide_shipping_information() {
// The product ID you want to hide shipping information on
$special_product = '70';
if ( is_single( $special_product ) ) {
add_filter( 'wc_product_enable_dimensions_display', '__return_false' );
}
}
add_filter( 'wp', 'wc_ninja_hide_shipping_information', 10 );
Article Bonus:
While we are talking about product tabs, did you know you could manage these with this neat little tab manager extension? Or better yet, you can add a product contact form with this extension. More of a DIY kinda person? Check out this blog post by Nicola about manually adding an enquiry form on the product page.