How to sell by weight in WooCommerce: a complete guide

How to configure WooCommerce for weight-based sales

By default, WooCommerce has no easy, built-in way to sell products by weight. When a customer wants 1.75 kg of your specialty coffee — not 1 kg, not 2 kg, exactly 1.75 — you can’t just let them type that in.

This article covers 2 simple methods to change that! This would open up a world of opportunities for:

  • Grocery store owners who offer bulk food purchases
  • Butchers who weigh their cuts to the last ounce
  • Garden centers that measure out soil and mulch by the kilo 
  • And many more businesses! 

This article provides a step-by-step guide to setting up and optimizing weight-based sales. It covers two methods:

  1. Using WooCommerce variations — this method creates predefined weight options for customers to choose from.
  2. Using a plugin — this method allows customers to enter any weight.

Set your weight unit before anything else

Before we begin, you should set the default weight unit of your store. Navigate to WooCommerce → Settings → Products → General and find the Measurements section. The Weight unit dropdown lets you choose between kg, g, lbs, and oz.

Weights setting in WooCommerce

This setting matters more than it looks. WooCommerce stores weight as a plain number and the unit you select here is what shipping plugins will reference and use for cost calculation.

Now lets dive in how you can actually sell by weight!

Method 1: variable products

Variable products let you create a parent product with a set of predefined weight options. A customer visiting your product page sees a dropdown with weight options like “500g”, “1 kg”, “2 kg”. Each option is a variation with its own price and its own weight value that WooCommerce passes to shipping calculations.

Product page showing a dropdown list to select your desired product weight
Using WooCommerce variations to sell by weight
ProsCons
Built into WooCommerce. No extra plugins needed.Only supports predefined weight options. Customers cannot enter custom amounts.
Clean dropdown interface for selecting weight.Works only if there aren’t too many options.
Works well with shipping calculations.Customers must round to your predefined increments or abandon the purchase.
Works best when you have 3–5 fixed weight options (jar sizes, bag sizes, packaged increments)Not suitable for deli meats, loose tea, or any product where customers need arbitrary amounts.

Here’s how to set it up:

  1. In the WordPress admin, go to Products → Attributes and create a new attribute. Set the name and slug to “Weight” and click Add Attribute.
    Create an attribute in WooCommerce
  2. Then, click Configure Terms to add the weight values: 500g, 1kg, 2kg, or whatever increments you want to offer.
  3. Create a new product in WooCommerce and give it a title. In the Product Data box, set the product type to Variable product.
    Variable product setting in WooCommerce
  1. In the Attributes tab, add the weight attribute to your product by searching for it in the “Add Existing” dropdown list. Click Select All and check Use for variations.
    Add a weight attribute to a product in WooCommerce
  1. In the Variations tab, click Generate variations.
  2. Edit each variation and set the weight (for shipping calculation, if applicable) and the total price.
    Variation settings - such as weight and price - in WooCommerce

Now, your customer can select a weight option on the product page! WooCommerce’s  official variable product documentation  covers the full setup in detail if you need an extra reference alongside these steps.

Optionally remove the quantity input box

Sometimes, you may want to hide the quantity input box since it feels redundant after selecting a weight option.

To do this, edit your product, go to the Inventory tab and enable the Sold Individually option. This limits purchases to 1 item per order and removes the quantity input box from the product and cart pages.

Remove the quantity input box by marking a product as 'sold individually'

Your product is now ready!

But how do you allow the user to enter specific weights rather than just choosing from a pre-defined list? Continue reading to find out!

Method 2: Advanced Product Fields for WooCommerce (APF)

WooCommerce’s native setup has a hard boundary: the options you define are the only options available. If a customer wants 1.75 kg and your variations are 1 kg and 2 kg, they’re forced to round. Some will. Others will leave.

For products sold by the gram, ounce, meter, or any unit where the customer’s need doesn’t align with your predefined increments, this will create friction and lost sales.

Luckily, you can solve this by using a plugin!

Advanced Product Fields for WooCommerce  solves this limitation. It adds an input field that lets customers type any weight amount they need, whether that’s 1.75 kg or 0.5 lbs, and calculates the price from their input. No predefined options required.

We’ll build a “coffee by weight” product with WooCommerce (see example below). We can use a number field for the user to enter their desired weight and we’ll calculate the product price dynamically based on that input. We’ll also dynamically set the product weight so that shipping costs can be calculated correctly.

A coffee product sold by weight in WooCommerce
A coffee product sold by weight in WooCommerce – created with APF

Step 1: add the weight input to your product

Once you’ve installed and activated advanced Product Fields for WooCommerce, you can get started!

Edit your product in WooCommerce, open the Custom Fields tab, and click Add Your First Field. Select a field of type Number.

Add a number input option to your WooCommerce product pages with APF

Set the following options for the number field:

  • Set the field label. This is a title that appears above the input field. We used “Choose Weight (in kg)”
  • Mark the field as required. The customer must pick a weight before the product can be added to the cart.
  • Set the number type either to ‘integer’ (whole numbers only) or ‘integer & decimals’ if customers can also enter fractions (like 1.5kg).
  • You can optionally define an increment step. This forces customers to enter a weight in increments you control. For example, with a step of 0.5 kg, valid values are 0.5, 1, 1.5, 2, 2.5, … while 1.75 kg is not allowed.
  • Set the minimum value to 0.5. This means the customer has to purchase at least 500grams.

Here’s what the settings look like in the backend:

"weight" option settings in the WooCommerce backend

Step 2: define the price per weight

The final product price is determined by the selected weight. In this example, coffee beans cost $8 per kg. Similarly, your own product will have a unit price per weight unit (grams, kg, lbs, …).

Setting this up is easy!

Edit the field created in step 1 and enable Adjust Pricing. Set the price type to “Amount × field value,” which multiplies the unit price by the field’s value (= the weight entered by the user). Then enter your product’s unit price (e.g. 8 for $8 per kg in this example).

APF pricing settings to sell a product by weight

Step 3: dynamically set the product weight

This step is essential if you are using weight-based shipping. If you don’t, you can skip this step.

Go back to the field created in step 2. In the Advanced tab, enter the following formula in the Extra Weight setting:

[field.ec5adc6] * 1

ec5adc6 points to the ID of your number field from step 2.

Add extra product weight dynamically in WooCommerce

Your shipping calculator plugin will now be able to use the product weight to calculate costs.

Step 4: set the price label to show price per unit

Most sites selling by weight will want to show the price per unit of weight, like “$8 per kg”. You can do this by updating the main product price label in WooCommerce to display the price per kilogram.

In the General tab, set the Regular price to 0. The price is calculated dynamically by the weight field created in step 2, so the WooCommerce price can be zero.

Then set the Price Display setting to “Replace WooCommerce price with text” and set the Price Label to something like “$8 per kg”.

Show "price per kg" in WooCommerce

Bonus step: hide the default quantity input

The quantity input field that ships with WooCommerce is redundant here, since we allow the user to choose any weight, we don’t really need an additional quantity.

To hide the default WooCommerce quantity field, click on the Inventory tab in the ‘Product data’ section. Then check the Sold individually option. This will hide the quantity field on the front end.

When you’re done, save your work and check your product page! It should look sim

A coffee product sold by weight in WooCommerce

Calculating shipping costs

Sending heavy items often costs more than sending light ones. If you’re using WooCommerce to sell products by weight, you will likely also need to calculate shipping based on the weight entered by the user.

WooCommerce doesn’t handle complex weight-based shipping, so we recommend a free plugin like WooCommerce Weight Based Shipping for the job.

Such a plugin can add additional shipping costs based on the total weight of the order (in brackets).

Leverage weight-based sales today

Weight-based sales in e-commerce are essential for businesses dealing with products sensitive to weight variations, such as grocery stores and health food shops. 

By adopting weight-based selling techniques, businesses can benefit from improved accuracy in pricing – minimizing losses on shipping – and boost customer satisfaction with transparent billing. 

The Advanced Product Fields for WooCommerce plugin makes weight-based sales easy to implement through features like dynamic price adjustments per unit of weight and real-time cost calculations for shipping, enhancing both the shopping and selling experience.

Try out Advanced Product Fields for WooCommerce today and enjoy streamlined shipping costs, customizable pricing, and enhanced customer experiences!

Frequently Asked Questions

Does WooCommerce support selling products by weight out of the box?

Not fully. WooCommerce lets you set a product’s shipping weight, but it doesn’t natively allow customers to enter a custom weight at checkout or calculate prices dynamically based on weight. You can work around this using variable products with predefined weight options, or a plugin like Advanced Product Fields for WooCommerce for fully flexible weight input.

What's the difference between using WooCommerce variations vs. a plugin for weight-based selling?

Variable products let customers choose from a fixed list of weights (e.g. 500g, 1kg, 2kg) via a dropdown. A plugin like Advanced Product Fields lets customers type any weight they need — such as 1.75 kg — and calculates the price dynamically. Variations work well for packaged goods with set sizes; a plugin is better for bulk or custom-cut products.

Can I set a minimum purchase weight in WooCommerce?

Yes, if you’re using the Advanced Product Fields plugin. When configuring the number input field, you can set a minimum and maximum value — for example, 0.5 to require customers to purchase at least 500g. You can also set an increment step, so customers can only enter weights in defined intervals like 0.25 kg.

How do I calculate shipping costs based on a customer-entered weight in WooCommerce?

WooCommerce doesn’t handle complex weight-based shipping natively. The recommended approach is to use a free plugin like WooCommerce Weight Based Shipping, which calculates shipping costs from the total order weight — including dynamically set product weights from customer input.

Can I hide the quantity field when selling by weight in WooCommerce?

Yes. In the product’s Inventory tab, enable the “Sold Individually” option. This removes the quantity input from the product and cart pages, which avoids confusion when the weight field already controls how much the customer is buying.

Where do I set the weight unit (kg, g, lbs, oz) in WooCommerce?

Go to WooCommerce → Settings → Products → General and find the Measurements section. The Weight unit dropdown lets you choose your preferred unit. This setting is important because shipping plugins reference it when calculating delivery costs.