Running a B2B store? Managing wholesale operations? Perhaps you’re building a membership site or operating a quote-based business where fixed pricing doesn’t make sense.
Whatever your reason for moving away from fixed prices, you’ve probably discovered that WooCommerce doesn’t offer a built-in way to hide product prices.
The good news? You can absolutely hide prices in your WooCommerce store – and this guide shows you exactly how.
We’ll cover two proven methods:
- Custom code snippets: Perfect if you’re comfortable with basic code or want complete control.
- Dedicated plugins: Ideal if you prefer a click-and-configure solution.
Each approach comes with clear, step-by-step instructions and screenshots.
By the end of this article, you’ll know how to hide prices for specific products, entire categories, or certain user roles. Whether you’re a developer who loves tinkering with code or a store owner who’d rather avoid it, you’ll find a solution that fits your business perfectly.
But first…
Why hide prices in your WooCommerce store?
B2B and wholesale operations
When you’re selling to both retail and business customers, displaying wholesale rates publicly can undermine your pricing strategy. Hiding prices allows you to display exclusive rates only to registered business accounts, thereby protecting your margins and maintaining separate pricing tiers.
Membership and exclusive shopping
Want more email signups? Hide those prices. Members-only pricing creates urgency and exclusivity. Visitors must register to see your rates, building your email list while making customers feel part of an exclusive club.
Custom quote-based businesses
Fixed prices don’t work for everyone. If you sell custom furniture, provide consulting services, or offer personalized products, displaying a single price can mislead customers. Instead, hiding prices allows you to provide accurate quotes tailored to each customer’s specific requirements.

A study Forrester did on behalf of Adobe reveals that B2B buyers regularly expect personalization when interacting with a company, and 66% of them want that personalized experience when buying the product or service, which is why custom quotes are preferred.

Pre-launch or out-of-stock products
Keep building buzz without taking orders you can’t fulfill. Hide prices on upcoming products to generate interest before launching. For temporarily out-of-stock items, removing prices maintains your catalog’s SEO value while preventing frustrated customers from attempting purchases.
How to hide prices in WooCommerce using code snippets
While plugins offer convenience, code snippets give you precise control without the overhead of additional plugins slowing down your site.
Before you start:
- Back up your site (seriously, do this first!).
- Use a child theme to prevent losing changes during theme updates.
- Add code to your theme’s
functions.php
file or use a plugin like Code Snippets.
These solutions work by hooking into WooCommerce’s filters, specifically woocommerce_get_price_html
and woocommerce_is_purchasable
. Think of these as control points where WooCommerce decides what to display.
The best part? It’s completely free.
We’ll cover three approaches, each with its own application and benefits.
- Product ID: Best for hiding prices on specific items
- Category: Best for managing entire product lines
- User role: Best for creating member-only pricing
Each snippet modifies how WooCommerce displays prices without touching your database. If something goes wrong, simply remove the code and everything returns to normal.
Ready? Let’s start with the simplest approach.
1. Hide prices by product
Need to hide prices for just a few specific products? This method targets individual items using their product IDs; perfect when you have a handful of products that need special treatment.
Here’s the complete code:
add_filter( 'woocommerce_is_purchasable', 'hide_add_to_cart_and_price_by_product_ids', 10, 2 );
add_filter( 'woocommerce_get_price_html', 'hide_price_html_by_product_ids', 10, 2 );
function get_hidden_product_ids() {
// Replace with the product IDs you want to hide
return [102, 103, 104]; // Example product IDs
}
function hide_add_to_cart_and_price_by_product_ids( $purchasable, $product ) {
if ( in_array( $product->get_id(), get_hidden_product_ids() ) ) {
return false;
}
return $purchasable;
}
function hide_price_html_by_product_ids( $price, $product ) {
if ( in_array( $product->get_id(), get_hidden_product_ids() ) ) {
return '';
}
return $price;
}
Code language: PHP (php)
Code breakdown:
woocommerce_is_purchasable
: This filter controls whether customers can actually buy a product. When it returns false, WooCommerce hides the “Add to Cart” button completely.woocommerce_get_price_html
: This filter manages the price display. By returning an empty string, we remove the price from view.
The get_hidden_product_ids()
function is your control center. Simply replace [102, 103, 104]
with the IDs of the products you want to hide. Need to hide product 77? Change it to [77]
. Multiple products? Use [77, 89, 156]
.
Finding your product IDs:
- Navigate to Products → All Products in your WordPress admin.
- Find your target product and click Edit.
- Check the URL: it shows something like: website.com/wp-admin/post.php?post=435&action=edit
That number after post= is your product ID. In this example, it’s 435.
🎯 Quick tip: Hovering over a product title in your admin area often shows the ID in your browser’s status bar – no need to open the edit page!
2. Hide prices by category
Managing dozens of products individually? That’s tedious. This approach lets you hide prices for entire categories at once, which is much more efficient when dealing with product lines or collections.
Here’s the complete code:
add_filter( 'woocommerce_is_purchasable', 'hide_add_to_cart_and_price_by_cat_ids', 10, 2 );
add_filter( 'woocommerce_get_price_html', 'hide_price_html_by_cat_ids', 10, 2 );
function get_hidden_category() {
// If you want to specify categories by IDs, use this line and delete the following line
return [102, 103, 104]; // Replace with your desired category IDs
// If you want to specify categories by slugs, use this line and delete the previous line
return ['hidden-cat', 'members-only']; // Replace with your desired category slugs
}
function hide_add_to_cart_and_price_by_cat_ids( $purchasable, $product ) {
if ( has_term( get_hidden_category(), 'product_cat', $product->get_id() ) ) {
return false;
}
return $purchasable;
}
function hide_price_html_by_cat_ids( $price, $product ) {
if ( has_term( get_hidden_category(), 'product_cat', $product->get_id() ) ) {
return '';
}
return $price;
}
Code language: PHP (php)
Code breakdown:
The get_hidden_category()
function defines which categories to target. You have two options:
- Option 1: Use category IDs: Keep the first return line and delete the second. Replace
[102, 103, 104]
with your actual category IDs. - Option 2: Use category slugs: Delete the first return line and use the second. Replace
['hidden-cat', 'members-only']
with your category slugs.
⚠️ Pick one approach, don’t use both!
The magic happens with has_term()
. This WordPress function checks if a product belongs to your specified categories. When it finds a match, the filters kick in to hide both the price and the purchase button.
Finding category IDs:
- Go to Products → Categories in WordPress admin.
- Click edit on your target category.
- In the URL, look for this part: product_cat&tag_ID=16.
The category ID is the number after tag_ID=, in this case, 16.
Finding category slugs:
Even easier! Navigate to Products → Categories and check the “Slug” column. You’ll see something like wholesale-items or members-only.

🎯 Pro tip: Create a tiered shopping experience using this method. Set up public categories with visible pricing for regular customers, then exclusive categories with hidden prices for wholesale or VIP customers. This strategy drives account creation and builds customer loyalty; visitors must register to access your best deals.
3. Hide prices by user
Want to create exclusive shopping experiences? This method controls price visibility based on login status or user roles, which is perfect for membership sites, B2B stores, or any business that segments customers.
We’ll cover two scenarios:
Option 1: Hide prices for non-logged-in users
This encourages visitors to create accounts before seeing your rates:
add_filter( 'woocommerce_is_purchasable', 'hide_add_to_cart_and_price_by_cat_ids', 10, 2 );
add_filter( 'woocommerce_get_price_html', 'hide_price_html_by_cat_ids', 10, 2 );
function get_hidden_category() {
// If you want to specify categories by slugs, use this line and delete the previous line
return ['hidden-cat', 'members-only']; // Replace with your desired category slugs
}
function hide_add_to_cart_and_price_by_cat_ids( $purchasable, $product ) {
if ( !is_user_logged_in() && has_term( get_hidden_category(), 'product_cat', $product->get_id() ) ) {
return false;
}
return $purchasable;
}
function hide_price_html_by_cat_ids( $price, $product ) {
if ( !is_user_logged_in() && has_term( get_hidden_category(), 'product_cat', $product->get_id() ) ) {
return '';
}
return $price;
}
Code language: PHP (php)
The key here: !is_user_logged_in()
.
This checks if a visitor hasn’t logged in. Combined with category checks, it creates a powerful rule: “If you’re not logged in AND looking at products in these categories, you can’t see prices.”
Logged-in users see everything normally.
Option 2: Hide prices based on user roles
Need more granular control? This snippet targets specific user roles:
// Define roles that should not see the price or add-to-cart button
function get_restricted_user_roles() {
return ['wholesale', 'vip-customer']; // Modify as needed
}
// Define product categories to restrict (use either slugs OR IDs)
function get_restricted_product_categories() {
return ['hidden-cat', 'members-only']; // category slugs
}
add_filter( 'woocommerce_is_purchasable', 'restrict_add_to_cart_by_user_role_and_category', 10, 2 );
add_filter( 'woocommerce_get_price_html', 'restrict_price_html_by_user_role_and_category', 10, 2 );
function restrict_add_to_cart_by_user_role_and_category( $purchasable, $product ) {
if ( is_user_logged_in() && should_restrict_product_for_user( $product ) ) {
return false;
}
return $purchasable;
}
function restrict_price_html_by_user_role_and_category( $price, $product ) {
if ( is_user_logged_in() && should_restrict_product_for_user( $product ) ) {
return '';
}
return $price;
}
function should_restrict_product_for_user( $product ) {
$user = wp_get_current_user();
$restricted_roles = get_restricted_user_roles();
$restricted_cats = get_restricted_product_categories();
$user_has_role = array_intersect( $restricted_roles, (array) $user->roles );
$product_in_cat = has_term( $restricted_cats, 'product_cat', $product->get_id() );
return $user_has_role && $product_in_cat;
}
Code language: PHP (php)
How it works:
The code performs a double-check:
- Does the user have one of the restricted roles? (like wholesale or vip-customer)
- Is the product in a restricted category? (like hidden-cat or members-only)
Only when BOTH conditions match does the price disappear.
Important: This requires custom user roles. WordPress only includes basic roles by default. Use a plugin like User Role Editor to create roles like “wholesale” or “VIP customer”.
Business benefits of user-based hiding:
- Build your email list: Visitors must register to see prices.
- Segment customers automatically: Different roles see different products.
- Create exclusivity: VIP members get access to special pricing.
- Protect wholesale rates: Keep B2B prices hidden from retail customers.
🤓 Pro tip: The stricter your rules, the more accounts you’ll generate. But balance this with user experience – nobody likes excessive barriers.
How to hide product prices with a plugin
For store owners who prefer a code-free solution, plugins offer the most straightforward way to hide WooCommerce prices. Unlike code snippets, plugins provide intuitive interfaces and additional features that make price hiding more flexible. Some options are:
- Hide Price & Add to Cart Button for WooCommerce
- Hide Prices & Private Store for WooCommerce
- YITH WooCommerce Catalog Mode
For this tutorial, we’ll use YITH WooCommerce Catalog Mode. It’s free, has 60,000+ active installations, and gets the job done.
- Navigate to Plugins → Add New in WordPress admin.
- Search for YITH WooCommerce Catalog Mode.
- Click Install Now, then Activate.
- Find the Catalog Mode option under the YITH menu.
- Enable “Hide Add to Cart”.
Done! Your store now hides all purchase buttons.
Limitations of the free version:
- You can’t hide prices (only Add to Cart buttons).
- It applies to all products, without exceptions.
- It affects all users: you can’t target specific roles.
Want to hide prices for specific products or logged-out users only? You’ll need the premium version of the YITH plugin ($79.99/year) or use the code snippets method above.
🎯 Quick tip: Running a sale? Use catalog mode to temporarily pause orders while updating prices across your store.
Choose the right price-hiding strategy for your business
Code snippets work best when you need precise control and don’t mind occasional maintenance. They’re lightweight, free, and perfect for developers or DIY store owners comfortable with basic PHP.
Plugins suit non-technical users who value convenience over customization. They’re easier to manage, but they add some overhead to your site, and it costs money to get some of the more granular functions.
Consider your technical skills, update frequency, and site performance needs when choosing.
Whatever method you choose, test thoroughly before going live. Your pricing strategy directly impacts revenue, so getting it right matters.