April 29th, 2025
WooCommerce is a powerful e-commerce platform, but sometimes merchants need to customize how product information is displayed. Whether you’re running a B2B store, a membership-based shop, or simply want to create an exclusive shopping experience, you might need to hide prices on WooCommerce or hide the Add to Cart button in WooCommerce. This detailed guide will walk you through the process, covering plugins, manual methods, and best practices to achieve your goals—all while optimizing for SEO to help your store rank better. Let’s dive in!
Why You Might Want to Hide Prices and Add to Cart in WooCommerce
Hiding prices and the “Add to Cart” button can serve various strategic purposes for your online store. Here are some common scenarios where this customization is beneficial:
- B2B and Wholesale Stores: If you offer special pricing for wholesale customers, you may want to hide prices on WooCommerce from retail users to avoid confusion or competition. Showing prices only to verified wholesalers ensures exclusivity.
- Membership or Exclusive Stores: For membership-based businesses, hiding prices until a user logs in can encourage registrations, helping you build a loyal customer base while maintaining privacy for premium pricing.
- Catalog Mode: Some merchants use WooCommerce as a product catalog rather than a direct sales platform. In such cases, you’d want to remove prices in WooCommerce and disable the “Add to Cart” button to prevent purchases while showcasing products.
- Encouraging Inquiries: By choosing to hide the Add to Cart button in WooCommerce, you can replace it with a contact form or a custom link, prompting customers to reach out for personalized quotes or consultations—ideal for high-value or custom products.
- Geographical Restrictions: If you don’t ship to certain countries, you might want to hide prices and purchasing options for users in those regions to manage expectations and compliance.
Understanding your business needs will help you decide the best method to hide prices on WooCommerce. Now, let’s explore how to implement these changes effectively.
Method 1: Using a Plugin to Hide Prices and Add to Cart in WooCommerce
Plugins are the easiest and most user-friendly way to hide prices and add to cart on WooCommerce, especially if you’re not comfortable with coding. One popular option is the WooCommerce Hide Price Plugin by Fabaddons. Here’s how to set it up:
Step 1: Install the Plugin
- Log in to your WordPress dashboard.
- Navigate to Plugins > Add New.
- Search for “WooCommerce Hide Price & Add to Cart Button”
- Click Install Now, then Activate the plugin.
Step 2: Create a Hide Price Rule
- After activation, go to WooCommerce > Hide Price in the admin menu.
- Click Add New Rule to create a custom rule for hiding prices and the “Add to Cart” button.
- Configure the rule settings:
- Hide for User Roles: Select specific roles (e.g., Subscriber, Guest) to hide prices and the “Add to Cart” button. For example, hide for non-logged-in users to encourage registration.
- Hide for Specific Products or Categories: Choose products (e.g., Album) or categories (e.g., Music) to apply the rule to. This is useful for targeting premium items.
- Hide for Countries: Restrict visibility based on customer location using the plugin’s IP-based detection.
Step 3: Replace Prices and Add to Cart Button
- Under the rule settings, enable the option to hide prices on WooCommerce.
- Replace the price with custom text, such as “Login to See Price” or “Contact Us for Pricing.”
- To hide the Add to Cart button in WooCommerce, enable the option and replace it with:
- A custom link (e.g., directing to a login page).
- A contact form (e.g., using Contact Form 7) for quote requests.
Step 4: Save and Test
- Save the rule and visit your shop page to test the changes.
- For non-logged-in users or specified roles, the price should be replaced with your custom text, and the “Add to Cart” button should either be hidden or replaced with your chosen link or form.
This method is ideal for beginners because it requires no coding and offers flexibility to create multiple rules for different scenarios, ensuring you can remove prices in WooCommerce selectively.
Method 2: Manually Hide Prices and Add to Cart with Code
For those comfortable with coding, you can hide prices on WooCommerce and hide the Add to Cart button in WooCommerce by adding custom code to your theme’s functions.php file. This method offers more control but requires caution to avoid breaking your site.
Step 1: Access Your Theme’s Functions.php File
- Go to Appearance > Theme File Editor in your WordPress dashboard.
- Locate the functions.php file on the right side under Theme Files.
- Alternatively, use a plugin like Code Snippets to add the code safely without editing the theme directly.
Step 2: Code to Hide Prices on WooCommerce
To remove prices in WooCommerce across all products, add the following code:
Hide Prices Code
add_filter(‘woocommerce_get_price_html’, ‘hide_price_specific_product’, 10, 2);
function hide_price_specific_product($price, $product) {
if ($product->get_id() == 123) {
return ‘Contact Us for Pricing’;
}
return $price;
}
This code removes the price HTML, effectively hiding prices on all product pages, shop pages, and category pages.
Step 3: Code to Hide Prices for Specific User Roles
If you want to hide prices only for non-logged-in users or specific roles, use this modified code:
Hide Prices for Non-Logged-In Users
add_filter(‘woocommerce_get_price_html’, ‘custom_hide_price_for_guests’);
function custom_hide_price_for_guests($price) {
if (!is_user_logged_in()) {
return ‘Login to See Price’;
}
return $price;
}
This code replaces the price with a “Login to See Price” message for non-logged-in users, encouraging them to register.
Step 4: Code to Hide the Add to Cart Button
To hide the Add to Cart button in WooCommerce, add this code to remove it from shop and product pages:
Hide Add to Cart Button Code
remove_action(‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10);
remove_action(‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30);
This removes the “Add to Cart” button from both the shop page and single product pages.
Step 5: Test Your Changes
- Clear your site’s cache if you’re using a caching plugin.
- Visit your shop page and product pages to ensure the prices and “Add to Cart” button are hidden as expected.
- Test as a logged-in user and a guest to verify role-based rules are working.
Caution: Always back up your site before editing code, as errors can break your site. If you’re not confident, consider using a plugin instead.
Best Practices for Hiding Prices and Add to Cart in WooCommerce
To ensure a seamless user experience while hiding prices and the “Add to Cart” button, follow these best practices:
- Provide Clear Instructions: If you hide prices on WooCommerce, replace them with actionable messages like “Login to See Price” or “Request a Quote” to guide users on what to do next.
- Encourage Engagement: Use the opportunity to collect leads by replacing the “Add to Cart” button with a contact form or a link to a quote request page.
- Test Across Devices: Ensure your changes look good on both desktop and mobile devices, as some themes may display elements differently.
- Maintain SEO: Hiding prices doesn’t directly impact SEO, but ensure your product pages still have rich content, such as detailed descriptions and keywords like WooCommerce hide price, WooCommerce hide add to cart, and WooCommerce remove prices, to maintain search visibility.
- Monitor User Behavior: After implementing these changes, use analytics to track how hiding prices affects user engagement, registrations, and conversions.
Conclusion
Whether you’re running a B2B store, a membership site, or a catalog, knowing how to hide prices on WooCommerce can significantly enhance your store’s functionality and user experience. Using plugins like Fabaddons WooCommerce Hide Price & Add to Cart Button offers a beginner-friendly approach, while custom code provides more flexibility for advanced users. By following the steps outlined in this guide, you can remove prices in WooCommerce and tailor your store to meet your business goals.