How to remove “Add to Cart” button on product listing pages in WooCommerce?

Here’s another handy WordPress code snippet I have found, while wondering around the stackoverflow forums. This code can be used to remove or hide the ‘Add to Cart’ button from product listing pages like shop or product category page. However this does not hide the button from single or individual product page.

Quick Tip : How to hide coupons from Checkout and Cart Page in WooCommerce?

To Remove “Add to Cart” button all you need to do is paste the following lines of code in your functions.php file located inside your theme’s directory.

//remove "Add to Cart" button on product listing page in WooCommerce
add_action( 'woocommerce_after_shop_loop_item', 'remove_add_to_cart_buttons', 1 );

function remove_add_to_cart_buttons() {
    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
}

Source: http://stackoverflow.com/

6 Comments

  1. Hi, I’m looking for a solution to do exactly the opposite. For some reason, I can’t display the add to cart button on any products listing page. I’d like to spare regular customers the hassle of opening the products page if they’re coming back to buy products they already know.

    Reply
  2. Help! I did exactly what is described and now i get a white screen. As well on my website link and my link to WordPress admin. What did go wrong and better yet, how can i revolve this?

    Reply
  3. Got it! i remove it on my FTP in the file functions.php and it works again. But now is the question, were do i have to put the code to make it work? Thx!

    Reply
  4. You don’t need to do all of that function, you can just do:

    // Removes add to cart button on product list
    remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’ );

    Reply

Leave a Comment.