Hello, In this simple tutorial I will show you; how to hide your WooCommerce product price even if it’s not set to zero. You will not need to install any plugins or bang your head around on how to implement the code – everything is explained.
Also look
Remove or hide add to cart button in WooCommerce while disabling / keeping purchase
WooCommerce Hide Products Without Price (Simple Fix)
How to apply “WooCommerce Hide Product Price” Fix?
This is relatively simple; you have two options, choose one:
- Edit your functions.php file with your favorite FTP client add these functions to the end of the file.
- Edit through the WordPress theme editor located at
Appearance > Editor > functions.phpand add this functions to the end of the file.
The Fix
add_filter( 'woocommerce_get_price_html', 'react2wp_woocommerce_hide_product_price' );
function react2wp_woocommerce_hide_product_price( $price ) {
return '';
}If your theme is built the right way, and working correctly with WooCommerce, this filter should remove any memory of product pricing from the front end and still leave you the option to set up the price in the backend.
- Function: add_filter( string $tag, callable $function_to_add, int $priority = 10, int $accepted_args = 1 )
- Description:
Hook a function or method to a specific filter action. - Args:
- (string) $tag The name of the filter to hook the $function_to_add callback to.
- (callable) $function_to_add The callback to be run when the filter is applied.
- (int) $priority Used to specify the order in which the functions associated with a particular action are executed. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.
- (int) $accepted_args The number of arguments the function accepts.
- Return:
- (true)


It worked!! Thanks, do you have other code to hide the ad to cart button as this?
Hey, enjoy:
https://react2wp.com/remove-hide-add-to-cart-button-in-woocommerce-while-disabling-keeping-purchase-functionality/
Worked for me as well. Can you also enable hiding the price in the cart and at check out as well?
I will update the article as soon as I find the solution.
I was about to buy this product, but you saved me some money as i just need to hide price, any fix on how to show custom message and popup for like the plugin has?
https://codecanyon.net/item/woocommerce-hide-price-add-to-cart-by-user-roles-nonloggedin/22551626
Heyo! Thanks for the reply! you probably can achieve this by changing the returned string.
Try this:
add_filter( 'woocommerce_get_price_html', 'react2wp_woocommerce_hide_product_price' ); function react2wp_woocommerce_hide_product_price( $price ) { return 'WooCommerce disabled prices'; }Or add some HTML:
add_filter( 'woocommerce_get_price_html', 'react2wp_woocommerce_hide_product_price' ); function react2wp_woocommerce_hide_product_price( $price ) { return 'WooCommerce disabled prices. <a href="/contact">Ask for price!</a>'; }Hi Bro,
hv 2 prices showing up on my single product page,
wanted to delete the botton one above add to cart one
any idea
https://www.dropbox.com/s/wbyj6pi6txrtp7q/scrr.png?dl=0
tks man
Hi I tried your code but it didn’t work for me. Do you have any idea how I can hide the price here on my page?
https://www.launch.premiseled.com/product/hbx/
Many thanks
Hey, try this article:
https://react2wp.com/remove-hide-add-to-cart-button-in-woocommerce-while-disabling-keeping-purchase-functionality/
Hello, many thanks. It works good for me. Do you have a solution to disable showing price on specific product page not on all catogories?
Hey, here I explain all the ways you can hide a price on various WooCommerce pages:
https://react2wp.com/remove-hide-add-to-cart-button-in-woocommerce-while-disabling-keeping-purchase-functionality/
Hi, I’m having trouble with this, I need to remove both the pricing option and cart option. Do you have a code to remove both of these? Thanks,
Hey, here I explain all the ways you can hide a cart button on various WooCommerce pages, hope that helps:
https://react2wp.com/remove-hide-add-to-cart-button-in-woocommerce-while-disabling-keeping-purchase-functionality/
Hello, thank you for the snippet! Is it possible to hide just price on the product page, not also on category page?
Hey, here I explain all the ways you can hide a price on various WooCommerce pages:
https://react2wp.com/remove-hide-add-to-cart-button-in-woocommerce-while-disabling-keeping-purchase-functionality/
Worked great, thanks! How can we also hide the price in the cart and at checkout please?
Hey, here I explain all the ways you can hide a price on various WooCommerce pages:
https://react2wp.com/remove-hide-add-to-cart-button-in-woocommerce-while-disabling-keeping-purchase-functionality/
Thanks for the reply! Can I use code for disable price in specific category ?
Hey, here I explain all the ways you can hide a price on various WooCommerce pages:
https://react2wp.com/remove-hide-add-to-cart-button-in-woocommerce-while-disabling-keeping-purchase-functionality/
I m interested about your snipet Hide price for a specific product but unfortunatly it doesn t work for me ?? My product give the price From to given from Measurment price calculator woo plugin. Is there a simple hook to achieved this?
Hey, here I explain all the ways you can hide a price on various WooCommerce pages:
https://react2wp.com/remove-hide-add-to-cart-button-in-woocommerce-while-disabling-keeping-purchase-functionality/
How to hide the price of WC from archive pages?
Hey, here I explain all the ways you can hide a price on various WooCommerce pages:
https://react2wp.com/remove-hide-add-to-cart-button-in-woocommerce-while-disabling-keeping-purchase-functionality/
Thank you, And for Hide Sale Price on product and shop?
Hey, here I explain all the ways you can hide a price on various WooCommerce pages:
https://react2wp.com/remove-hide-add-to-cart-button-in-woocommerce-while-disabling-keeping-purchase-functionality/
I used this:
add_filter( ‘woocommerce_get_price_html’, ‘react2wp_woocommerce_hide_product_price’ );
function react2wp_woocommerce_hide_product_price( $price ) {
return ‘WooCommerce disabled prices’;
}
: to remove prices sitewide and add text. Worked Great!!
Can it be made to: if price = 00.00 then write script if not then leave price ?
This will help you to hide product price if price is 0 or other specific price number:
add_filter( ‘woocommerce_get_price_html’, ‘react2wp_woocommerce_hide_product_price’ ); function react2wp_woocommerce_hide_product_price( $price ) { if ( $price === __( 'Free!', 'woocommerce' ) ) { // WooCommerce changes 0 to 'Free!' automatically return ‘WooCommerce disabled prices’; } return $price; }or
add_filter( ‘woocommerce_get_price_html’, ‘react2wp_woocommerce_hide_product_price’ ); function react2wp_woocommerce_hide_product_price( $price ) { if ( $price == 'specific_price' ) { return ‘WooCommerce disabled prices’; } return $price; }Good luck!