All guides

Show total stock across WooCommerce variable product variations: a plugin you can build today

· 4 min read

WooCommerce tracks stock at the variation level. A store selling a jacket in four sizes and three colors has twelve separate stock numbers, one per combination. The product list in wp-admin shows a small in-stock or out-of-stock indicator, but it does not tell you the total. You have to click into each product, open the Variations tab, and add up the numbers yourself.

A small plugin fixes this by adding a single sortable column to the product list: Total Stock. For variable products it sums all variation quantities where stock management is on. For simple products it shows the product's own stock number. You can sort the column to find products running low before they go out of stock entirely.

What one build gives you

  • Sortable Total Stock column in the WooCommerce Products admin list
  • Correct sum for variable products across all variations with stock management enabled
  • Simple product stock quantity shown when stock management is on
  • Dash displayed for products where no variation tracks stock

What it does not do

  • Per-variation stock breakdown (WooCommerce shows this on the product Variations tab)
  • Total stock display on the frontend shop or product pages
  • Low stock notifications or alerts
  • Stock history, purchase orders, or inventory forecasting

ATUM Inventory Management does these. This covers the part most sites use.

The prompt

Loads into the composer so you can edit it first. Nothing is built, and nothing is charged, until you send it.

Build a WordPress plugin that adds a sortable Total Stock column to the WooCommerce Products admin list (wp-admin/edit.php?post_type=product). For variable products, the column value is the sum of stock quantities across all variations where manage_stock is true; variations with manage_stock false are excluded from the sum. For simple products with manage_stock true, show the product's own stock quantity. For any product where no stock tracking is active, display a dash. Register the column using the manage_product_posts_columns and manage_product_posts_custom_column hooks, and make it sortable via manage_edit-product_sortable_columns and the pre_get_posts hook so clicking the column header sorts products by their total stock ascending or descending. No settings page is needed.

Build this pluginAbout 55 credits · the free plan includes enough for one

Why the product list does not show a total

WooCommerce stores stock per variation because a size-L jacket and a size-XL jacket are managed separately. You can sell out of large but still have medium in stock, so a single number would be misleading for purchasing decisions. The product-level view shows aggregate status (in stock, out of stock, on backorder) but not the raw number.

The stock number on the Variations tab is the right place for per-SKU decisions. But there is no in-between: a total stock figure that tells you how many units of a product you have across all sizes and colors, visible without clicking into anything.

What the plugin adds

A column labelled Total Stock appears in the WooCommerce Products list, between SKU and Price. For variable products, it shows the sum of stock quantities for each variation with stock management enabled. Variations where stock management is off are excluded from the sum. For simple products with stock management on, it shows that product's own quantity. If no variation tracks stock, the column shows a dash.

The column is sortable. Clicking the header sorts all products by total stock ascending or descending, so you can find your emptiest shelves without opening a single product page.

When this matters most

Clothing and footwear stores benefit the most. A t-shirt in three colors and five sizes has fifteen variation entries. At a glance, the total stock column tells you whether you have two dozen of that shirt on hand or two. Seasonal restocking decisions, end-of-year inventory audits, and discontinuation calls all depend on having that number visible in the list.

Electronics with color variants, furniture with size options, and any catalog with more than a handful of variable products run into the same wall. The total stock number is not exotic analytics. It is what any stock room would put on a physical inventory sheet.

How to install and use it

Paste the prompt below into Steem and download the generated zip. Upload it under Plugins > Add New > Upload Plugin, then activate. No settings page, no API key. The column appears in the WooCommerce Products list immediately.

If you have products with stock management turned off, the column shows a dash for those rows. That is intentional: a product with no stock tracking has no total to display.

When to use a dedicated inventory plugin instead

If you need purchase orders, supplier records, stock history, or forecasting, ATUM Inventory Management handles all of that and includes a total-stock view. Adding a custom plugin for a single column is redundant if you are already running a full inventory tool.

For stores where the only missing piece is a total across variations at a glance, the custom build is lighter and does not add a large plugin's worth of database tables and admin pages you will never open.

Questions

Does it count variations that are out of stock but still managed?
Yes. If a variation has stock management enabled and the quantity is 0 or negative from backorders, that number is included in the sum. The total reflects the actual quantity on hand, which may be zero or below zero.
Will it slow down the products list for large catalogs?
For most stores the impact is not noticeable. The plugin reads variation stock using WooCommerce's built-in methods, which are already used elsewhere in the admin. Very large catalogs with thousands of variable products and many variations each may see a small delay on the products page.
What shows for products where I have turned stock management off?
A dash. The column only makes sense when WooCommerce is tracking quantities for that product, so products without stock tracking are excluded from the count.
Does it work alongside ATUM or other inventory plugins?
Yes. The column reads from the standard WooCommerce stock meta fields, which ATUM and most other inventory plugins also use. Running both is safe.

The prompt

Loads into the composer so you can edit it first. Nothing is built, and nothing is charged, until you send it.

Build a WordPress plugin that adds a sortable Total Stock column to the WooCommerce Products admin list (wp-admin/edit.php?post_type=product). For variable products, the column value is the sum of stock quantities across all variations where manage_stock is true; variations with manage_stock false are excluded from the sum. For simple products with manage_stock true, show the product's own stock quantity. For any product where no stock tracking is active, display a dash. Register the column using the manage_product_posts_columns and manage_product_posts_custom_column hooks, and make it sortable via manage_edit-product_sortable_columns and the pre_get_posts hook so clicking the column header sorts products by their total stock ascending or descending. No settings page is needed.

Build this pluginAbout 55 credits · the free plan includes enough for one

Read next

Other plugins you can build this way

Each loads into the composer, ready to edit.