Home / WordPress / WooCommerce - Hide Prices on the Shop & Category Pages
woocommerce

WooCommerce - Hide Prices on the Shop & Category Pages

Add these line to your function.php file.

Where to find function.php file?

Go to theme folder. Open your selected theme folder. Find the function.php file inside that folder. Then add following snippets as you wanted.

Snippet 01 – Remove prices from the shop page only

// Remove prices
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );

Snippet 02 – Remove prices everywhere but not in the cart and checkout pages

// Remove prices everywhere
add_filter( 'woocommerce_variable_sale_price_html', 'codes2know_remove_prices', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'codes2know_remove_prices', 10, 2 );
add_filter( 'woocommerce_get_price_html', 'codes2know_remove_prices', 10, 2 );
 
function codes2know_remove_prices( $price, $product ) {
$price = '';
return $price;
}

About Yeshan Sachitha K Perera

Yeshan Sachitha K Perera
Yeshan(YESH) is a PHP developer and front-end designer. Born in 1993 from Sri Lanka. Currently lives in Dubai, UAE. The founder of Codes2Know (aka) C2K. Also a Gamer. Join with the c2k community to share your knowledge. Like and share...

Leave a Reply