{"id":36154,"date":"2025-03-15T08:05:22","date_gmt":"2025-03-15T08:05:22","guid":{"rendered":"https:\/\/ithemelandco.com\/?p=36154"},"modified":"2025-10-16T10:22:58","modified_gmt":"2025-10-16T10:22:58","slug":"woo-disable-add-to-cart-certain-product","status":"publish","type":"post","link":"https:\/\/ithemelandco.com\/blog\/woo-disable-add-to-cart-certain-product\/","title":{"rendered":"WooCommerce disable add to cart for certain products with 2 easy ways"},"content":{"rendered":"\n<p>In WooCommerce, the add-to-cart button is a crucial element that allows customers to purchase products directly from your online store. However, there are scenarios where you need to disable add to cart for certain products in WooCommerce, such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Out-of-Stock Products:<\/strong> You may want to hide the add-to-cart button for products that are temporarily out of stock but still visible in your store.<\/li>\n\n\n\n<li><strong>Inquiry-Only Products:<\/strong> For products that require a custom quote or inquiry before purchase, you might want to disable the add-to-cart button.<\/li>\n\n\n\n<li><strong>Display-Only Products: <\/strong>If you&#8217;re showcasing products that are not available for direct purchase (e.g., upcoming items or special collections), hiding the button can prevent confusion.<\/li>\n\n\n\n<li><strong>Membership or Restricted Products:<\/strong> For products available only to specific user roles or members, you may want to hide the button for non-eligible customers.<\/li>\n<\/ul>\n\n\n\n<p>By hiding or disabling the add-to-cart button for certain products in WooCommerce, you can create a more tailored shopping experience for your customers and better manage your store&#8217;s functionality.<\/p>\n\n\n\n<p>There are two main methods to hide or disable the add-to-cart button for specific products in WooCommerce:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#hide-add-to-cart-btn-by-code\" data-type=\"internal\" data-id=\"#hide-add-to-cart-btn-by-code\">Hide and disable add-to-cart button programmatically<\/a><\/li>\n\n\n\n<li><a href=\"#hide-add-to-cart-with-plugin\" data-type=\"internal\" data-id=\"#hide-add-to-cart-with-plugin\">Using WooCommerce Hide Price and Add to Cart Plugin<\/a><\/li>\n<\/ul>\n\n\n\n<p>In this guide, we&#8217;ll walk you through both methods, ensuring you can easily implement the solution that best suits your needs. Whether you&#8217;re a developer or a store owner, you&#8217;ll find these steps straightforward and effective. Let&#8217;s dive in!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is WooCommerce hide add to cart?<\/h2>\n\n\n\n<p>Hiding the add-to-cart button in WooCommerce for certain products means completely removing the button from the product page without displaying any replacement message or alternative option. When implemented, customers visiting the product page will not see the add-to-cart button at all, and no additional text or elements will take its place.<\/p>\n\n\n\n<p>This approach is useful for scenarios where you want to restrict purchasing options for specific products, such as display-only items, out-of-stock products, or items available only for inquiry while maintaining a clean and uncluttered product page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is WooCommerce disable add to cart?<\/h2>\n\n\n\n<p>WooCommerce disabling add to cart allows store owners to replace the button with a custom message that is <strong>not <\/strong>linked to the cart or checkout process. This means customers will see a tailored message, such as &#8220;<strong>Contact Us for Pricing<\/strong>&#8221; or &#8220;<strong>Available for Inquiry,<\/strong>&#8221; instead of the standard add-to-cart button.&nbsp;<\/p>\n\n\n\n<p>The custom message is purely informational and does not redirect users to the cart or enable them to purchase the product directly. Although it may guide customers to other useful web pages like <strong>Registration<\/strong> or <strong>Contact Us<\/strong> pages.<\/p>\n\n\n\n<p>This approach is ideal for products that require special handling, such as custom orders, out-of-stock items, or products available only through consultation, providing a clear and professional way to communicate with customers without enabling direct purchases.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to disable add to cart for certain products in WooCommerce?<\/h2>\n\n\n\n<p>Let\u2019s review a step-by-step guide for the above mentioned methods.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"hide-add-to-cart-btn-by-code\">Method 1: Hide and disable add-to-cart button programmatically<\/h3>\n\n\n\n<p>To disable the add-to-cart button for specific products in WooCommerce using custom code, you can add a PHP snippet to your theme&#8217;s functions.php file. This method allows you to target specific products by their IDs, categories, or other criteria.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">What to Consider Before Inserting the Code?<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Backup Your Site: <\/strong>Always create a full backup of your website, including the database and files, before making any changes to the code.<\/li>\n\n\n\n<li><strong>Use a Child Theme:<\/strong> If you&#8217;re adding the code to your theme&#8217;s functions.php file, use a <a href=\"https:\/\/developer.wordpress.org\/themes\/advanced-topics\/child-themes\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">child theme<\/a> to ensure your changes are not overwritten during theme updates.<\/li>\n\n\n\n<li><strong>Get Product IDs:<\/strong> Ensure you have the correct product IDs for the products you want to target. You can find the product ID by navigating to <strong>WordPress Dashboard &gt; Products &gt; All Products<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>Hover over the product for which you want to hide the add-to-cart button and note down the product ID (in this example, the ID is 25).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-01-product-id-in-woo.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"881\" height=\"104\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-01-product-id-in-woo.png\" alt=\"Woocommerce products id\" class=\"wp-image-36155\" srcset=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-01-product-id-in-woo.png 881w, https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-01-product-id-in-woo-500x59.png 500w\" sizes=\"(max-width: 881px) 100vw, 881px\" \/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Ask expert or use third party plugin:<\/strong> If you have no experience in coding, ask an expert to insert the custom code or use a plugin like Code Snippet to do it correctly.<\/li>\n<\/ul>\n\n\n\n<p>By following these considerations, you can safely and effectively disable the add-to-cart button for specific products in WooCommerce using custom code.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Hide the Add to Cart Button for all products.&nbsp;<\/h4>\n\n\n\n<p>Use the following code, if you want to hide add to cart button from both the product detail page and the shop page:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>remove_action( 'WooCommerce_after_shop_loop_item', WooCommerce_template_loop_add_to_cart');\n\nremove_action( 'WooCommerce_single_product_summary', 'WooCommerce_template_single_add_to_cart');<\/code><\/pre>\n\n\n\n<p>Once inserting the code, you should see that the add-to-cart button has been removed from all products.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-02-hide-price-result.png\"><img decoding=\"async\" width=\"450\" height=\"327\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-02-hide-price-result.png\" alt=\"Hide add-to-cart button by code\" class=\"wp-image-36156\" \/><\/a><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Hide add to cart button for specific product<\/h4>\n\n\n\n<p>To hide the add-to-cart button for a specific product in WooCommerce, add the following code to your&nbsp;<strong>functions.php<\/strong>&nbsp;file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_action( 'WooCommerce_after_shop_loop_item', 'hide_add_to_cart_for_specific_product', 10 );\nfunction hide_add_to_cart_for_specific_product() {\n&nbsp; &nbsp; &nbsp; global $product;\n&nbsp; &nbsp; if ( 25 == $product-&gt;get_id() ) {\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; remove_action( 'WooCommerce_after_shop_loop_item', 'WooCommerce_template_loop_add_to_cart' );\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; remove_action( 'WooCommerce_single_product_summary', 'WooCommerce_template_single_add_to_cart', 30 );\n&nbsp; &nbsp; }\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-03-result-of-hide-add-to-cart-btn-on-specific-product.png\"><img decoding=\"async\" width=\"793\" height=\"609\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-03-result-of-hide-add-to-cart-btn-on-specific-product.png\" alt=\"Hide add-to-cart button on specific products result\" class=\"wp-image-36157\" srcset=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-03-result-of-hide-add-to-cart-btn-on-specific-product.png 793w, https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-03-result-of-hide-add-to-cart-btn-on-specific-product-500x384.png 500w\" sizes=\"(max-width: 793px) 100vw, 793px\" \/><\/a><\/figure>\n\n\n\n<p>By applying this code, the add-to-cart button will be removed for the product with ID<strong> 25<\/strong>. You can replace this ID (Yellow highlighted) with any other product IDs to disable their add to cart button.<\/p>\n\n\n\n<figure class=\"wp-block-pullquote\"><blockquote><p><strong>Read More:<\/strong> <a href=\"https:\/\/ithemelandco.com\/blog\/woo-hide-add-to-cart-btn-in-category\/?utm_source=blog&amp;utm_content=disable-add-to-cart\" data-type=\"link\" data-id=\"https:\/\/ithemelandco.com\/blog\/woo-hide-add-to-cart-btn-in-category\/\" target=\"_blank\" rel=\"noreferrer noopener\">WooCommerce hide add to cart button for specific category (3 ways)<\/a>.<\/p><\/blockquote><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Disable add to cart button for certain products&nbsp;<\/h4>\n\n\n\n<p>Add the following code to disable the add-to-cart button for a specific product in WooCommerce:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'WooCommerce_is_purchasable', 'disable_add_to_cart_button' );\nfunction disable_add_to_cart_button( $is_purchasable ) {\n<mark class=\"has-inline-color has-luminous-vivid-amber-color\">\/\/add conditions here to disable the button for specific products if needed<\/mark>\n<mark class=\"has-inline-color has-luminous-vivid-amber-color\">\n<\/mark>Return false; \/\/ return false disables the 'Add to Cart' button\n}<\/code><\/pre>\n\n\n\n<p>By running this code, customers are not able to click on the add to cart button and add items to their cart.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"hide-add-to-cart-with-plugin\">Method 2: WooCommerce disable add to cart for certain products with hide price and add-to-cart button plugin<\/h3>\n\n\n\n<p>Using the <a href=\"https:\/\/ithemelandco.com\/plugins\/woocommerce-hide-price-by-user-role\/?utm_source=blog&amp;utm_content=disable-add-to-cart\" target=\"_blank\" rel=\"noreferrer noopener\">WooCommerce hide price and add-to-cart button plugin<\/a> is a simple and effective way to disable the add-to-cart button for specific products without needing to write any code.&nbsp;<\/p>\n\n\n\n<p>This plugin is a powerful tool designed to enhance the flexibility of WooCommerce stores by allowing merchants to hide product prices or add to cart button from specific users or user roles.&nbsp;<\/p>\n\n\n\n<p>The plugin offers customizable options, such as hiding prices globally, for specific products, or particular user roles, and it can replace the price or add to cart label with a custom message like &#8220;Login to See Price&#8221; or &#8220;Contact Us for Pricing.&#8221; Additionally, it integrates seamlessly with WooCommerce, ensuring compatibility with most themes and plugins.&nbsp;<\/p>\n\n\n\n<p>This functionality helps businesses maintain pricing confidentiality while improving user experience and encouraging customer engagement.<\/p>\n\n\n\n<p>Below is a step-by-step guide on how to use this plugin to achieve your goal:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Install and activate the plugin<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Download the <strong>ZIP<\/strong> file and get the License key.<\/li>\n\n\n\n<li>Go to your <strong>WordPress Dashboard&gt; Plugins &gt; Add New.<\/strong><\/li>\n\n\n\n<li>Click on the <strong>Upload<\/strong> button and choose the <strong>ZIP<\/strong> file.&nbsp;<\/li>\n\n\n\n<li>Press <strong>Install<\/strong> to see the below items in the WordPress Dashboard.&nbsp;<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-04-license-page.png\"><img loading=\"lazy\" decoding=\"async\" width=\"377\" height=\"265\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-04-license-page.png\" alt=\"Opening ithemeland's license page\" class=\"wp-image-36158\" \/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to the <strong>IThemeland &gt; License.&nbsp;<\/strong><\/li>\n\n\n\n<li>Insert the <strong>License key<\/strong> in the form and activate the plugin.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-05-activate-hide-price-plugin.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1260\" height=\"380\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-05-activate-hide-price-plugin.png\" alt=\"Activating woo hide price plugin\" class=\"wp-image-36159\" srcset=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-05-activate-hide-price-plugin.png 1260w, https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-05-activate-hide-price-plugin-500x151.png 500w\" sizes=\"(max-width: 1260px) 100vw, 1260px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Add a rule to hide the add-to-cart button for specific products<\/h3>\n\n\n\n<p>After activating the plugin, go to <strong>IThemeland &gt; Hide Price<\/strong> in your WordPress dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-06-open-hide-price-plugin.png\"><img loading=\"lazy\" decoding=\"async\" width=\"376\" height=\"281\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-06-open-hide-price-plugin.png\" alt=\"Opening hide price plugin for woo\" class=\"wp-image-36160\" \/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Click on the <strong>Add Rule<\/strong> button on the <strong>Rules<\/strong> page to open the <strong>New Rule<\/strong> form.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-07-add-rule-in-hide-price-plugin.png\"><img loading=\"lazy\" decoding=\"async\" width=\"873\" height=\"228\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-07-add-rule-in-hide-price-plugin.png\" alt=\"Add rule in hide price plugin\" class=\"wp-image-36161\" srcset=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-07-add-rule-in-hide-price-plugin.png 873w, https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-07-add-rule-in-hide-price-plugin-500x131.png 500w\" sizes=\"(max-width: 873px) 100vw, 873px\" \/><\/a><\/figure>\n\n\n\n<p>In the new rule form, you need to fill in the following fields:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Title<\/strong>: Add a title for your new rule.<\/li>\n\n\n\n<li><strong>Apply rule to<\/strong>: In this section, you need to add one of the following:\n<ul class=\"wp-block-list\">\n<li><strong>Specific User roles<\/strong>: Choose one or more user roles that you have already defined in WordPress to apply the rule on. For example, customers, managers, contributors, etc.<\/li>\n\n\n\n<li><strong>Specific Customers<\/strong>: Add the name of one or more customers that you want to hide add-to-cart button for them.<\/li>\n\n\n\n<li><strong>Guests<\/strong>: Choose this option if you want to hide the add to cart button from the guest users.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>In the <strong>Select Products<\/strong> fields, add one or more products to apply the changes only to those specific products.<\/li>\n<\/ol>\n\n\n\n<p><strong>Note: <\/strong>You can alternatively mark <strong>Apply on All products<\/strong> to hide the add-to-cart button of all products in your store.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-08-set-rule-for-hide-price-and-addtocart-btn.png\"><img loading=\"lazy\" decoding=\"async\" width=\"785\" height=\"832\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-08-set-rule-for-hide-price-and-addtocart-btn.png\" alt=\"Set new rule fore hide hide price and add-to-cart button\" class=\"wp-image-36162\" srcset=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-08-set-rule-for-hide-price-and-addtocart-btn.png 785w, https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-08-set-rule-for-hide-price-and-addtocart-btn-500x530.png 500w\" sizes=\"(max-width: 785px) 100vw, 785px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>&nbsp;Mark <strong>Hide Add to Cart button<\/strong>. If you just mark this option and save changes, the add to cart button will completely disappear from the product page of those specific products.<\/li>\n<\/ol>\n\n\n\n<p>However, you can add a custom message instead of the add-to-cart button in the <strong>Custom button label<\/strong> field.<\/p>\n\n\n\n<p>It is also possible to add a URL to the <strong>Custom button link<\/strong> to guide the customers to that address when clicking on the add-to-cart button.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example 1: Hide the add-to-cart button for specific products from guests users<\/h4>\n\n\n\n<p>Suppose that you want to hide the add to cart button for <strong>Red wine<\/strong>, <strong>Tiramisu<\/strong>, and <strong>Luxury biscuits<\/strong> for guests in your store.&nbsp;<\/p>\n\n\n\n<p>To do this, you just need to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Write a title like \u201cWooCommerce disable add to cart for certain products\u201d.<\/li>\n\n\n\n<li>Choose <strong>Guest<\/strong> from the list of <strong>Apply rule to <\/strong>field.<\/li>\n\n\n\n<li>Add the mentioned products to the <strong>Select Products<\/strong> field.<\/li>\n\n\n\n<li>Mark <strong>Hide add to cart<\/strong> button.<\/li>\n\n\n\n<li>Press the <strong>Add Rule<\/strong> button.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-09-hide-add-to-cart-btn-of-specific-product-for-guests.png\"><img loading=\"lazy\" decoding=\"async\" width=\"810\" height=\"761\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-09-hide-add-to-cart-btn-of-specific-product-for-guests.png\" alt=\"Hide add-to-cart button for specific products and guest users\" class=\"wp-image-36164\" srcset=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-09-hide-add-to-cart-btn-of-specific-product-for-guests.png 810w, https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-09-hide-add-to-cart-btn-of-specific-product-for-guests-500x470.png 500w\" sizes=\"(max-width: 810px) 100vw, 810px\" \/><\/a><\/figure>\n\n\n\n<p>So, when guests visit your website, the add to cart button won\u2019t display them for the selected products:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-10-result-on-hide-add-to-cart-btn-on-product.png\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"298\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-10-result-on-hide-add-to-cart-btn-on-product.png\" alt=\"Resut of hide add-to-cart button-using hide price plugin\" class=\"wp-image-36165\" \/><\/a><\/figure>\n\n\n\n<div class=\"wp-block-columns alignwide are-vertically-aligned-center main-cta-cnt has-background is-layout-flex wp-container-core-columns-is-layout-4a33225c wp-block-columns-is-layout-flex\" style=\"background-color:#3d67ff;padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:30px\">\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-group is-layout-constrained wp-container-core-group-is-layout-4f39da6d wp-block-group-is-layout-constrained\" style=\"padding-top:15px\">\n<p class=\"single-cta-heading has-white-color has-text-color has-link-color wp-elements-5fb947b1d88fdc6f473defca07820aea\" style=\"font-size:26px;font-style:normal;font-weight:800\">HIDEPRICEiT &#8211; Hide Price &amp; Add to Cart Button for WooCommerce<\/p>\n\n\n\n<p class=\"single-cta-desc has-white-color has-text-color has-link-color wp-elements-7069a05302855eb34d674fb5bfc6ff2c\" style=\"font-size:16px\">The easy way to hide add-to-cart button for specific products in WooCommerce<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button main-cta-button\"><a class=\"wp-block-button__link has-text-color has-background wp-element-button\" href=\"https:\/\/ithemelandco.com\/plugins\/woocommerce-hide-price-by-user-role\/?utm_source=blog&amp;utm_content=disable-add-to-cart\" style=\"border-style:none;border-width:0px;border-radius:40px;color:#ffffff;background-color:#0fba5e;padding-top:10px;padding-right:30px;padding-bottom:10px;padding-left:30px;font-style:normal;font-weight:500\" target=\"_blank\" rel=\"noreferrer noopener\">Buy Plugin<\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"532\" height=\"355\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/10\/hidepriceit-banner.png\" alt=\"HIDEPRICEiT - Hide Price &amp; Add to Cart Button for WooCommerce plugin by ithemeland\" class=\"wp-image-48721\" style=\"width:440px;height:auto\" srcset=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/10\/hidepriceit-banner.png 532w, https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/10\/hidepriceit-banner-500x335.png 500w\" sizes=\"(max-width: 532px) 100vw, 532px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Example 2: Disable add-to-cart button for specific products for customers&nbsp;&nbsp;<\/h4>\n\n\n\n<p>In this example, we tried to disable the add to cart button and display a <strong>Contact Us<\/strong> message to the customers when they visit the same products as in the previous example.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Write a name like \u201cDisable add to cart button\u201d.<\/li>\n\n\n\n<li>Choose a <strong>Specific user role,<\/strong> then, <strong>Customer<\/strong> from the list of <strong>Apply rule to<\/strong> and <strong>Rule for user roles<\/strong> fields, respectively.<\/li>\n\n\n\n<li>Add the same products in the <strong>Select Products<\/strong> field.<\/li>\n\n\n\n<li>Mark <strong>Hide Add to cart<\/strong> button .<\/li>\n\n\n\n<li>Write <strong>Contact us<\/strong> in the <strong>Custom button label.<\/strong><\/li>\n\n\n\n<li>Press the <strong>Add rule<\/strong> button.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-11-rule-of-disable-add-to-cart-btn-for-customers.png\"><img loading=\"lazy\" decoding=\"async\" width=\"846\" height=\"705\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-11-rule-of-disable-add-to-cart-btn-for-customers.png\" alt=\"Rule for disabling add-to-cart button for customer users\" class=\"wp-image-36166\" srcset=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-11-rule-of-disable-add-to-cart-btn-for-customers.png 846w, https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-11-rule-of-disable-add-to-cart-btn-for-customers-500x417.png 500w\" sizes=\"(max-width: 846px) 100vw, 846px\" \/><\/a><\/figure>\n\n\n\n<p>So, when customers visit the selected product pages, they will see the <strong>Contact Us<\/strong> message instead of the add to cart button. They can not click on the button and proceed to checkout because you have disabled it:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-12-result-of-disable-add-to-cart-btn.png\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"303\" src=\"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-12-result-of-disable-add-to-cart-btn.png\" alt=\"Result of showing custom button instead of add-to-car\" class=\"wp-image-36167\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Why do you need to disable the add-to-cart button for specific products?<\/h2>\n\n\n\n<p>Disabling the add-to-cart button is a strategic decision that serves various business and operational purposes. Here are some common reasons why store owners might need WooCommerce disable add-to-cart button for specific products:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Products available for inquiry only<\/h3>\n\n\n\n<p>Some products, such as custom-made items, bulk orders, or high-value goods, may require direct communication with the seller before purchase. Disabling the add-to-cart button and replacing it with a message like \u201cContact Us for Pricing&#8221; encourages customers to reach out for more details.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Out-of-Stock products<\/h3>\n\n\n\n<p>If a product is temporarily out of stock but you still want to display it on your store, hiding the add-to-cart button prevents customer frustration and avoids misleading them into thinking the product is available for immediate purchase.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Display-only or upcoming products<\/h3>\n\n\n\n<p>For products that are showcased as part of a catalog or upcoming collection but not yet available for purchase, hiding the button ensures customers understand the product is not ready for sale.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Membership or restricted products<\/h3>\n\n\n\n<p>If certain products are exclusive to specific user roles (e.g., wholesale customers or members), WooCommerce disable add-to-cart button for non-eligible users ensures only authorized customers can purchase them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Prevent Direct Purchases<\/h3>\n\n\n\n<p>Some products may require additional steps before purchase, such as signing a contract, providing documentation, or attending a consultation. Hiding the button ensures customers follow the correct process.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Promotional or informational products<\/h3>\n\n\n\n<p>Products used for promotional purposes (e.g., free gifts or demo items) or informational purposes (e.g., product bundles or guides) may not be available for direct purchase. Hiding the button avoids confusion.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Compliance with Regulations<\/h3>\n\n\n\n<p>&nbsp;In some industries, certain products may require age verification, legal agreements, or other compliance measures before purchase. Hiding the button ensures customers follow the necessary steps.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enhance User Experience<\/h3>\n\n\n\n<p>By hiding the add-to-cart button for specific products, you can create a cleaner and more focused shopping experience, guiding customers toward the products they can actually purchase.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>In summary, hiding the add-to-cart button for certain products helps store owners manage their inventory, improve customer communication, and create a more tailored shopping experience. It ensures customers are not misled and aligns with your business goals and operational requirements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In WooCommerce, the add-to-cart button is a crucial element that allows customers to purchase products directly from your online store. However, there are scenarios where you need to disable add to cart for certain products in WooCommerce, such as: By hiding or disabling the add-to-cart button for certain products in WooCommerce, you can create a [&hellip;]<\/p>\n","protected":false},"author":137,"featured_media":36169,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50,73],"tags":[],"class_list":["post-36154","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-woocommerce"],"featured_image_url":"https:\/\/ithemelandco.com\/blog\/wp-content\/uploads\/2025\/03\/136-disable-add-to-cart-btn-500x335.webp","excerpt_plain":"In WooCommerce, the add-to-cart button is a crucial element that allows customers to purchase products directly from your online store. However, there are scenarios where you need to disable add to cart for certain products in WooCommerce, such as: By hiding or disabling the add-to-cart button for certain products in WooCommerce, you can create a [&hellip;]","_embedded":{"wp:term":[[{"term_id":50,"name":"Tutorials","slug":"tutorials","term_group":0,"term_taxonomy_id":50,"taxonomy":"category","description":"Follow and learn the latest educational articles about WordPress plugins and WooCommerce here","parent":0,"count":256,"filter":"raw"},{"term_id":73,"name":"WooCommerce","slug":"woocommerce","term_group":0,"term_taxonomy_id":73,"taxonomy":"category","description":"Do you use WooCommerce to manage your online store? We suggest you read this category of WooCommerce articles.","parent":50,"count":205,"filter":"raw"}]]},"_links":{"self":[{"href":"https:\/\/ithemelandco.com\/blog\/wp-json\/wp\/v2\/posts\/36154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ithemelandco.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ithemelandco.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ithemelandco.com\/blog\/wp-json\/wp\/v2\/users\/137"}],"replies":[{"embeddable":true,"href":"https:\/\/ithemelandco.com\/blog\/wp-json\/wp\/v2\/comments?post=36154"}],"version-history":[{"count":3,"href":"https:\/\/ithemelandco.com\/blog\/wp-json\/wp\/v2\/posts\/36154\/revisions"}],"predecessor-version":[{"id":48830,"href":"https:\/\/ithemelandco.com\/blog\/wp-json\/wp\/v2\/posts\/36154\/revisions\/48830"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ithemelandco.com\/blog\/wp-json\/wp\/v2\/media\/36169"}],"wp:attachment":[{"href":"https:\/\/ithemelandco.com\/blog\/wp-json\/wp\/v2\/media?parent=36154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ithemelandco.com\/blog\/wp-json\/wp\/v2\/categories?post=36154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ithemelandco.com\/blog\/wp-json\/wp\/v2\/tags?post=36154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}