Remove both “Add to cart” and “Read more” Buttons
But before we dive into the code, let me explain the difference between hiding the “Add to cart” button and making products non-purchasable.
In this tutorial we are about just to hide the buttons, that’s all, so products still will be available for purchase, e.g. in the cart or maybe via a direct link. If you want to completely disable product purchases, this tutorial is for you.
You can also do both. Because non-purchasable products still have “Read more” buttons instead of “Add to cart”.
On Archive Pages, Related Products, Cross-sells, Upsells
Archive pages are:
- Shop page,
- Product category pages,
- Product tag pages,
- Search results
This code below also removes “Add to cart” buttons from upsells, cross-sells and related products sections.
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
You can add this code to your theme functions.php
file and here is the result.

You can also read my other articles on how to remove product prices and the Sale! badge.
But what if you do not need to remove the add to cart button from all the archive pages? Let’s say you need to remove it from certain categories or from related products section.
Conditional tags is the answer.
/* * Remove "Add to Cart" button from the product category "Uncategorized" */ add_action('wp', 'misha_remove_add_to_cart_product_categories' ); function misha_remove_add_to_cart_product_categories(){ if( is_product_category( 'uncategorized' ) ) { remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart'); } }
- is_product_category() – remove “Add to cart” from specific product category pages
is_product_tag()
– specific product tag pages,is_search()
– the search results page only,is_shop()
– from the WooCommerce shop page,- You can use
is_product()
to remove “Add to cart” from related products / cross-sells section on single product pages oris_cart()
to remove the button from Upsells;
In the WooCommerce product loop it is also possible to use filter hook woocommerce_loop_add_to_cart_link
to remove “Add to cart” from products with certain IDs or even for certain product types.
/** * Hide the button for the product with ID = 10 AND for variable products */ add_filter('woocommerce_loop_add_to_cart_link', function( $add_to_cart_html, $product ) { if( $product->get_id() == 10 || $product->is_type( 'variable' ) ) { return ''; } return $add_to_cart_html; }, 10, 2 );
On Single Product Pages
Easy-breezy 😁
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart');
