Woocommerce Hide Product Price Tutorial

Woocommerce hide product price on your shop

Welcome to the Woocommerce hide product price tutorial. So you got your Woocommerce shop set up with products. Let’s say you are not interested in selling, only a view catalog for your products. This feat can be easily accomplished with WordPress + Woccomrence plugin. In order to accomplish a catalog based platform with Wocommerce, you will need to perform some tweaks, one of them is to hide the price of products.

why would we want to hide product prices?

  1. As mentioned above, Catalog purposes.
  2. Integrate specific purchases for specific products – let’s say you have a big product that you don’t want to display its price in your shop. we can teak things up to be even more specific with hiding prices.
  3. For out of stock products

Woocommerce hide product price: How?

In order to accomplish our feat, we will have to take a few approaches into consideration. The first approach is the easiest one. This is Woocommerce default built-in way of hiding prices.
WooCommerce -> Settings -> Products -> Inventory
Check the box. For the practical part look at the image below:
Woocommerce hide product price
Woocommerce hide product price
This first way is the easiest, in addition to the default way we can achieve this feat by code as well. Why? well if for some reason that option isn’t working( That Happens ), we need to intervene. Make no mistake, first of all, try the first method.

Woocommerce Hide Product Price by means of a plugin

Well, if the first option didn’t make it happen for you for some reason, you can achieve the same result with a plugin. I do not recommend this approach for such an easy feat. If you must and you do not desire to jump in and paste a few lines of code than use one of the plugins available on the WP PLUGIN REPO.

Woocommerce Hide Product Price with the use of code

Furthermore, we have the way of the code:

add_action( 'woocommerce_product_query', 'codelikepro_hide_products_without_price' );
function codelikepro_hide_products_without_price( $q ){
   $meta_query = $q->get( 'meta_query' );
   $meta_query[] = array(
      'key'       => '_price',
      'value'     => '',
      'compare'   => '!='
   );
   $q->set( 'meta_query', $meta_query );
}

Copy this code, paste it into your functions.php file, it will certainly work 🙂

conclusion

In conclusion, I’m glad you’ve spent the time reading my Woocommerce Hide Product Price Tutorial. Hope you now have an idea about how to hide prices of products. In my opinion always try the easiest approach, in this case, its the first. if that doesn’t work i usually roll back to the third approach, by means of  CODE.
For More Info Visit WooCommerce Documentation Here.
For More Code Snippets Visit Here.

One Reply to “Woocommerce Hide Product Price Tutorial”

  • Gabby says:

    Hi! I am looking for some help, I am trying to hide the price and have used your code but it doesn’t seem to be working. Please help, I have been trying to do this for hours, in desperate need!

    Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *