WooCommerce: How to remove the add to cart button from specific product types

Here’s how you can remove the “Add to cart” button from a specific product type/s in your WooCommerce store.

add_filter( 'woocommerce_loop_add_to_cart_link', 'remove_add_to_cart_buttons', 1 );
function remove_add_to_cart_buttons( $button ) {
    global $product;
    // Replace "external" with any product type you want to hide the button from
    if( $product->is_type( 'external' ) ){
        return '';

    return $button;

Was this helpful? Please buy me a coffee

This code should be added to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update.

Share your thoughts

Your email address will not be published. Required fields are marked *