How to Remove the WooCommerce Quantity Field

How to Remove the WooCommerce Quantity Field

WooCommerce includes a quantity input field on products by default. This input shows up on both the individual product page as well as the cart review screen. This simple feature, especially on the cart view, seems like a wonderful addition to make the user experience better but sometimes it has unintended consequences.

If you never want your customers to be able to order more than one of any given product for sale on your site you are going to want to disable the quantity field from your WooCommerce theme.

There are several ways to do this and they range from tedious to quick and easy. First, we’ll show you how you can manage this by editing products individually inside of WooCommerce. Next, we’ll go through how you can make a universal change and remove every quantity field from your site. This method involves some pretty technical steps and is not for everyone. Finally, we’ll show you how you can purchase our plugin and get incredible control over how you remove quantity fields, and save yourself tons of time and hassle in the process.

Quantity Field on a WooCommerce Product
An example of a Quantity Field on a WooCommerce Product

How to Hide the Quantity Field on WooCommerce Products

There’s an option inside of WooCommerce’s product management interface to mark an item as only eligible for individual sale. You can find this by opening up your product inside of the WooCommerce admin and scrolling down to the “Product Data” section of the interface.

Under “Product Data” you will see a series of tabs on the left-hand side. The option you are looking for is available under the “Inventory” tab. At the bottom of that tab is a checkbox called “Sold Individually” that will disable the quantity field for this particular product (and only this product).

WooCommerce Product Marked as "Sold Individually"
A WooCommerce Product Marked as “Sold Individually”

Checking that box and saving your product will remove the quantity field from the product’s page and its row in the cart view when a customer is going to checkout. When a product is marked as “Sold Individually” it also has the added bonus of preventing customers from adding more than one item to your cart by disabling the “Add to Cart” process if one of the items has already been added.

Remove the Quantity Field from All WooCommerce Products with Custom Code

Let’s write some code. You can disable quantity fields throughout your store’s site with a bit of theme editing. First, we’re going to walk through the steps on how you can do this safely. Then we’ll show you the actual code and where to put it.

Alert! Please make a backup of your current WordPress installation before attempting any of the following steps. Make sure you have working backups of your site’s database as well as its theme files. If things go wrong you will need to revert back to those prior versions. You should do regular backups of your store at least weekly. Find a company offering WordPress maintenance packages to handle this for you.

Make a Child Theme

No one should edit a WordPress theme directly. Any changes you make to a theme’s files will be automatically overwritten during future updates. The best way to adjust your WooCommerce store’s look is through a child theme. You can read more about WordPress child themes, and how to create one correctly, using tutorials online.

The basic idea is that the child theme loads up the parent theme, applies your changes, and then displays the site to your visitors. Any updates you download for the parent theme will not change the child theme files. In theory, that means your changes to the site layout will still maintain through the update process.

Add Code to the Child Theme

WordPress themes have a file called functions.php where you can add code snippets. Create that file inside your child theme’s directory and then open it up in a text editor. Add the following lines of code to the file:

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

This piece of code is both simple and limited at the same time. You will globally disable quantity fields on your site with this snippet. That means every product page and line item in your cart template will no longer have the quantity field shown.

After you’ve added those lines of code save the functions.php file. You’re ready for the next step which is uploading your child theme to your server.

Upload the Child Theme

This is probably the most technical part of the process. Yes, even more so than building a child theme and writing code in a text editor. You need to take your new child theme and upload it to your site’s web host. There are dozens of free FTP programs you can use to do this. Your hosting provider’s technical support staff might be able to help as well.

Has this gotten a bit too technical for you? You can remove quantity fields from your WooCommerce site without all of this nonsense. Avoid the mess of editing themes and uploading files completely. Jump ahead in this article to learn how our plugin can help.

Active the Child Theme

We are almost finished. When you have successfully uploaded your child theme it should appear under Appearance in the WordPress admin. If you don’t see it there then check the upload again. You might have missed a file or done something incorrectly.

Your quantity fields should be gone from the store as soon as you activate the child theme. If they are still there or, even worse, your site is broken with errors you need to go back and find the problem in your code. This is the point where you might need to find a knowledgeable WordPress developer to help.

Quantity Field Removed from WooCommerce Product
An example of a Quantity Field Removed from WooCommerce Product

Assuming all has gone well then it’s time to congratulate you on being a successful WordPress theme developer. These kinds of projects aren’t for everyone. There is a simpler, and less time-intensive way, to deal with this WooCommerce change.

Disable the Quantity Field from Your WooCommerce Store in Seconds

We have built a simple and easy-to-use plugin that removes the WooCommerce quantity field from your site. The plugin has several large advantages over the code snippet we explained above. Mainly, with our plugin, you get to control exactly which products and product categories no longer have the quantity field.

You can use our plugin to remove the quantity field from:

  • All Products
  • Products in Specific Categories
  • Specific Products

Purchasing and installing our plugin couldn’t be easier. You won’t have to make a WordPress child theme. You don’t need to learn how to use a text editor to copy and paste some PHP code. There is no need to test your child theme to make sure everything went well. And there’s no risk that your site will break because of some careless programming mistake you made. And, if you are worried about installing a plugin for the first time, don’t be. We will email you complete instructions after your purchase telling you what to do. The whole process only takes a few seconds.

After installation, you’ll discover a new Remove Features tab in the settings for WooCommerce. This is where you get to pick exactly how the quantity field is removed from your store.

Screenshot of RWF Quantity Field Plugin's Settings

That’s all you need to do. The plugin gives you full control over how and when a quantity field appears on your site. Simply check a box or type in a few product names or categories. Your choices take effect immediately after you save your settings.

When you purchase our plugin you get:

  • 90 days of support. Get help with your plugin up to three months after purchase.
  • No license keys or yearly subscriptions. Pay $9 once.
  • Unlimited installations. Install the plugin on as many sites as you want.

We offer a 14-day money-back guarantee. Get a full refund if you are unhappy with our plugin or if it doesn’t meet your expectations.