Start a free 14-day trial by December 1 on a wide range of WooCommerce Marketplace extensions and themes. Explore products

Hide Price & Show Custom Button

Hide Price & Show Custom Button turns any part of your WooCommerce store into a catalog: hide the price, hide the Add to cart button, or both, for selected products, categories, or the whole store. Show “Log in to see prices” or “Call for price” instead, and give shoppers a custom button that opens a quote request form, a popup, or any link. It’s for wholesale catalogs, members-only pricing, made-to-order products, and stores that sell some products by enquiry. View the product page.

Quick start

↑ Back to top

Hide prices from guests and show “Log in to see prices” in five steps:

  1. Go to WooCommerce > Hide Price Rules and select Add hide price rule.
  2. Give the rule a name and set Applies to to Guests (not logged in).
  3. Turn on All products in the store, or choose Categories.
  4. Turn on Hide the price and enter “Log in to see prices” in Text shown instead of the price.
  5. Select Publish, then open your shop in a private browser window to see what guests see.
Get started with Hide Price checklist with four steps and the Open shop button

The Get started with Hide Price checklist on the rules screen tracks the same steps. Select Dismiss to hide it.

Installation

↑ Back to top

To start using a product from WooCommerce.com, you can use the โ€œAdd to storeโ€ functionality on the order confirmation page or the My subscriptions section in your account.

  1. Navigate to My subscriptions.
  2. Find the Add to store button next to the product youโ€™re planning to install.
  3. Follow the instructions on the screen, and the product will be automatically added to your store.

Alternative options and more information at:
Managing WooCommerce.com subscriptions.

Requirements

↑ Back to top
  • WordPress 6.5 or later.
  • WooCommerce 8.5 or later.
  • PHP 7.4 or later.
  • For rules with countries: WooCommerce geolocation, using the MaxMind integration or your CDN’s country header (for example, Cloudflare). External IP lookups are only used if you allow them in the settings.

The plugin works with block themes and classic themes, the Cart and Checkout blocks, and High-Performance Order Storage (HPOS). The price text, button label, and popup content can be translated with WPML and Polylang, and a wpml-config.xml file is included.

Setup and configuration

↑ Back to top

Hide Price & Show Custom Button has three places in your dashboard:

  • WooCommerce > Hide Price Rules: your rules.
  • WooCommerce > Enquiries: enquiries sent through the built-in form.
  • WooCommerce > Settings > Hide Price: caching, geolocation, enquiry email, and uninstall options.

Hide price rules

↑ Back to top

The rules list shows who each rule applies to, its products and categories, what it does, its status (Active, Scheduled, Expired, or Draft), and its priority. Drag rules or use the arrows to change their order.

Hide price rules list with three rules for guests, international visitors, and a restock enquiry

Select Add hide price rule to create one. The editor has these sections.

Who sees this rule

↑ Back to top
Who sees this rule settings with applies to, countries, start date, and end date
  • Applies to: Everyone, Guests (not logged in), or Logged-in customers.
  • Only these roles: For logged-in customers. Leave it empty for all logged-in customers.
  • Only in these countries: Leave it empty for every country. The visitor’s country is detected from their IP address.
  • Start date and End date: Optional. The end date is inclusive, in your store’s time zone.

Which products

↑ Back to top
Which products settings with all products, products, categories, exclude products, product types, and stock status
  • All products in the store: Apply the rule to every product.
  • Products and Categories: A product matches when it’s selected directly or is in a selected category. Variations follow their parent product.
  • Exclude products: Products this rule never affects.
  • Only these product types: Optional. Leave it empty for all types.
  • Only when stock status is: Optional. For example, choose “Out of stock” to show an enquiry button only for products you can’t sell right now.

Price and add to cart

↑ Back to top
Price and add to cart settings with hide the price, text shown instead of the price, and hide the add to cart button
  • Hide the price: Products with a hidden price can’t be purchased. Hidden prices are removed everywhere: pages, product blocks, Google structured data, the Store API, and feeds.
  • Text shown instead of the price: Simple HTML is allowed. Use {login_url} for a login link that brings shoppers back to the product. Leave it empty to show nothing.
  • Hide the add to cart button: Shows the price but stops online purchase in the shop, on product pages, and in blocks.

Custom button

↑ Back to top
Custom button settings with button label, when clicked, and popup content
  • Show a custom button: Give shoppers a next step, such as a quote request, a contact page, or a login link.
  • Button label: For example “Request a quote”.
  • When clicked: Link to a URL, Open a popup with custom content, or Open the built-in enquiry form.
  • Button URL: For links. A full address (https://โ€ฆ), a path such as /contact/, or a mailto: or tel: link. You can use {product_id} and {product_sku}. The button is hidden while the URL is empty.
  • Popup content: For popups, text, images, or a form shortcode from your form plugin. For the built-in enquiry form, optional text shown above the form.

Priority and preview

↑ Back to top
Priority setting for the rule
  • Priority: When several rules match a product, the rule with the lowest number wins. You can also drag rules into order on the rules list.

The Preview box shows how a matching product looks in your shop and updates as you edit. Use View a matching product in your store to open one. Rules don’t apply to you while you manage the store in the same browser if they target guests, so use a private window.

Preview box showing a product with the text Log in to see prices and a Request a quote button

Settings

↑ Back to top

Go to WooCommerce > Settings > Hide Price.

Hide Price settings with page caching, external geolocation, enquiry email, keep a copy, delete data on uninstall, and the enquiry form shortcode

Caching and geolocation:

  • Page caching: Let my caching plugin decide (default) or Exclude shop pages from page caches when country or role rules exist.
  • External geolocation: Allow WooCommerce to ask a third-party service for the visitor’s country. It’s only used by rules with countries, when the MaxMind integration or a CDN country header isn’t available. It sends the visitor’s IP address to an external service, so mention it in your privacy policy. Off by default.

Enquiries:

  • Send enquiries to: One or more email addresses, separated by commas. Leave it empty to use the site admin email.
  • Keep a copy: Save each enquiry under WooCommerce > Enquiries. On by default. Enquiries contain personal data and are included in WordPress personal data exports and erasures.

Uninstall:

  • Delete data on uninstall: When the plugin is deleted, also delete its rules, enquiries, and settings. Off by default.

Shortcode and getting started:

  • Enquiry form shortcode: Select Copy to copy [hpb_enquiry_form] and put the built-in enquiry form on any page, such as a “Request a quote” page.

Enquiries

↑ Back to top

Each enquiry sent through the built-in form is emailed to you and, with Keep a copy on, listed under WooCommerce > Enquiries with the product, customer, and message. Reply to the email to answer the customer.

Enquiries list with an enquiry about Vanilla Syrup, the customer, and the message

How-to guides

↑ Back to top

How to hide the price until login in WooCommerce

↑ Back to top
  1. Create a rule with Applies to set to Guests (not logged in).
  2. Choose the products or categories.
  3. Turn on Hide the price and enter <a href="{login_url}">Log in to see prices</a> in Text shown instead of the price.
  4. Select Publish.

After logging in, shoppers return to the product and see the price.

Shop grid for a guest with Log in to see prices and Request a quote instead of prices

How to turn on catalog mode for the whole store

↑ Back to top
  1. Create a rule with Applies to set to Everyone.
  2. Turn on All products in the store.
  3. Turn on Hide the add to cart button (and Hide the price if you don’t want to show prices).
  4. Optional: add a custom button, such as “Contact us”, with Link to a URL.

How to replace the add to cart button with a request a quote button

↑ Back to top
  1. In the rule, turn on Hide the add to cart button and Show a custom button.
  2. Enter a Button label, such as “Request a quote”.
  3. Set When clicked to Open the built-in enquiry form.
  4. Check the recipient in WooCommerce > Settings > Hide Price > Send enquiries to.

Shoppers get a form with their name, email, phone (optional), and message, and the product is included automatically.

Request a quote enquiry form for Vanilla Syrup with name, email, phone, and message fields

How to show call for price on out-of-stock products

↑ Back to top
  1. Create a rule for Everyone with All products in the store.
  2. Set Only when stock status is to Out of stock.
  3. Turn on Hide the add to cart button, and optionally Hide the price with the text “Call for price”.
  4. Add a custom button with Link to a URL and a tel: link, or the built-in enquiry form.

How to hide prices by country or for a limited time

↑ Back to top
  1. Choose the countries in Only in these countries.
  2. Optional: set a Start date and End date.
  3. If you use full-page caching, set Page caching to exclude shop pages in the settings.

Video

↑ Back to top

Frequently asked questions

↑ Back to top

Is the price really hidden, or just covered up?

↑ Back to top

It’s removed from the page source, structured data, the Store API, variation data, and feeds. Restricted products can’t be added to the cart by any route, including add-to-cart links, AJAX, the Store API, and the block checkout.

Can I show “Log in to see prices”?

↑ Back to top

Yes. Create a rule for guests, hide the price, and use the text <a href="{login_url}">Log in to see prices</a>. After logging in, shoppers return to the product.

Where do enquiries go?

↑ Back to top

To the email addresses in Send enquiries to (the site admin email by default). A copy is kept under WooCommerce > Enquiries unless you turn Keep a copy off.

Does it work with page caching?

↑ Back to top

Rules for guests and logged-in customers are cache-safe when your cache skips logged-in users, which most caching plugins do by default. For country rules, exclude shop pages from your page cache or set Page caching to exclude them.

Does it work with block themes and the block checkout?

↑ Back to top

Yes. Prices are hidden in product blocks and the Store API, the custom button appears in the Product Collection block and the Single Product template, and restricted products can’t be bought through the block checkout. The legacy All Products block hides prices but doesn’t show the custom button.

Can I use my own contact form in the popup?

↑ Back to top

Yes. Set When clicked to Open a popup with custom content and paste your form plugin’s shortcode into Popup content.

Troubleshooting

↑ Back to top

I hid the price but I still see it

↑ Back to top

Rules for guests don’t apply while you’re logged in. Open your shop in a private browser window. Also check that the rule is published and, if it has dates, that today is between them.

Country rules don’t work

↑ Back to top

The visitor’s country can’t be detected. Set up the MaxMind integration in WooCommerce or use a CDN that sends a country header. A notice in the settings tells you when countries can’t be detected. As a last resort, allow External geolocation.

The custom button doesn’t show

↑ Back to top

For Link to a URL, the button is hidden until you enter a valid Button URL. The rule editor shows a message when a URL isn’t saved.

Shoppers see another visitor’s prices

↑ Back to top

A full-page cache is sharing pages between visitors with different rules. Exclude shop pages from the cache or set Page caching to exclude them.

Known limitations

↑ Back to top
  • On shop and category archive pages in block themes, products can show the custom button twice (one styled and one plain). Product Collection blocks on regular pages show it once.
  • On single product pages in block themes, the custom button doesn’t use the theme’s button style.
  • The legacy All Products block doesn’t show the custom button.

Developer notes

↑ Back to top

Shortcode

↑ Back to top

[hpb_enquiry_form] shows the built-in enquiry form on any page. It uses the enquiry settings.

Filters

↑ Back to top
  • hpb_product_rule ($rule, $product): The rule applied to a product.
  • hpb_rules_apply ($apply): Whether rules apply in the current request.
  • hpb_custom_button_html ($html, $product, $rule, $context): The custom button HTML.
  • hpb_popup_rules ($popups): The rules that output a popup on the page.
  • hpb_hide_price_allowed_tags ($allowed_html): HTML allowed in the price text.
  • hpb_visitor_country ($country): The visitor’s country.
  • hpb_has_local_geolocation ($has): Whether local geolocation is available.
  • hpb_has_visitor_dependent_rules ($dependent): Whether rules depend on the visitor.
  • hpb_prevent_page_cache ($shop_page): Whether to exclude the page from page caches.
  • hpb_enqueue_frontend_assets ($enqueue): Load the front-end assets on every page.
  • hpb_enquiry_email_recipient ($list, $data): The enquiry email recipients.
  • hpb_enquiry_is_spam ($is_spam, $data): Mark an enquiry as spam.
  • hpb_enquiry_rate_limit ($limit): Enquiries allowed per visitor in a short time. Default 5.
  • hpb_rule_capability ($capability): The capability needed to manage rules. Default manage_woocommerce.
  • hpb_settings ($settings): The plugin settings.

Actions

↑ Back to top
  • hpb_enquiry_submitted ($enquiry_id, $data): After an enquiry is sent.
  • hpb_rules_refreshed ($guest_rules, $registered_rules): After the rules cache is rebuilt.

Works great with

↑ Back to top
  • Quote Offer: when customers should request a quote that you answer, negotiate, and turn into an order. Use one plugin per product.
  • B2B Pricing: give logged-in trade customers their own prices once they can see them.
  • Restrict Checkout: checkout rules such as minimum orders, regions, and payment methods.
  • Multistep Product Bundles: let customers build their own box from the products you do sell online.

Support

↑ Back to top

Need help? Contact WooCommerce.com support for Hide Price & Show Custom Button. Include your WordPress, WooCommerce, and plugin versions and the rule you’re testing.

Related Products

WooCommerce Subscriptions is a WooCommerce extension that lets customers subscribe to your products or...

Offer add-ons like gift wrapping, special messages or other special options for your products.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.