Inventory and stock

How to find products about to sell out in WooCommerce

To find products about to sell out in WooCommerce, divide each product's current stock by its average daily sales. Get stock from Analytics › Stock or a product export, and units sold over the last 30 days from Analytics › Products (or Analytics › Variations). The result is days of stock left. Sort smallest first.

WooCommerce doesn't do this calculation for you, but it holds both numbers. Below: the free spreadsheet method, how to pick a sales window, the traps that make a product look safer than it is, a SQL version, and a one-question shortcut.

Why a low-stock list isn't enough

Analytics › Stock can show everything below its low stock threshold. That's a fixed number, so it can't tell a slow seller with 10 left (months of stock) from a best seller with 10 left (gone by Thursday).

What you want is days left, also called stock runway or days of cover:

Days left = current stock ÷ average daily sales

Days left puts every product on the same scale, which means you can sort a whole catalog by urgency. The guide on getting a low-stock report in WooCommerce covers the threshold-based list if you still want it.

The free way: stock and sales in a spreadsheet

  1. Export current stock. Go to Products › All Products, click Export, then Generate CSV. Keep SKU, Name, Type, Parent and Stock. Variations come out as separate rows.
  2. Export recent sales. Go to Analytics › Products, set the date range to the last 30 days, and click Download. For variable products, also download Analytics › Variations for the same dates.
  3. Match by SKU. Put stock and items sold side by side for each product or variation.
  4. Add two columns: daily sales = items sold ÷ 30, and days left = stock ÷ daily sales.
  5. Sort by days left, ascending.

Anything with no sales in the period will show a division error. Those products aren't about to sell out; they're candidates for the dead stock list instead.

A worked example

Product Stock Sold (30 days) Daily sales Days left
Ceramic mug (white) 36 120 4.0 9
Linen apron (sage) 26 66 2.2 12
Canvas tote 45 90 3.0 15
Enamel pin 40 6 0.2 200

On a fixed-threshold low-stock list, the pin (40 left) and the tote (45 left) look about the same. In days, the tote has 15 and the pin has 200. The mug, with fewer units than either, runs out first.

When is "about to sell out" too late?

Days left only matters next to your supplier's lead time. If the mug's supplier takes 14 days, the mug with 9 days left will be out of stock for about 5 days even if you order this minute.

A simple rule: order when days left is less than lead time plus your buffer. The buffer is your safety stock, expressed in days. If you want that as a stock level you can enter as a threshold, see setting reorder points for WooCommerce products.

Choosing a sales window

Window Good for Risk
7–14 days Fast sellers, new launches, products just featured A single busy day skews it
30 days Most products Slow to notice a seasonal rise
60–90 days Slow and steady sellers Slow to react when demand changes

Run two windows on your top sellers. If the 14-day rate is well above the 30-day rate, the product is speeding up and the shorter window is the safer forecast. Your best-selling products with a period comparison will show the same trend.

Traps that make a product look safer than it is

  • It was already out of stock. Days without stock have no sales, so the average drops. Divide by the days it was in stock.
  • Variations share a pool. If stock is managed on the parent product, every size draws from one number, and you can't see which one is going. Manage stock per variation. See tracking stock for variations.
  • A coming promotion. A sale or newsletter feature will lift sales above the recent rate. Forecast the promotion period separately.
  • Backorders. If a product allows backorders, stock can go below zero and it keeps selling. It "sells out" in the sense that new orders won't ship on time.
  • Analytics hasn't caught up. Analytics fills its tables in the background, so the newest orders can be missing for a short while. For a same-day call on a fast seller, check its live stock on the product edit screen.

For developers: days left in SQL

This uses wc_product_meta_lookup for current stock and the Analytics table wc_order_product_lookup for the last 30 days of sales. Both work the same with HPOS or posts storage.

SELECT p.post_title AS product,
       m.stock_quantity,
       s.units AS sold_30d,
       ROUND(m.stock_quantity / (s.units / 30), 1) AS days_left
FROM wp_wc_product_meta_lookup m
JOIN wp_posts p ON p.ID = m.product_id
JOIN (
  SELECT IF(variation_id > 0, variation_id, product_id) AS item_id,
         SUM(product_qty) AS units
  FROM wp_wc_order_product_lookup
  WHERE date_created >= NOW() - INTERVAL 30 DAY
    AND product_qty > 0
  GROUP BY item_id
) s ON s.item_id = m.product_id
WHERE m.stock_quantity > 0
HAVING days_left <= 21
ORDER BY days_left ASC;

Change wp_ if your table prefix differs, and change 21 to your horizon. The query doesn't apply your Analytics excluded statuses, so totals can differ slightly from the reports.

The quick way: ask Askshelf

Askshelf adds Analytics › Askshelf to WordPress admin. Its stock runway lookup does this exact calculation: for every product and variation that manages stock, it takes current stock and the sales rate over the last 7 to 90 days (30 by default), and lists what runs out within the number of days you ask (1 to 120, 14 by default).

Askshelfexample answer

Which products will sell out in the next two weeks, based on the last 14 days of sales?

4 items will run out within 14 days. The ceramic mug (white) goes first, in about 7 days (36 left, selling about 5 a day). Then the linen apron (sage) in 10 days, the canvas tote in 12, and the oak serving board in 13.Stock runway, within 14 days, sales rate over the last 14 days
An example on a demo store. In your store, the numbers come from your own orders.

Set the horizon to your longest lead time and the answer is your reorder list. Askshelf is read-only, so it won't change stock or place orders. See the stock forecasting page for more, and the WooCommerce inventory forecasting guide for the full routine.

What to do with the list

  • Order the items inside your lead time first, starting with your best sellers.
  • Slow the fastest ones down if you can't restock in time: pause ads on them or take them out of this week's email.
  • Turn on a back-in-stock notice if your store has one, so demand isn't lost while you wait.
  • Raise the reorder point on anything that keeps appearing at the top of this list.

Common questions

Does WooCommerce predict when a product will sell out?

No. WooCommerce shows current stock and marks products low or out of stock against fixed thresholds, but it doesn't use sales speed to predict a sell-out date. You calculate it from stock and recent sales.

How many days of sales should I average?

30 days works for most products. Use 14 days for fast sellers or anything just promoted, and 60 to 90 days for slow sellers, where a short window is mostly noise.

What if a product was out of stock for part of the period?

Divide units sold by the days it was actually in stock, not the full period. Otherwise the sales rate comes out too low and the product looks safer than it is.

See how Askshelf handles this: Stock forecasting for WooCommerce