How to Hide and Remove Add to Cart Button in WooCommerce

Do you want to remove add to cart button in WooCommerce? Or hide it? If you are looking for a step-by-step guide, keep reading this article.

Want to remove the Add to Cart button in WooCommerce without affecting the rest of your store?

Whether you’re selling custom products or services or simply want more control over the buying process, knowing how to hide the Add to Cart button in WooCommerce can be extremely useful.

In this step-by-step guide, you’ll learn multiple ways to disable the Add to Cart button in WooCommerce, regardless of your use case.

From using code snippets to dedicated plugins, we’ll help you take control of your WooCommerce product pages with ease.

But before we proceed with the tutorial, let’s examine why hiding and removing the add-to-cart button is a good idea.

Why You Need to Hide and Remove Add to Cart Button

There are several scenarios where it makes perfect sense to remove the add to cart button in WooCommerce:

  • Catalog-Only Stores: If you’re running a WooCommerce store that’s more of a product catalog and not selling directly online, it’s better to hide the add to cart button in WooCommerce. This prevents users from getting confused or trying to check out unnecessarily.
  • Out of Stock or Discontinued Products: You may want to temporarily or permanently disable the add to cart button in WooCommerce for products that are no longer available. This avoids frustrating customers by clearly signaling that the item isn’t for purchase.
  • Membership or Restricted Stores: In stores where purchases are allowed only for certain users (like members or logged-in users), WooCommerce disables add to cart for guests, creating a more controlled shopping environment.
  • Custom Order Workflow: Some businesses prefer to interact with customers before finalizing an order. In such cases, it’s useful to remove add to cart button WooCommerce and instead use custom forms or quote requests.
  • Promotional or Pre-Launch Products: If you’re teasing upcoming products, you might want to hide add to cart button WooCommerce until the official launch date.

By using these methods smartly, you can guide user interaction as you want without completely disabling your WooCommerce setup.

How to Hide and Remove Add to Cart Button in WooCommerce

Several methods are available to remove the add-to-cart button in WooCommerce. Below, we will list the major ones. You can choose an option based on your preferences and requirements.

Without any further ado, let’s get started.

NOTE: We will edit some WordPress core files to complete the task. Therefore, we highly recommend generating a complete website backup. You can also create and modify a WordPress child theme.

1. Remove the Add to Cart Button From Shop and Product Page

We will first show you how to remove the add-to-cart button from both product and shop pages. You must add code to the theme’s functions.php file to do this. You can also do this to your child theme’s functions.php file or a site-specific plugin.

For this tutorial, we will use a site-specific plugin called Code Snippets. Install and activate the plugin on your website.

activate code snippets

Once you have finished the activation, add a new snippet.

add new snippet

The code we are going to use is:

remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart');

Paste it in the code snippets plugin and activate it.

disable add to cart button

You will not see the add to cart button if you check your store from the front end.

no add to cart button

2. Disable the Add to Cart Button

If your goal is to display the add to cart button on the website but get rid of the function (not able to click), follow this method. We will use a code that disables the main functions of the add to cart button.

The code you need to be using is:

add_filter( 'woocommerce_is_purchasable', 'disable_add_to_cart_button' );
function disable_add_to_cart_button( $is_purchasable ) {
    // You can add conditions here to disable the button for specific products
    return false; // return false disables the 'Add to Cart' button
}

As we did earlier, add this as a function.

disable add to cart completely

After activating the code, check the store from the front end. Instead of the add to cart button, you will see a read more button. if you click on it, the page will redirect you to the product page.

cart disabled

Next, let’s see how to hide the add to cart button conditionally.

3. Conditionally Hide the Add to Cart button

To hide the add-to-cart button on a single product, you have to get its ID. If you go to WooCommerce products, you can see its ID.

product ID

In this case, the ID is 78. The snippet we need to use is:

add_action( 'woocommerce_after_shop_loop_item', 'hide_add_to_cart_for_specific_product', 10 );
function hide_add_to_cart_for_specific_product() {
    global $product;
    if ( 78 == $product->get_id() ) {
        remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
        remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
    }
}

You need to replace the ID in the snippet with your custom product ID. Once you have modified the code, paste it in the code snippet settings and activate.

custom product add to cart hiding

The add to cart button will be disabled for that specific product. You can check it from the front end to confirm.

4. CSS Method

This is one simple method of hiding your add-to-cart button. You can hide the button from the website using CSS code.

Here is how it’s done.

First, open the WordPress customizer and go to the additional CSS section.

additional css section - remove add to cart button in woocommerce

You will be pasting this CSS code:

.woocommerce .add_to_cart_button, .woocommerce .single_add_to_cart_button {
display: none;
}

Now save the changes, and the add to cart button will be hidden.

5. Changing the Inventory Value

If you need a method that doesn’t include coding, follow this. First, go to the WooCommerce product settings, then inventory. From there, enable inventory management.

inventory management - remove add to cart button in woocommerce

Now, go to any product. Under the inventory section, select the option out of stock.

out of stock product - remove add to cart button in woocommerce

Save the changes and check the product from the front end. You will not see the add to cart button.

out of stock in front end - remove add to cart button in woocommerce

That’s it!

These are the main methods to hide or remove the add to cart button in WooCommerce.

Bonus: Things to Keep In Mind While Removing the Add to Cart Button

While hiding or removing the “Add to Cart” button in WooCommerce might seem straightforward, there are a few important considerations you should keep in mind to ensure a smooth shopping experience for your customers.

Impact on User Experience

Removing or hiding the Add to Cart button can significantly change how users interact with your store. If you’re not careful, this could lead to a frustrating user experience. Removing the button provides alternative methods for customers to inquire about or purchase your products.

For instance, if you disable the Add to Cart button in WooCommerce, make sure there’s a clear call to action, such as a “Contact for Availability” or “Request a Quote” button.

Customer Expectations

If your store previously had an Add to Cart button and you choose to remove it, communicate this change clearly to your customers. If you’re moving to a more specialized purchasing method (like subscriptions or inquiries), ensure the new process is intuitive and easy to navigate.

Customizing Product Pages for Different Customer Needs

You might disable the Add to Cart button in WooCommerce for certain users based on their behavior or profile, such as removing the button for non-logged-in users or visitors from specific regions.

Customizing the experience can streamline the process and improve conversions for your ideal customers.

Customization Based on Product Type

When hiding the Add to Cart button in WooCommerce, you may want to apply this action selectively. For example, remove it for out-of-stock products, subscription-based services, or custom order items.

This way, you’re not limiting your site’s functionality for all products.

Possible Conflicts with Other Plugins

Removing the Add to Cart button could conflict with other WooCommerce extensions or plugins, especially those designed to enhance product visibility or functionality.

Testing how third-party plugins interact with the new setup is vital to avoid compatibility issues.

SEO Implications

Search engines rely on a structured site to index your pages effectively. Removing the Add to Cart button from WooCommerce could confuse search crawlers, who may expect an active purchase flow.

Ensure that your product pages remain well-optimized and that you’re not preventing potential sales or interactions through poor design decisions.

Frequently Asked Questions

Now, let’s see some frequently asked questions regarding the topic.

How can I remove the Add to Cart button in WooCommerce without disabling the product?

You can remove the Add to Cart button in WooCommerce using a custom code snippet or a plugin. This method hides the button but keeps the product visible for users to browse.

Can only hide the Add to Cart button in WooCommerce for specific products?

Yes. WooCommerce lets you hide the Add to Cart button for specific products using product-level settings, conditional logic in your functions file, or with the help of specialized plugins.

What’s the difference between hiding and disabling the Add to Cart button in WooCommerce?

Hiding the button simply makes it invisible on the product or shop page. Disabling it, however, removes its functionality altogether—users won’t be able to add the item even if they try via URL or other means.

Are there plugins that help disable the Add to Cart button in WooCommerce easily?

Yes. Several plugins, such as “Hide Price & Add to Cart Button for WooCommerce” or “WooCommerce Catalog Mode,” allow you to disable or hide the Add to Cart button without writing code.

Can I hide the Add to Cart button on the shop page but keep it on product pages?

Absolutely. WooCommerce lets you target different pages individually. Using conditional logic, you can hide the Add to Cart button on the shop/archive page while keeping it visible on individual product pages.

Why would someone want to hide the Add to Cart button in WooCommerce?

Some store owners may want to hide it while updating stock, collecting leads instead of direct sales, offering quote-based pricing, or running a catalog-only mode without checkout.

Will hiding the Add to Cart button affect SEO or user experience?

If done correctly, hiding the Add to Cart button won’t negatively impact SEO. However, it’s essential to ensure the user experience remains clear—guide users with alternate CTAs or messaging where needed.

Conclusion

Whether you run a catalog-style store, offer price-on-request products, or temporarily halt sales, knowing how to hide or remove the Add to Cart button in WooCommerce gives you complete control over your online store’s behavior.

From simple code snippets to powerful plugins, multiple ways exist to remove the Add to Cart button in WooCommerce without affecting your product visibility. Implementing the proper method allows you to disable the Add to Cart functionality while offering a seamless browsing experience.

Ensure your changes align with your store’s purpose and that users are still guided through a clear next step.

With flexibility and customization at your fingertips, WooCommerce makes it easy to tailor your store to your needs.

Which method are you going to use?

Let us know in the comments.

Hello!

Click one of our representatives below to chat on Telegram or send us an email to [email protected]

How can I help you?