How to Remove the Quantity Field from a WooCommerce Product Page

  Introduction
By default, WooCommerce shows a quantity selector on a product's page. This might not always be needed, so here are three ways in which you can remove the quantity field from WooCommerce product pages.

WP Mayor’s work is supported by its audience. If you purchase through a link on our website, we may earn a commission. Here’s why you can trust us.

Table of contents

In this post, I will show you 3 ways to remove the quantity field from a WooCommerce page.

By default, WooCommerce shows a quantity field or selector on your product pages. While this is an awesome feature to have, it might not always be needed.

Say you are offering clients WordPress support plans – you would want each client to purchase only one plan at a time.

Let’s see how it’s done.

#1 Use a Hook or Filter to Remove the Quantity Field

This has been the most popular method among our readers – presumably developers – the hook.

Add the below code to your website and it will remove the quantity field for all your WooCommerce products across your store.

function custom_remove_all_quantity_fields( $return, $product ) {return true;}
add_filter( 'woocommerce_is_sold_individually','custom_remove_all_quantity_fields', 10, 2 );

Follow this guide on how to add custom code to your website if you’re not sure how to do it safely.

If this is all you’re after, it’s that simple.

Quick tip: Now that you’ve simplified the product page, make the next step even simpler. Clicking on “Add to cart” usually sends your customers to a long and tedious checkout form on a separate page. Use a shopping cart plugin to increase conversions with an optimized checkout process.

#2 Use the Option in the Product Data Metabox

The quantity option in WooCommerce itself is a simpler method, but also the most tedious when you have a lot of products in your store.

To use the quantity option in WooCommerce, go to one of your WooCommerce product pages in the WordPress dashboard.

Scroll down to the Product Data metabox. Go to Inventory and enable the checkbox near Sold individually.

Doing so allows only one item to be bought in a single order.

WooCommerce Remove Product Quantity

Hit Update and refresh your product page. The quantity field is now disabled.

But if you want to set multiple products to be sold individually, you will have to repeat this process for each product.

In the video below it takes us 25 seconds to do this for one product, so you can imagine how long it might take you for a whole store.

Alternatively, you can use a plugin like WooCommerce Quantity Manager to help speed up the process.

#3 Using the WooCommerce Quantity Manager Plugin

The WooCommerce Quantity Manager plugin is the easiest solution to help manage your WooCommerce product quantities across your store.

Among others, this plugin lets you:

  • Set global quantity rules and defaults throughout your store.
  • Set quantity minimums and maximums for specific categories.
  • Add minimum or maximum quantity rules for individual products.
  • Set quantity rules for individual product variations.

It also comes with additional features such as quantity step values (add interval-based quantities and multiples) and helpful errors and prompts to guide your customer on their buyer journey.

#3(a) How to set a maximum quantity of 1 for all products

Once you have installed and activated the plugin, head to the WooCommerce Quantity Manager settings page in WooCommerce.

Scroll down to the Order quantity rules section and set the maximum to 1. This will set all your products to have a maximum quantity of 1. It’s that easy.

Global maximum quantity set

As you can see in the screenshot above, the plugin lets you set order values, default quantities, and step values. You can also set user roles, so there’s a lot more value to this plugin.

#3(b) How to set a maximum quantity of 1 for all products in a category

Another great feature of this plugin is that it lets you set quantity rules for specific categories.

Let’s say I have a category called “Digital Services”. I would like all the products in this category to have a maximum quantity of 1.

To achieve this in a few seconds, go to the category and scroll down to the Quantity rules section. Set the maximum amount to 1 and in no time at all, all the products in that category will be sold individually.

WooCommerce category quantity rules

The result

Quantity field
Before
No quantity field
After

Which is your preferred method?

Share your preferred solution in the comments below and why you chose it so that other readers like yourself can make a more informed decision themselves.

So far, most of the developers who’ve found this tutorial have chosen the first method, but we’re seeing more no-code website builders prefer option 3.

It’s simple and scalable at the same time, plus you don’t have to manage more custom code in the future.

The choice is yours. Best of luck with your store!

Next Step 

Jean Galea
Jean Galea
Jean Galea is an investor, entrepreneur, and blogger. He is the founder of WP Mayor, the plugins WP RSS Aggregator and Spotlight, as well as the Mastermind.fm podcast. His personal blog can be found at jeangalea.com.
Jean Galea
Jean Galea
Jean Galea is an investor, entrepreneur, and blogger. He is the founder of WP Mayor, the plugins WP RSS Aggregator and Spotlight, as well as the Mastermind.fm podcast. His personal blog can be found at jeangalea.com.
PeachPay for WooCommece

An all-in-one checkout and payment solution for WooCommerce . See your store's sales increase by 35%!

4 Months FREE with WP Engine

4 months free on all shared managed WordPress and eCommerce hosting plans. Offer ends on 12/01/2022.

Expand your toolset with expertly verified solutions delivered to your inbox every week.
Join thousands of designers, developers, and marketers who trust our experts to find and test the best tools for their WordPress sites.
By signing up to our newsletter, you agree to receive electronic communications from WP Mayor that may include advertisements.
Expand your toolset with expertly verified solutions delivered to your inbox every week.
Join thousands of designers, developers, and marketers who trust our experts to find and test the best tools for their WordPress sites.​
By signing up to our newsletter, you agree to receive electronic communications from WP Mayor that may include advertisements.

20 Responses

  1. Hey, I don’t suppose you have a hook to set the increment value of the quantity box? so 10, 20, 30 instead of 1,2,3?

  2. Hi, that’s really useful. Thanks for publishing. Can you add if it is possible to use the functions.php hook but restricted to a certain category?

  3. They should really make this a global setting you can set in the backend. But I appreciate the hook.

  4. Thank you, helpful tip! What would be the snippet to remove the qty field from shop/archive pages as well? I found that this field is not working well on mobile devices.

  5. Thank you For sharing the Great article and this article is very helpful for me.
    we follow this technique in my activities to improve.keep it up my friend.

Leave a Reply

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

From web hosting to WooCommerce plugins and backup services, we have put together a collection of exclusive coupons and deals just for you.
WP Mayor_Icon_white
2022 Reader Survey