How To: Remove Product Quantity Selectors – WooCommerce

Another snippet that I’ve found useful, is by removing product quantity selectors in WooCommerce, this is rare to happen but mostly in products that are too expensive that you can’t even hold your mouse and click the “add to cart” button, so in that case we better take the quantity selector off, don’t worry by default it added single item into your cart.

Let’s get started


Hide in all product type

That’s it, Happy Coding ^_^

by Ryan Sutana

  • Ryan,

    quick question on this. How might I hide the quantity selector but filtered by product category, not type.

    For instance, I have two categories, products and donations.

    It’s cool to have quantity selector for products, but not donations.

    What is the equivalent term here: $product->product_type

    Can’t use product type, but not sure what product_categories tag would be

    Should I use is_product_category( ) and then inset the category name there?


  • As a head’s up, if you mark the product as “sold individually” in the product’s admin metabox, you won’t see the quantity selectors on the front-end.

    • Yeah that sounds fine but only for less amount of products, think about if you have huge amount of products and in categories I don’t think you have to edit each individually 🙂

      • Fair enough. I was going to suggest filtering the is_product_sold_individually value, but you are already all over that. 🙂

  • Carol

    Where should I add this code??

    • It’s a basic question but for WordPress hook and filter you should add it in your current theme functions.php file

      Hope that helps

  • Is there a way to only remove the quantity selector on the single product page?

    When I apply the function the quantity selector is missing from the cart page which is where I want it.

    • Hi you can add condition before the return

      if( is_product() ) {
      return true;

      • Thanks Ryan. Would the following be correct?

        function wc_remove_all_quantity_fields( $return, $product ) {
        if( is_product() ) {
        return true;
        add_filter( ‘woocommerce_is_sold_individually’, ‘wc_remove_all_quantity_fields’, 10, 2 );

        • yeah it’s good to go, you can test it and see if it works 🙂

          • It’s not working. I think it may be a syntax issue. I can work in a functions file but am not a developer.

  • Sisi

    I want to disable the mouse over/ hover quantity spinner/ selector. I want the
    spinner/selector visible, so the arrow up and arrown down should appear. Where
    can I disable that? Should I do in css?

  • Lina

    Thank you for the code, but this hides the input field too. I would like to keep the input field but to hide the selectors for all products, so the customer can still change the amount by changing the number in the inout field. How can I achieve this?
    Many thanks in advance and happy new year 🙂