How to Remove or Hide the Add to Cart button from a specific product of WooCommerce Plugin?

by:

WooCommerceWordpress

You can Hide or Remove the Add to cart button of the WooCommerce plugin by using any of the steps that we have listed below.

  1. Removing the Add to cart means we are assuming you do not have a price for the given products. So simple in the admin panel move to the price field and stay it empty.
  2. You can enable stock management in the admin and you need to set the stock value to Zero.
  3. You can write a filter woocommerce_is_purchasable and return false when the product ID is the target one. By adding the WordPress hook in the functions.php file the price will be visible on the frontend and shows a Product cannot be purchased instead of the Add to cart button.

The below code can be used in the functions.php file for the third example.