Remove Product Prices
In this tutorial I will show a correct way of removing product prices from single product pages and shop page (product archives).
There are plenty of tutorials out there that recommend you to use
woocommerce_get_price_html hook which is totally wrong, because that hook is intended to edit the HTML of the price element. We are not going to hide prices with CSS as well.
WooCommerce connects product prices to hooks:
woocommerce_after_shop_loop_item_title– for product archive pages,
woocommerce_single_product_summary– for single product pages.
So all we need to do is to disconnect price displaying functions from these hooks!
Please insert all the code from this tutorial to your current theme
functions.php file. Of course if you update your theme from time to time, it would be better if you prefer either a child theme or your custom plugin for that.
One more thing – maybe you don’t even need to hide product prices that way – consider making products non-purchasable.
Remove Price from Single Product Page
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
Hmm… while looking at this screenshot I have a feeling, that we do not need a “Sale” badge after all, you can read in this tutorial how to remove it.
Remove Prices from Shop Page
I have to say that this approach will also hides product prices from product categories and tags archives, search results page, related products, upsells and cross-sells.
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
If you have any questions – maybe you would like to hide prices in certain product categories only or only for some user roles – feel free to ask in comments below.