How to hide price in WooCommerce: 4 simple methods (and code)
Hiding prices from public view is necessary for wholesale stores, catalog sites, and many other situations. But, unfortunately, WooCommerce doesn't include any built-in way to hide product prices.
Don't worry, though! It's definitely doable, you'll be able to hide WooCommerce product prices by following the steps in this guide.
For example:
- WooCommerce wholesale stores might want to remove the price from retail customers (while still letting authenticated wholesale customers see the wholesale price).
- A browsable catalog of products can display items without prices if you don't actually want to sell them through your website.
- Similar to a wholesale store, you could create a members-only WooCommerce store where registered shoppers must login to see prices.
Keep reading to discover how to hide prices in WooCommerce for these use cases and more. By the end, you'll be able to completely hide prices for all visitors or conditionally hide prices by user role/logged-in status. Some visitors will see the price as usual, and others will see the WooCommerce products without price.
Recommended ways to hide prices in WooCommerce
In this WooCommerce hide price tutorial, I'm going to share several different methods with you. Read through the options and decide the best way to hide product prices...
- Option 1 - Hide prices from logged out usersUse the Wholesale Pro plugin to hide prices from logged out WooCommerce users. Learn more.
- Option 2 - Hide prices in product tablesUse the WooCommerce Product Table plugin to list products without prices. Learn more.
- Option 3 - Hide prices in quick view lightboxesUse the WooCommerce Quick View Pro plugin to create product lightboxes with no pricing. Learn more.
- Option 4 - Hide prices from public viewUse the WooCommerce Private Store or WooCommerce Protected Categories plugins to hide products completely, instead of just hiding prices. Learn more.
You can also hide prices using code. I'll share some code snippets for this at the end, since this is only recommended for developers.
Option 1 - Hide prices from logged out users
First, let's look at the most dynamic option. This can conditionally hide WooCommerce product prices from logged in users. Prices appear as normal for logged in users. They simply login to WooCommerce to see prices.
To use WooCommerce to only show prices when logged in, you need the WooCommerce Wholesale Pro plugin. Hiding prices in WooCommerce with this plugin lets you:
- Show/hide prices for users who are not logged in.
- Display different prices and tax information depending on the user's role.
For example, if you're running a wholesale store, this would let you make your product catalog public, but only show prices to people who register for a wholesale seller account.
While the plugin is mostly designed for wholesale stores, you don't have to use it for wholesale. You can just use it to remove the WooCommerce price for guest users so that people must log in to see the price of each product.
How to set it up
Once you install and activate the WooCommerce Wholesale Pro, go to WooCommerce → Settings → Wholesale. Simply tick the 'Hide price until login' box and save the page.
Now, the price will be hidden to non-logged in users everywhere on your site. It also disables the buy buttons from logged out users. If you disable prices in WooCommerce, then they can't make a purchase!
WooCommerce Wholesale Pro integrates perfectly with WooCommerce Product Table. (In fact, you can save money by buying both plugins together as a bundle.) This means you can create a product table that does include a price column, but only displays the price in the column if a user has a certain role or is logged in.
WooCommerce hide price by user role
In addition to hiding price by logged-in status, the same WooCommerce hide price plugin also lets you conditionally hide prices and show different pricing based on a user's role.
For example, if you're running a public and wholesale store, then it works like this:
- Logged out users are in catalog-mode, where they can't see prices or buy buttons.
- Logged in users with the default 'customer' role can see your normal product pages.
- Wholesale roles are shown the correct price for their role.
Clever!
Further reading: How to use the WooCommerce Hide Price Until Login plugin.
Exploring real-world applications of the WooCommerce Wholesale Pro plugin
The most obvious real-world application for WooCommerce Wholesale Pro is B2B wholesale websites. That's not surprising, given its name 😀. However, that is only one of many ways that you can use this hide price until login plugin.
In fact, there are lots of reasons why you might want to hide prices based on user role. For example:
- An exclusive members-only purchasing club might display products publicly, while only showing prices to logged in users. That way, the products can still rank in search engines for SEO purposes, while also attracting new members to join. However, they can only be purchased by logged in users.
- Similarly, you might sell branded products to regular customers only, such as schools, sportswear or workwear. It's fine to display these products in the public areas of your WooCommerce store, for example so that potential customers are more likely to make an enquiry. However, you would want to hide the prices until login by an authorized user.
Once people have logged in to reveal the hidden prices, you can sell to them as usual. For example, this might involve using other plugins to set a minimum order price amount or set product prices based on quantity.
Related tutorial: How to set custom prices in WooCommerce: 3+ plugins.
Option 2 - Hide prices in product tables
In option 2, we'll learn how to completely eliminate price from the equation for all visitors. For example, you could use this to create a catalog page with a searchable directory of all your products.
For this use case, you'd likely want to:
- Hide all mention of prices
- Hide the add to cart button
To set this up, you can use WooCommerce Product Table to create a table view catalog of products. This also has the benefit of adding user-friendly filters and search options to help shoppers browse your catalog.
It's an alternative to the default WooCommerce shop page that you can use to completely replace the shop page. Alternatively, you can use it to list products in addition to the WooCommerce shop page.
Hiding prices in WooCommerce with this plugin lets you control exactly which columns display in your product table. This makes it easy to remove the product price from WooCommerce, or even remove the add to cart buttons completely.
If you're just looking to create a catalog or table listing and you want to hide the price from all users, WooCommerce Product Table is all you need. Or if you want to remove the price for logged out users only, then you also need the WooCommerce Wholesale Pro plugin from Option 1.
How to create a catalog page with no price or add to cart button
- Install WooCommerce Product Table on your WordPress site.
- Create a new product table via Products → Product Tables.
- On the first page of the table wizard, choose whether to create a standalone catalog page or to enable the catalog view on your main shop page templates.
- The next page will depend on your previous answer. You can either choose which products will appear on the manually created catalog page, or select which WooCommerce shop template pages will use the catalog view.
- On the 'Columns' page, choose what product data to include in the catalog. Remember not to include a price column! Use the pencil icon to change the column names as needed.
- The final page of the wizard will provide a shortcode for inserting the table. Use this shortcode on any page to display the table, or use the 'Product Table' Gutenberg block to insert the table you just created. (If you opted to show the table on your shop page templates then you don't need to do anything further to add the table.)
Now view the page. It will look something like this:
Disable links to the single product page
By default, WooCommerce Product Table will add links to the single product page - for example, the product name will be clickable. To ensure that visitors can't click through to the single product page (and see the price and add to cart button there), you'll also want to disable the links on each column as follows:
- Go to Products → Product Tables and edit the table you just created.
- Find the 'Columns' section and click the pencil icon on each column.
- Disable the 'Link to the product page' toggle.
Option 3 - Hide prices in quick view lightboxes
Another user-friendly option is to stack WooCommerce Product Table with the WooCommerce Quick View Pro plugin. When a user clicks on a product name, it opens the product quick view box instead of taking them to the single product page.
The benefit of adding product quick view functionality is that customers can view more information each product, without visiting the actual product page (which lists your prices).
Quick View Pro gives you built-in options to disable the add to cart button and disable price display in WooCommerce. That way, it lets shoppers view more details about your products without exposing the price.
How to add product quick view without prices
- Install WooCommerce Quick View Pro on your WordPress site.
- Go to the plugin settings page at WooCommerce → Settings → Products → Quick view, or use the setup wizard which opens automatically.
- Activate your license key then disable the 'Show price' and 'Show add to cart button' options.
- Go back to the product table you created earlier and edit it. (Products → Product Tables). Add a 'Quick view' column to the product table.
You can also use WooCommerce Quick View Pro with the WooCommerce Wholesale Pro plugin from Option 1. This lets you show prices in the quick view lightbox to logged in users only.
To do this, enable the 'Hide Price Until Login' feature in WooCommerce Wholesale Pro, and enable prices in Quick View. That way, logged out users will see the quick view lightbox without prices. Whereas logged in users will see prices as usual.
Option 4 - Hide prices from public view
The above solutions assume that you want to hide the prices for otherwise public products. That is, you want everyone to be able to see the product details – you just don't want people to be able to see the prices.
However, if you don't want unauthenticated shoppers to be able to see any part of your products, you might want to:
- Make your entire store private, either by adding a password or requiring people to log in to browse your store.
- Make a specific product category (or specific categories) private, either by adding a password or requiring people to log in to browse the private categories.
Or, if you're specifically looking to hide WooCommerce prices to create a wholesale store where wholesale customers can see prices, but retail customers cannot, then you might want to check out our complete guide to creating a WooCommerce wholesale store. This guide will teach you how to offer different prices for retail customers and wholesale customers, rather than completely hiding prices. You can also learn how to set up a price per unit or WooCommerce paywall.
How to hide prices in WooCommerce using code
As you can see, the plugins featured above make it easy to hide prices in WooCommerce without needing any technical know-how. Before we finish, I'll share some simple PHP code snippets for hiding prices either storewide, per category, or per product. These don't have advanced features such as showing prices to certain user roles. If you need those then I recommend using one of the plugins featured above, instead of custom code.
Experienced developers can use the following code snippets to add to their theme or child theme's functions.php file or via a separate utility plugin.
Code snippet: Hide prices storewide
This code snippet will hide prices for all your WooCommerce products and display a custom message instead.
<?php /** * Custom Code to Hide All Product Prices Storewide * * Place this code in your theme's functions.php file or a custom plugin. */ /** * Remove price and add-to-cart button for all products. */ function custom_hide_prices_storewide() { // Hide price by filtering the price HTML output. add_filter( 'woocommerce_get_price_html', 'custom_replace_price_with_message', 10, 2 ); // Remove add-to-cart button on single product and shop pages. remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); } add_action( 'wp', 'custom_hide_prices_storewide' ); /** * Replace product price with a custom message. * * @param string $price Existing price HTML. * @param object $product Product object. * @return string Modified price HTML. */ function custom_replace_price_with_message( $price, $product ) { return '<span style="color: red; font-size: 14px;">Call our office at <strong>516.695.3110</strong> for pricing information.</span>'; }
Edit the "Call our office" text with whatever you'd like to appear in place of the hidden prices.
Code snippet: Hide prices from products in specific categories
<?php /** * Custom Code to Hide Product Prices Based on Specific Categories * * Place this code in your theme's functions.php file or a custom plugin. */ /** * Remove price and add-to-cart button for products in specific categories. */ function custom_hide_prices_for_categories() { if ( is_product() ) { custom_handle_price_visibility( get_the_ID() ); } } add_action( 'wp', 'custom_hide_prices_for_categories' ); /** * Modify product display based on category association. * * @param int $product_id Product ID. */ function custom_handle_price_visibility( $product_id ) { $hidden_price_category_ids = array( 12345, 67890 ); // Replace with your category IDs. // Retrieve the categories associated with the product. $product_categories = get_the_terms( $product_id, 'product_cat' ); if ( ! $product_categories || is_wp_error( $product_categories ) ) { return; } // Extract category IDs from the terms. $product_category_ids = wp_list_pluck( $product_categories, 'term_id' ); // Check if any of the product's categories match the hidden price categories. if ( array_intersect( $hidden_price_category_ids, $product_category_ids ) ) { // Hide price and add-to-cart button. add_filter( 'woocommerce_get_price_html', 'custom_replace_price_with_message', 10, 2 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); } else { // Ensure filters and actions are restored for other products. remove_filter( 'woocommerce_get_price_html', 'custom_replace_price_with_message', 10, 2 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); } } add_action( 'woocommerce_before_shop_loop_item', 'custom_handle_price_visibility', 5 ); /** * Replace product price with a custom message. * * @param string $price Existing price HTML. * @param object $product Product object. * @return string Modified price HTML. */ function custom_replace_price_with_message( $price, $product ) { return '<span style="color: red; font-size: 14px;">Call our office at <strong>123.456.7890</strong> for pricing information.</span>'; }
Modify the code snippet as needed to hide WooCommerce prices in the way you require. This should include adding the ID's of the categories you wish to hide the prices from, and editing the "Call our office" text.
Code snippet: Hide prices from specific products
This code snippet lets you hide prices for specific individual products. Again, replace the ID's with the correct product ID's, and modify the text to appear in place of the hidden prices.
<?php /** * Custom Code to Hide Product Prices for Specified Products * * Place this code in your theme's functions.php file or a custom plugin. */ /** * Remove price and add-to-cart button for specific products. */ function custom_hide_prices_for_products() { if ( is_product() ) { custom_handle_price_visibility_for_product( get_the_ID() ); } } add_action( 'wp', 'custom_hide_prices_for_products' ); /** * Modify product display based on product ID. * * @param int $product_id Product ID. */ function custom_handle_price_visibility_for_product( $product_id ) { $hidden_price_product_ids = array( 123, 456, 789 ); // Replace with your product IDs. // Check if the current product ID is in the hidden price list. if ( in_array( $product_id, $hidden_price_product_ids, true ) ) { // Hide price and add-to-cart button. add_filter( 'woocommerce_get_price_html', 'custom_replace_price_with_message', 10, 2 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); } else { // Ensure filters and actions are restored for other products. remove_filter( 'woocommerce_get_price_html', 'custom_replace_price_with_message', 10, 2 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); } } add_action( 'woocommerce_before_shop_loop_item', 'custom_handle_price_visibility_for_product', 5 ); /** * Replace product price with a custom message. * * @param string $price Existing price HTML. * @param object $product Product object. * @return string Modified price HTML. */ function custom_replace_price_with_message( $price, $product ) { return '<span style="color: red; font-size: 14px;">Call our office at <strong>123.456.7890</strong> for pricing information.</span>'; }
Where to get the plugins
There are lots of reasons why you might want to show a WooCommerce product without price. Learning how to hide prices in WooCommerce gives you more control over who has access to important pricing information. It's an especially great tactic for wholesale stores, though you can also use it for catalog sites, members-only stores, or any other situation where you just don't want product prices to be visible right away.
To recap, there are several plugins that hide prices in WooCommerce:
- Hide prices from logged out usersUse WooCommerce Wholesale Pro to hide prices from logged out visitors.
- List products in a table without pricesUse WooCommerce Product Table to list products without prices.
- Create quick view lightboxes without pricesUse the WooCommerce Quick View Pro plugin to create product lightboxes without prices.
- Make your whole store or specific categories privateUse WooCommerce Private Store or WooCommerce Protected Categories to hide products completely.
To get started, grab your chosen plugin(s) and start hiding prices in WooCommerce.
Have any questions about how to add WooCommerce hide price functionality to your store? Ask away in the comments!
15 Comments
I was just looking for it. Thank you for sharing.
Hi, Keith. Thanks for your comment. Glad this helped!
Hi! Thanks for all the info.
I was wondering if in any of this cases, if you just hide the product price the user can still add to cart the product and complete the purchase? That is what I need to achieve: do not show product price, but let the user to make a purchase, and then the shop admin will contact the user an share the final price.
Is this possible with one of this plug ins?
Hi, Daniela. Thanks for asking. While you can use either Option 2 or 3 to allow customers to add products to the cart without showing the product prices, please note that the prices will still be displayed by default in the WooCommerce cart page.
To allow customers to make a purchase without showing the product prices even in the cart and checkout pages, I suggest that you contact official WooCommerce Support for the best advice.
I want to mention Hidden price price with article number in picture (jpg format) in such way that i can Inform my wholesale client to find the hidden price and cater my retail client with the same picture without disclosing price. Ps i want to Make my retail customer think that its product code.
For eg:
13ADS/18-LCW-00
Where 13ADS is the product code while 1800 is the price.
Any updated advice would be highly appreciated.
Hi, Arsalan.
You can mention or add what you like to the product image (such as your example product code text) by using an image editing program or app, such as Photoshop or similar software.
Then each wholesale user will need their own account on your site to be able to access the wholesale area/page and unlock the wholesale pricing for their user role.
Let me know if you have any other questions. You can also contact us via our dedicated Support Center.
Hi Colin,
plugin is not compatible with paid woocommerce memberships plugin, unfortunately.
Could you check up this, please.
If you could find a workaround to hide price for the login-status only, would be great (add-to-cart button can be blocked by memberships plugin itself).
Thanks a lot.
Kind regards from Germany
Frank
Hi, Frank. Thanks for your comment and sorry to hear the Hide Price Until Login plugin by CedCommerce doesn't work with your WooCommerce memberships plugin. Please may I know the latter's exact name and author/developer?
As a workaround, you can use a combination of our WooCommerce Product Table and WooCommerce Protected Categories plugins to hide your product prices until a user logs in. Put your products in protected categories and then display a copy of your products in a public category or categories via the product table without displaying/including the price and add to cart columns. You will need to disable the links to the single product pages as well. This will display a product table without the prices and ability to add them to the cart for logged out users. Logged in users can navigate to the protected categories or be redirected to a special page that displays a product table that includes the price and add to cart columns.
I hope this makes sense. Should you have any other questions, you can also get in touch with us via our dedicated Support Center. Many thanks.