Effective Methods to Conceal Product Pricing in WooCommerce Stores
WooCommerce

Effective Methods to Conceal Product Pricing in WooCommerce Stores

Many online retailers using WooCommerce find that displaying prices publicly works well for standard retail operations. However, certain business models require more discretion regarding pricing visibility.

Through working with various e-commerce store owners, several scenarios have emerged where concealing product prices becomes necessary.

Wholesale distributors often need to restrict pricing information to verified business clients. Similarly, business-to-business companies may prefer discussing client requirements before presenting pricing to ensure appropriate solutions.

After evaluating multiple approaches, three reliable techniques have been identified for hiding prices within WooCommerce installations. These methods accommodate diverse business needs, from wholesale operations to premium brands.

Considerations Before Implementing Price Concealment

Several business situations justify operating a WooCommerce store without visible pricing.

Wholesale suppliers frequently hide prices to prevent retail customers from accessing bulk discount rates. Custom manufacturing businesses, such as furniture makers, often remove pricing because each item involves unique material and labor costs.

Some luxury brands create exclusive shopping experiences by revealing prices only to serious, qualified buyers.

While WooCommerce doesn't include built-in functionality for hiding prices, three effective methods have been identified through testing.

Use these quick links to navigate to your preferred approach:

Let's explore these techniques in detail.

Method 1: Conceal Prices and Cart Buttons Using Custom Code

This approach demonstrates how to hide product prices and purchasing buttons either for your entire store or specific items. This method suits businesses that prefer customers to contact them directly for pricing or require account login to view prices.

Many dedicated plugins for price concealment can be expensive or overly complex. A straightforward code-based solution provides a simpler alternative.

This technique works well for those comfortable with basic setup procedures who don't require extensive management features found in specialized wholesale or catalog plugins.

While working with code might seem intimidating, the process has been simplified using a code snippet management plugin that makes implementation accessible to beginners.

The free version of this plugin handles price concealment effectively. Advanced features like AI-assisted code generation are available in premium versions.

Begin by installing and activating the free code snippet management plugin. If you need installation guidance, consult standard WordPress plugin installation documentation.

Proceed with one of the following tutorials.

Option 1: Hide Pricing for Specific Products from Non-Logged-In Users

The simplest approach utilizes a pre-built code snippet from the plugin's library. This code conceals prices and cart buttons from designated products when users aren't authenticated.

If you're familiar with the plugin, locate the appropriate snippet in its library.

Otherwise, access the snippet through the plugin interface.

Click the 'Add to Site' button to begin implementation.

Adding the WPCode code snippet to the site

You'll need to create a free account or log into your existing account.

During registration, you'll connect your WordPress site with the snippet library.

Logging in to deploy a WPCode code snippet

After authentication, select the website where you want to implement the snippet.

Click 'Deploy.'

Selecting a website to deploy the WPCode code snippet into

The system returns you to your WordPress administration area to complete setup.

Click 'Confirm & Install Snippet.'

Confirming to add the WPCode code snippet

This opens the code snippet editor where you'll make two customizations.

First, modify the product IDs. Locate this code line:

$not_purchasable_products = array( 23, 22 );
Hosted with by WPCode
1-click Use in WordPress

Replace these numbers with your specific product IDs.

If you're unsure about product identification, consult WooCommerce documentation regarding product ID location.

For example, to hide prices for products 63, 64, and 65, modify the code to:

$not_purchasable_products = array( 63, 64, 65 );
Hosted with by WPCode
1-click Use in WordPress

Next, customize the message displayed instead of the price.

Find this section:

function wws_hide_price_not_logged_in( $price_html, $product ) { if ( is_non_purchasable_products_for_visitors( $product ) ) { $price_html = '<div><a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '">' . __( 'Login with wholesale account to see prices', 'wws' ) . '</a></div>'; } return $price_html;
Hosted with by WPCode
1-click Use in WordPress

Modify the text 'Login with wholesale account to see prices' to your preferred message, such as 'Login to view pricing' or 'Contact for price information.'

Example modification:

function wws_hide_price_not_logged_in( $price_html, $product ) { if ( is_non_purchasable_products_for_visitors( $product ) ) { $price_html = '<div><a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '">' . __( 'Login to view pricing', 'wws' ) . '</a></div>'; } return $price_html;
Hosted with by WPCode
1-click Use in WordPress

When users click this link, they'll be directed to the WooCommerce login page.

Finally, change the toggle from 'Inactive' to 'Active' and click 'Update.'

Adding premade code snippet to hide WooCommerce prices with WPCode

Visit your product pages to verify the changes.

Prices and cart buttons will be hidden, replaced by your customized message.

Asking users to log in to see WooCommerce prices

Your custom message now appears on selected product pages.

Share this article

Need Help With Your WordPress Project?

I offer professional WordPress and WooCommerce development services tailored to your needs.

Get in Touch
WhatsAppChat on WhatsApp