Home » WooCommerce: Hide Prices on the Shop & Category Pages

WooCommerce: Hide Prices on the Shop & Category Pages

by Tutor Aspire

Interesting WooCommerce customization here. A client of mine asked me to hide/remove prices from the shop page and category pages as she wanted to drive more customers to the single product pages (i.e. increasing the click-through rate).

As usual, a simple PHP snippet does the trick. I never recommend to use CSS to “hide” prices, as they would still be visible in the code – PHP stops the prices from loading, so they’re invisible to the user.

WooCommerce: Hide Prices from Shop & Category Pages
WooCommerce: Hide Prices from Shop & Category Pages

PHP Snippet 1: Remove Prices from the Shop Page Only

/**
 * @snippet       WooCommerce Hide Prices on the Shop Page
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @compatible    WooCommerce 5.1
 * @donate $9     https://tutoraspire.com
 */
 
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );

PHP Snippet 2: Remove Prices Everywhere but the Cart and Checkout Pages

/**
 * @snippet       WooCommerce Hide Prices Except Cart / Checkout
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @compatible    WooCommerce 5.1
 * @donate $9     https://tutoraspire.com
 */

add_filter( 'woocommerce_variable_sale_price_html', 'businessbloomer_remove_prices', 9999, 2 );

add_filter( 'woocommerce_variable_price_html', 'businessbloomer_remove_prices', 9999, 2 );

add_filter( 'woocommerce_get_price_html', 'businessbloomer_remove_prices', 9999, 2 );

function businessbloomer_remove_prices( $price, $product ) {
   if ( ! is_admin() ) $price = '';
   return $price;
}

“I don’t code – is there a reliable plugin for that?”

As many of you would love to code but don’t feel 100% confident with it, I decided to look for a reliable plugin that achieves the same (or even better) result.

In this case, I recommend the YITH WooCommerce Catalog Mode plugin. On top of hiding the Add to Cart buttons on the pages you like (free version), you can also hide prices, hide the Cart & Checkout pages, target specific products, replace the price with a contact form  and much more (premium version).

But in case you wish to code, keep reading 🙂

You may also like