WooCommerce Hide Quantity Input Field From Product Page

WooCommerce is good plugin for selling products online it comes
with lots of customization and options you can sell any kind ofproduct with it digital products as well some times we provide thatcustomer buy only one item at time or there is not need for Item Quantity Field and you realize later after adding lots of products. Now there is a filter you can apply using theme function file and the field will hide.Hide Quantity Field from All Product Types You can use below code paste it into function.php file of your theme and save.

woocommerce_input_field-300x281Want Best WooCommerce themes Click here

Mothod 1: Hide From all product type

/**@ Remove in all product type*/
function baztro_remove_all_quantity_fields( $return, $product ) {
return true;
add_filter( 'woocommerce_is_sold_individually', 'baztro_remove_all_quantity_fields', 10, 2 );


Method 2 If You want to hide from particular type of product

* @Hide from different product type group
add_filter( 'woocommerce_is_sold_individually', 'baztro_wc_remove_all_quantity_fields', 10, 2 );
function baztro_wc_remove_all_quantity_fields( $return, $product ) {
switch ( $product->product_type ) :
case "variable":
return true;
case "grouped":
return true;
case "external":
return true;
default: // simple product type
return true;

Method 3 Hide WooCommerce Input Field using CSS

Method 4: Using Option Sold Individually in Edit Product Page

  • Choose product where you don’t wish to show quantity field
  • Edit Product
  • From Bottom Click Inventory
  • Check the box Sold Individually
  • Update Product
woocommerce Sold Individually
Check Sold Individually

These are some code that definitely work for you if any problem please discuss in below in comment.


Leave a Reply
  1. Hi,
    I’m using woocommerce plugin ver 3.0.8 and divi theme 3.0. I checked sold individually and still it is showing quantity on single product detail page. I have used filter function to display quantity on shop page. The function added is below

    * Code to display quantity on shop page alongwith add to card.

    add_filter( ‘woocommerce_loop_add_to_cart_link’, ‘quantity_inputs_for_woocommerce_loop_add_to_cart_link’, 10, 2 );
    function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) {
    if ( $product && $product->is_type( ‘simple’ ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) {
    $html = ‘add_to_cart_url() ) . ‘” class=”cart” method=”post” enctype=”multipart/form-data”>’;
    $html .= woocommerce_quantity_input( array(), $product, false );
    $html .= ” . esc_html( $product->add_to_cart_text() ) . ”;
    $html .= ”;
    return $html;

Leave a Reply

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

Aircel Offer For 1GB Free Internet With Voice Facility


Integrate Google No reCAPTCHA into Website Form