Skip to content
Arrow keys to move, Enter to open, Esc to closeAll results
E-commerce · Guides

WooCommerce Inventory Management: The Complete Guide

How WooCommerce inventory really works: stock settings, backorders, checkout holds, order-status rules, variations, syncs and stocktakes, plus how to prevent oversells.

Written by
WPresident Editorial
Topic
E-commerce

Most WooCommerce stores treat inventory as a single number on the product screen: 14 in stock, then 13, then 12. That number is the visible end of a rule system. WooCommerce does not count your shelves or reconcile against a warehouse. It changes the number when specific events happen: an order reaches a particular status, a person edits a quantity, an import runs, an API call arrives, or a refund is restocked. Nearly every inventory problem you will debug is a case where an event you expected never fired, fired twice, fired for the wrong reason, or was overwritten by another system that trusted its own number.

That gives you the single most useful idea in this guide: stock in WooCommerce is a ledger of events, and the figure you see is only as accurate as the rules, integrations and habits that feed it. Settings matter because they change which events count. Plugins matter because they add events or replace the ones that exist. Habits matter because core WooCommerce does not keep a record of who changed a quantity by hand, or why.

The cost of getting this wrong is lopsided. An oversell means an apology, a refund, a support thread and sometimes a penalty on a marketplace. An understated count means a product that could have sold sits behind an out-of-stock badge. Both are quiet failures: nothing breaks, no error appears, and the first sign is a customer email. Consider an illustrative store with 800 products, 90 of them variable, a part-time warehouse helper who counts on Fridays and a second sales channel that syncs every few hours. Nothing about that store is unusual, and every one of those details creates a gap where the number on the screen can drift away from the shelf.

This guide follows a unit of stock through the system: where the data lives and what the settings do, product and variable stock, backorders, the order-status rules, checkout holds, oversells, bundles and locations, imports and syncs, reporting and counting, and finally how to diagnose a wrong number.

A few ground rules for reading. Settings are described at the level the official documentation describes them, because screens and labels shift between releases, and where behavior depends on the version you run it is flagged so you can check the changelog. Any code is conservative and meant to be read before it is pasted into a store. Test every change on a staging copy first, especially anything that touches stock quantities in bulk.

One last framing. Inventory can be wrong in two ways. The number can be wrong, which is a ledger problem, and most of this guide is about that. Or the number can be right while what the customer experiences is wrong: a cached page still says in stock, a hold from an abandoned checkout blocks the last unit, a variation looks available when it is not. Treat these as separate classes of bug with separate tools. Mixing them up is why so many stock problems get fixed twice.

Key points

  • Stock in WooCommerce is a ledger of events: it changes when an order reaches a status, a person edits it, or an import or API call writes it.
  • Core reduces stock when an order is paid or reaches processing, on-hold or completed, and restores it on cancel or pending; refunds restock only if you ask.
  • Adding to the cart reserves nothing; a hold begins when checkout creates an order and ends on payment, cancellation or expiry.
  • Most oversells come from other sales channels, late payments and overwrites by imports or syncs, not from two shoppers clicking at once.
  • Variable products can share one pool at parent level or count each variation separately, and that choice decides what alerts and reports mean.
  • Core holds one number per product with no locations, lots or ledger of manual edits, so growth past that needs a plugin or an external system.
  • A short weekly audit of negative stock, stale statuses, held units and scheduled actions catches most problems before customers do.

Where WooCommerce keeps stock, and what its fields mean

Every product and every variation carries a small set of stock fields: whether stock is managed at all, a quantity, a stock status, a backorder setting and an optional low-stock threshold. They are stored as product meta, with names such as _manage_stock, _stock, _stock_status and _backorders, and WooCommerce mirrors the quantity and status into a product lookup table so that sorting and filtering do not have to scan metadata.

Quantity and status are different things, and mixing them up is a classic source of confusion. When a product manages stock, WooCommerce derives the status from the quantity, the out-of-stock threshold and the backorder setting every time the product is saved or its stock changes. When a product does not manage stock, there is no quantity to derive from, so you set the status by hand to in stock, out of stock or on backorder, and WooCommerce believes you until you change it. A product that sells steadily but stays marked in stock forever is almost always a product whose stock is not being managed.

Above the product sits a master switch. The Manage stock setting under the Products settings makes stock management a store-wide feature. When it is off, the stock functions return early: quantities are not reduced, not restored and not held, whatever the individual products say.

The order side is where most mental models are thin. When WooCommerce reduces stock for an order it records that fact twice: a flag on the order, and a record on each line item of how many units were deducted. Those records make the system safe to run repeatedly. A status change that fires the reduction hook twice will not deduct twice, and a cancellation can restore exactly the units that were taken. They also explain odd behavior when orders are copied with database tools or imported with their flags intact: the order may claim a reduction that never touched this store’s quantities, or the reverse.

Checkout holds live in yet another place, a separate table of reserved quantities with expiry times, so a held unit does not appear in the product’s own quantity. In front of everything sit caches: the object cache, and any page cache that stores finished product pages.

The practical consequence is a rule worth pinning above your desk: never change stock by writing to the database directly on a live store. A direct write to the stock meta skips the status recalculation, leaves the lookup table stale, bypasses cache invalidation, fires none of the notification and sync hooks that other plugins listen for, and leaves no trace on any order. Use the admin screens, the REST API, the WP-CLI commands for WooCommerce or the stock functions in code, because those go through the same path as a real sale.

Where stock state lives

Store-wide settingsThe Manage stock switch, hold minutes, thresholds and display format apply to every product.
Product and variation fieldsManage stock, quantity, backorders, low-stock threshold, and a manual status when stock is not managed.
Stored quantity and derived statusQuantity sits in product meta; the status is recalculated from it on save and on every stock change.
Lookup table and cachesA product lookup table and the object cache speed up reads, and only the normal stock functions refresh them correctly.
Order-side recordsA flag on each order and a deducted-units record on each line item make reductions happen once and reverse once.
Temporary holdsA separate reserved-stock table records units held by unpaid checkouts until they expire.
Stock is not one number in one place; each layer can be correct while another is stale.

The global inventory settings, one by one

Open WooCommerce, then Settings, then Products, then Inventory. The labels below follow the plugin’s own settings text, but wording and placement shift between releases, so check your version.

Manage stock is the master switch described earlier. Leave it on for any store that sells physical goods. Turn it off only if every product is made to order or inventory lives entirely in another system, and accept that WooCommerce will then never reduce or restore a quantity for you.

Hold stock (minutes) defaults to sixty. It holds stock for unpaid orders for that many minutes, and the same setting drives the cleanup of unpaid orders. Leaving it blank disables the hold. A later section explains the mechanics, but the decision rule is simple: the hold must be longer than your slowest realistic payment path, including wallet or bank redirects and 3-D Secure challenges, and short enough that an abandoned checkout does not block the last unit for an hour.

Notifications are three checkboxes, for low stock, out of stock and backorder, all enabled by default and sent to a recipient field that defaults to the site admin email. Put a shared mailbox or a helpdesk address there, not one person’s inbox, because these are single-event emails with no reminder behind them.

Low stock threshold defaults to two. For a fast seller that is far too late. A better starting point is a reorder point: units sold per day multiplied by the supplier’s lead time in days, plus a safety margin. As an illustration, a product that sells six units a day with a ten-day lead time needs a warning at sixty units plus a cushion, not at two. You can override the threshold on each product and each variation.

Out of stock threshold defaults to zero and is the quantity at which a product’s status flips to out of stock. The setting’s own description notes that it does not affect products that are already in stock. It is also the only built-in safety buffer. Set it to two, for example, and the last two units are held back from sale to cover miscounts, damaged goods or the lag of another sales channel. The trade-off is that it is global, and staff looking at a product with a quantity of two and a status of out of stock will need to know why.

Out of stock visibility hides sold-out products from the catalog and is off by default. Hiding keeps shop pages tidy but thins out category pages and removes the chance to show a back-in-stock message, so decide product by product whether a sold-out page is an asset or clutter. Do not assume that hidden means unreachable: the product page generally still loads for anyone who has the link, so think about what it should say.

Stock display format controls what shoppers see: the exact quantity, a message only when stock is low, or nothing. Showing exact counts gives competitors a view of your inventory, which matters for wholesale stores. Showing a low-stock message works only if the threshold behind it is real. Scarcity messaging that is not true erodes trust faster than a sold-out page ever will.

woocommerce.com
The WooCommerce homepage describing the open source commerce platform for WordPress, with a Start here button
The WooCommerce project site; the inventory settings in this section live in your own store under the Products settings tab.

Product-level stock: manage it, or set a status by hand

On the product edit screen, the Inventory tab holds the fields that matter: a SKU, a Manage stock checkbox, then either a quantity, a backorder choice and a low-stock threshold, or, with management off, a plain stock status. Choosing between the two modes is the first real inventory decision for each product, and a short rule covers most of it.

Manage stock when you hold physical units that you can count and that run out: finished goods, parts, anything with a shelf. Do not manage stock when quantity is meaningless or controlled elsewhere: downloads, services, made-to-order items, and products drop-shipped by a supplier whose availability you cannot see. For those unmanaged cases set the status deliberately and own the decision, because WooCommerce will never change it for you. A made-to-order lamp should be in stock because you can always make it, not because someone forgot a checkbox.

The Sold individually option limits the cart to one of the product per order. It suits one-off pieces and licenses, though it only caps a single order, not repeat orders from the same shopper. The SKU field deserves more discipline than it usually gets. WooCommerce requires SKUs to be unique across products and variations, which makes the SKU the natural key for imports, supplier files and any sync with an outside system. Decide on a format early, never reuse the SKU of a retired product, and watch for trailing spaces or letter-case drift between systems, since mismatched keys are a leading cause of failed syncs. Recent releases also add a field for a global trade item number such as a GTIN, UPC, EAN or ISBN; check your version, and fill it in if you sell through channels that match on barcodes.

For speed, the Products list offers Quick Edit and Bulk Edit with stock fields, a Stock column and a filter by stock status. Use them for small corrections, but remember that a manual change replaces a number without explaining why. A stock edit by hand does not create an order note, so there is no built-in trail you can rely on; check whether your version or an audit-log plugin adds one. For repeated large changes, prefer an import or the API, where the change is at least reproducible from a file.

Variable products: one pool or one count per variation

Variable products add a decision that simple products avoid: where does the count live? There are two models, and the right one depends on how you hold the goods, not on how the product looks on the page.

In the first model each variation manages its own stock. A T-shirt in four sizes and three colors becomes twelve variations, each with a quantity, a backorder setting and optionally its own low-stock threshold. This matches a warehouse where every size and color is a separate bin. Alerts and reports work per variation, so you learn that the medium blue is nearly gone, not merely that the shirt is selling.

In the second model the parent manages stock and the variations defer to it, which WooCommerce expresses as stock managed at the parent level. All variations draw from one shared quantity. That fits a print made on demand in several frame colors from the same blank stock, or a gift set where the options change the packaging but not the units consumed. The mistake to avoid is mixing the two by accident: enabling stock on the parent while individual variations also manage their own makes the parent number confusing, and the variation numbers are the ones that actually control sales.

Status rolls up from the children. A parent that does not manage its own stock is treated as in stock when at least one variation can be bought. That means shop pages and category listings can say in stock while the combination a shopper wants is gone, and the shopper learns it only after choosing options. To limit that frustration, keep variation names meaningful, disable variations you no longer sell, and consider whether showing quantities on the product page helps.

For data entry, the Variations tab has bulk actions that set, increase or decrease stock across variations, along with a toggle for managing stock. Spot-check a few variations after any bulk action. For large catalogs, an import with one row per variation is safer than clicking through screens, but remember that a blank stock column in an import means stock is not managed for that row, a trap covered in the section on imports.

Finally, the low-stock threshold follows a lookup order: variation first, then parent, then the store default. If a threshold is set only on the parent, every variation inherits it, which is rarely what you want for a mix of fast and slow sizes.

Parent-level stock versus per-variation stock

Parent holds the stockEach variation holds its own
Good fitOptions share the same units, such as frame colors on one blank itemEach option is a separate bin, such as sizes and colors
Alerts and reportsOne number for the whole productA number and a threshold per variation
Setup effortSet once on the parentSet on every variation, or import by SKU
Main riskEvery option drains the same pool, so a popular one starves the restA retired variation left marked in stock
Parent statusFollows the single poolIn stock if any variation can be bought
Choose the model that matches how the units physically sit on your shelves.

Backorders: selling what you do not yet have

Backorders let a managed product keep selling after its quantity reaches the out-of-stock threshold. The Inventory tab offers three choices: do not allow, allow but notify the customer, and allow. In practice only two are defensible. Do not allow is correct when you cannot ship without stock. Allow but notify is correct when you can restock reliably and are willing to say so. Plain allow sells the product without any backorder message on the page, so the first a shopper learns of a delay is when the parcel does not arrive.

The mechanics matter for reporting. Quantity is allowed to go negative: sell three units with one on the shelf and the quantity reads minus two while the status switches to on backorder. That negative number is useful, because it is exactly how many units you owe customers. It also changes how you receive stock. When a delivery of twenty arrives against a quantity of minus two, you add twenty to reach eighteen; you do not set the field to twenty, or you will quietly forget the two customers still waiting.

Three side effects are easy to overlook. First, checkout holds do not apply to products that allow backorders, because there is nothing to protect, so a rush of orders will all go through. Second, the optional backorder notification email goes to the store recipient when an order pushes a quantity below zero, and it is the earliest signal you will get. Third, a mixed order with some items ready and others delayed will wait for the slowest item unless you split shipments. Decide your partial-shipment policy before enabling backorders at scale, and put a realistic lead time in the product description, because core has no field for an expected restock date.

Backorders are not pre-orders. Core has no concept of a release date, a deposit or charging only when the goods ship, so use a plugin built for pre-orders when you need those, and keep backorder settings for items you normally stock. For made-to-order products a better pattern is often to skip stock management and set the status by hand.

What changes stock: order statuses, edits and refunds

Stock moves for a small, knowable set of reasons, and the most important is the order status. According to the plugin’s own source, WooCommerce reduces stock when a payment completes and when an order moves to on-hold, processing or completed. It restores stock when an order moves to cancelled or pending, and newer releases also restore it for a failed order that had already reduced stock. Check your changelog for that last behavior, since older versions did not do it.

The key design choice is that stock is reduced when an order reaches a paid or committed state, not when a shopper clicks Place order. At checkout the order starts as pending, protected only by a hold, covered in the next section. A card payment completes, the gateway marks the payment complete, the order moves to processing, and the reduction happens. A bank transfer or cheque order typically lands on-hold, which also reduces stock, so stock is committed before any money arrives. A cash-on-delivery order normally goes straight to processing, and orders containing only virtual downloadable items usually jump to completed. In every case the order flag and line-item records ensure the deduction happens once.

Restoration is the mirror image. Cancel an order, or move a paid order back to pending payment, and the units taken for each line return to the product. The order gets a system note with before and after numbers, and these notes are your best audit trail: look for lines that begin with stock levels reduced or stock levels increased.

Editing an order by hand adjusts stock too. When you change a line quantity or delete an item on an order that has already reduced stock, WooCommerce compares what was deducted with the new quantity and adjusts the difference. A manual order created with the pending status reduces nothing until you move it to a status that does.

Refunds are where stores get caught. Moving an order to refunded does not restock the goods. Restocking happens only if you tick the option to restock refunded items on the refund form, which appears when stock is managed. That is the right default, because a refund and a returned item are different events: the money may go back before the box does. Leave the box unticked until the returned goods are inspected, then adjust the quantity yourself, or tick it for items you know are sellable.

Two more traps. Deleting or trashing an order is not a documented way to give stock back, so cancel the order first, then delete it if you must. And custom code or plugins can change the rules through filters that stop a reduction or alter the quantity deducted, so a store that behaves differently from this description often has an extension in the middle.

The life of a stock deduction

  1. Order createdCheckout creates a pending order and places a temporary hold on the units.
  2. Payment or commitmentA completed payment, or a move to processing, on-hold or completed, triggers the reduction.
  3. ReductionEach managed line subtracts its quantity once and is marked as deducted.
  4. Note and alertsThe order gets a note with before and after numbers, and stock emails may fire.
  5. Edits or cancellationChanging a line quantity adjusts the difference; cancelling or returning to pending restores the units.
  6. RefundUnits return to stock only if you tick the restock option on the refund form.
Stock changes at order status events and refund choices, and each step leaves a record you can read later.

Checkout holds: how stock is reserved, and why holds get stuck

The cart reserves nothing. A shopper can sit on a cart containing the last unit for a week, and anyone else can still buy it. The hold begins later, when checkout creates the order that goes to payment. At that moment WooCommerce checks whether enough unreserved stock exists and, if so, writes a row into a reserved-stock table with an expiry time based on the Hold stock setting. The exact moment differs a little between the classic and block checkouts and between versions, so test your own flow.

While the hold exists, other shoppers cannot claim the held units, even though the product quantity has not changed yet. Only pending and draft orders count toward holds, and only for products that manage stock and do not allow backorders. A hold ends when the order is paid or moves to processing, on-hold, completed or cancelled, at which point the real reduction takes over, or when its expiry time passes. If the Hold stock setting is blank, no hold is placed at all, and the last unit goes to whichever payment completes first.

Two separate mechanisms are easy to confuse. The reservation expires by timestamp on its own. Cleaning up unpaid orders is a different job, a scheduled action that cancels pending orders older than the hold time and reschedules itself at roughly the hold interval. An abandoned pending order can therefore sit in the list noticeably longer than the setting suggests, even though its reserved units have already expired. The job also cancels only orders created by the checkout, so pending orders created by an admin, a plugin or the API stay pending until someone acts.

Holds get stuck for a handful of reasons. The scheduled-actions runner may not be firing, commonly because WP-Cron is disabled or traffic is too low to trigger it. A shopper whose first attempt stalled can be blocked by the hold from that attempt until it expires; recent releases add an opt-in filter for that case. A payment that arrives after the order was cancelled for timeout moves the order back to processing and reduces stock again, possibly for units someone else bought in between. And the reservation logic relies on InnoDB tables for its locking, so an old MyISAM setup is a risk.

Size the hold from evidence, not habit: look at your payment methods’ longest realistic flow, add a margin, and weigh it against how quickly you need abandoned checkouts to release scarce items. Developers can change the reservation length with a filter, but shortening the reservation without matching the order cleanup recreates the late-payment problem above.

One checkout hold from start to finish

Add to cartNothing is reserved, and other shoppers can still buy the same unit.
Order created at checkoutA pending order appears and the units are written to the reserved-stock table with an expiry.
Payment succeedsThe order moves to processing or on-hold, the hold is released and real stock is reduced once.
Payment abandonedThe units stay reserved until the expiry time, then become available again by timestamp.
Cleanup job runsA scheduled action cancels old pending orders from checkout, which can lag behind the hold itself.
Late payment arrivesA cancelled order that is paid afterwards moves back to processing and reduces stock again.
The cart reserves nothing, the hold starts at order creation, and the cleanup job runs on its own clock.

Busy sales and oversells: how they really happen

When a store oversells, the instinct is to blame a race: two shoppers buying the last unit in the same instant. Core WooCommerce handles that case better than most people assume. Stock deductions are written as relative updates in a single query, so two simultaneous orders both subtract correctly, and the hold takes locks when it reserves units. What remains is mostly everything around the race.

The common causes, roughly in order of how often they bite, start with other channels. A marketplace, a point-of-sale system or a wholesale portal sells the unit while your sync is still catching up. The gap is the sync interval plus the processing delay, and the defenses are a safety buffer, faster or event-driven updates and a clear source of truth. Next comes the late payment described earlier, where a gateway confirms after the hold and the cleanup have both run. Then absolute overwrites: an import or sync that writes the quantity it believes is current, wiping out orders placed between its read and its write. Then disabled holds, or backorders allowed on a product you meant to cap. Last comes presentation: a cached product page that still says in stock. Add to cart and checkout validate against live data, so the checks should still catch it, unless a persistent object cache or a plugin returns stale values.

Preparing for a launch or a flash sale is mostly about removing variables. Decide whether the item will be sold elsewhere and, if so, pull it from other channels or allocate each a fixed quantity. Use Sold individually or a cart cap on scarce items. Confirm the unpaid-order cleanup is actually running by looking at the scheduled actions screen, ideally with a real server cron behind WP-Cron. Set the out-of-stock threshold or a manual buffer. Test checkout with the payment methods you will use on the day, including the slowest, and load test on staging, because a slow checkout lengthens the window in which holds matter and gateways time out.

When an oversell does happen, treat it as data. The order note shows the before and after quantities, and a negative quantity on a product that does not allow backorders is the signature. Find which path caused it and fix that path, then contact the customers quickly. The apology and the choice between waiting and a refund cost far less than silence.

Where oversells come from

How it happensWhat reduces the risk
Last unit, two buyersTwo checkouts reach the final unit within momentsRelative stock updates and locked reservations already cover most of this
Another sales channelA marketplace or POS sells the unit before a sync arrivesA safety buffer, faster syncs and one source of truth
Late paymentA gateway confirms after the hold and cleanup have passedA hold longer than the slowest payment path, and a review of cancelled-then-paid orders
Absolute overwriteAn import or sync writes a count that is already out of dateSend deltas, or write in a quiet window and reconcile afterwards
Stale pageA cached page still says in stock after the last unit soldShort cache life on product pages and live checks at cart and checkout
The last-unit race is the best defended case; the gaps around it do the real damage.

Bundles, kits and grouped products

Core WooCommerce offers grouped products, and they are often mistaken for bundles. A grouped product is a display container: it lists several simple products on one page, and each is bought, priced and counted as its own line. Nothing about the group deducts stock as a unit. That is fine for a collection page and wrong for a kit.

Real bundles need a decision before any tool: is the bundle a set of components pulled from shelves at order time, or a finished kit assembled in advance and counted as its own item? These are different inventory models. In the virtual model, a bundle of a camera, a bag and a memory card has no stock of its own. Its availability derives from the components, and a sale deducts one of each. That keeps one count per physical item, but the bundle’s availability depends on the scarcest part. In the physical model, the kit is a product with its own SKU and quantity, assembled ahead of time. A sale deducts one kit, and building a kit is an event that should reduce the components and raise the kit count. Mixing the models without a rule is how a store sells the same camera twice.

The official WooCommerce.com extensions Product Bundles and Composite Products address the virtual case, and third-party alternatives exist. Whatever you evaluate, ask the same questions. Does a sale reduce each component through the normal stock functions, so alerts and syncs still fire? Does the bundle’s status reflect the scarcest component? What happens with variable components, optional items and quantity limits? Does a refund or cancellation restore components? And what does your warehouse system see: a bundle line, the components, or both? Read the documentation for those answers and verify them on staging with a test order, because they differ between products and versions.

Multi-packs deserve a mention. A six-pack of an item you also sell singly can be a variation with a quantity multiplier in some plugins, a bundle in others, or a separate product with a manual stock process. The last is the most common and the most error-prone, since someone must remember to reduce the single-unit stock whenever a six-pack sells. If you sell multi-packs, automate that link.

woocommerce.com
The WooCommerce Product Bundles extension page describing a toolkit for personalized bundles, bulk discount packages and assembled products
The official Product Bundles extension is one way to give bundles stock behavior of their own; verify how it handles components before relying on it.

Multiple locations, and when core is not enough

Core WooCommerce has one stock number per product or variation. It has no concept of warehouses, bins, shops, lots, expiry dates, serial numbers, purchase orders or suppliers, and as far as its documented features go it keeps no ledger of manual quantity changes. That is a deliberate scope, and many stores run happily inside it. The signs you have outgrown it are practical: staff keep a spreadsheet beside the store, the same product is stocked in two places, you sell in person as well as online, goods expire or are tracked by serial number, or purchasing needs reorder lists and receiving workflows.

The plugin territory splits into recognizable categories. Multi-location plugins keep a quantity per location and decide which location fulfills each order. Inventory and purchasing plugins add suppliers, purchase orders, receiving and reorder points. Point-of-sale integrations share stock between a counter system and the web store. Bundle and composite extensions handle kits. Back-in-stock and waitlist plugins capture demand for sold-out products, which core does not do. Audit-log or stock-history plugins fill the ledger gap. Channel connectors sync stock with marketplaces. At the far end sit external systems, an ERP or warehouse management system, where WooCommerce becomes one sales channel among several.

Judge any of them with the same questions. Where does the number live, and does the plugin write to the core stock fields, or hold a separate figure that core never sees? If core never sees it, sales through other plugins, the API and imports will use the wrong number. Does a sale reduce it through the normal stock hooks, or through its own logic that may break with block checkout? Does the plugin declare compatibility with high-performance order storage? What happens to your data if you deactivate it? And does it overlap with another plugin that touches stock, a classic source of double deductions?

Whatever you choose, run it on staging with a copy of real data and replay a week of orders. Check that status changes, refunds and edits behave as described in the earlier sections. Extra stock logic runs on every order, and in some plugins on every cart, so watch checkout performance too.

Imports, the API and syncs with other systems

Every external write to stock arrives through one of four doors: the CSV importer, the REST API, WP-CLI and your own code. They share a hazard. Most of them set an absolute quantity, and an absolute write made from a stale read erases whatever happened in between.

The CSV importer maps columns named In stock?, Stock, Backorders allowed? and Low stock amount. A filled Stock column turns stock management on for that row; a blank one turns it off and uses the In stock? column for the status. The Backorders column accepts 0, 1 or notify. When you update existing products, matching on ID or SKU replaces quantities outright, so run imports on staging first, and on a live store pick a quiet period, since orders placed while the file processes are not reflected in it.

The REST API exposes the same fields on products and variations, with a batch endpoint that updates many products in one request, within a batch size limit you should check for your version. Variations have their own endpoint under the parent product.

{
  "update": [
    { "id": 101, "manage_stock": true, "stock_quantity": 24 },
    { "id": 102, "manage_stock": true, "stock_quantity": 0 }
  ]
}

From the command line, the WooCommerce commands in WP-CLI can list stock fields; they need a user to act as.

$ wp wc product list --user=1 --per_page=100 --fields=id,sku,stock_quantity,stock_status --format=csv

In code, use the stock function with an explicit operation, which makes a relative update and refreshes status and caches. Use increase and decrease for events, and keep set for a deliberate recount.

$product = wc_get_product( $product_id );
if ( $product && $product->managing_stock() ) {
	// 3 units received into the warehouse: add, do not overwrite.
	wc_update_product_stock( $product, 3, 'increase' );
}

Design a sync around a few rules. Pick one source of truth for each field. Send deltas for events such as a sale or a receipt, and absolute counts only for recounts, with a timestamp so a late message cannot overwrite a newer state. Key everything by SKU. Make writes idempotent so a retried message does not apply twice, and ignore changes your own integration caused to avoid loops. Log before and after values. Finally, schedule a reconcile job that compares both systems and reports differences rather than silently fixing them.

A safer two-way stock sync

  1. Event happensA sale in WooCommerce or a receipt in the warehouse system creates a change event.
  2. Send a deltaThe change travels as plus or minus units, keyed by SKU, with an id and timestamp.
  3. Apply onceThe receiver applies it through the stock functions and ignores a repeated id.
  4. Log the resultBefore and after values are stored so any difference can be explained later.
  5. ReconcileA scheduled job compares totals in both systems and reports mismatches for a person to review.
Send changes as deltas, apply them once, and let a reconcile job find the drift that remains.

Reporting, stocktakes and an audit rhythm

Stock reporting has three layers. The Products list shows a Stock column and filters by stock status, enough for a daily glance. WooCommerce Analytics includes a Stock report that lists products by status and quantity, with filters for low stock, out of stock and on backorder. And the low-stock emails fire when a threshold is crossed, once per event, so they are an alarm and not a report. Analytics reports built from orders depend on background imports, so recent figures can lag; check how current each report is on your store.

Because the emails are one-shot, many stores add a daily digest. This snippet runs from WP-Cron, walks managed products in batches and emails anything at or below its low-stock threshold. Treat it as a starting point, test it on staging and mind its cost on very large catalogs.

add_action( 'init', function () {
	if ( ! wp_next_scheduled( 'wpr_stock_digest' ) ) {
		wp_schedule_event( time() + HOUR_IN_SECONDS, 'daily', 'wpr_stock_digest' );
	}
} );

add_action( 'wpr_stock_digest', function () {
	$lines = array();
	$page  = 1;
	do {
		$items = wc_get_products( array( 'limit' => 100, 'page' => $page++, 'status' => 'publish', 'type' => array( 'simple', 'variable', 'variation' ) ) );
		foreach ( $items as $p ) {
			if ( $p->managing_stock() && $p->get_stock_managed_by_id() === $p->get_id() && $p->get_stock_quantity() <= wc_get_low_stock_amount( $p ) ) {
				$lines[] = $p->get_sku() . ' | ' . $p->get_name() . ' | ' . $p->get_stock_quantity();
			}
		}
	} while ( count( $items ) === 100 );
	if ( $lines ) {
		wp_mail( get_option( 'admin_email' ), 'Low stock digest', implode( "
", $lines ) );
	}
} );

Counting needs a routine, not a heroic annual effort. Count high-value and fast-moving items often and slow, cheap ones rarely. A count taken while the store sells is stale the moment you write it down, so record the system quantity and the time when the count starts, then adjust by the orders that reduced stock during it. Investigate variances above a tolerance you set, since a recurring gap on one SKU points to a process fault such as mislabelled bins or an unrecorded return, and log each adjustment with a reason, because core has no place to record the reason.

Returns need a rule too. A refund with the restock box ticked puts units back before inspection, and one without it leaves the count short until someone adjusts it by hand. Decide who owns that handoff, and compare refunded orders with returned parcels weekly.

A stock audit rhythm

DailyScan the Stock report and the digest for low, out-of-stock and negative items.
Weekly checksReview pending and cancelled-then-paid orders, and look for stuck jobs on the scheduled actions screen.
Weekly countsCycle-count a slice of fast movers and log each variance with a reason.
MonthlyReconcile against marketplace, warehouse or accounting figures and review refund restocks.
QuarterlyCount slow movers, retire dead SKUs and test thresholds against real sales and lead times.
Before big salesRehearse checkout on staging, confirm the hold and cleanup job, and set the buffer.
Small frequent checks catch drift while it is still a few units, not a crisis.

Diagnosing a wrong stock number

When a number is wrong, resist the urge to fix the number. Classify the failure first, because the cure lives in different places. Start with one product and read its recent orders, since order notes record every stock change an order caused.

The number never moved after a sale. Confirm Manage stock is on globally and for the product, that the order reached a status that reduces stock, and that its line items carry a deducted record. Then look for a plugin or snippet that uses the filters which block reduction.

It moved twice, or moved and came back. Look for an external system that also deducts, an order flipping between pending and processing, or a duplicate order from a gateway retry. Two plugins touching stock is the usual suspect.

The shop and the admin disagree. Suspect caches. Purge the page cache, then the object cache, and check again. If a database edit or an import bypassed the normal functions, the lookup table may be stale, and saving the product again refreshes it.

Quantity and status disagree. A product can show out of stock with units on the shelf, or in stock at zero. The two fields are separate and can drift apart after a direct database edit, an interrupted import or a bulk change that skipped the normal save. The out-of-stock threshold can also make them differ on purpose. Compare the quantity with the threshold, then save the product again so the status is recalculated.

Units are blocked but none were sold. Look at holds. Inspect the reserved-stock table and confirm the scheduler runs. These queries are read-only; replace the wp_ prefix with your own.

SELECT order_id, product_id, stock_quantity, expires FROM wp_wc_reserved_stock WHERE expires > NOW() ORDER BY expires;
SELECT product_id, sku, stock_quantity, stock_status FROM wp_wc_product_meta_lookup WHERE stock_quantity < 0;
$ wp cron event list --fields=hook,next_run_relative

In that list, look for the Action Scheduler queue runner and confirm its next run is close. If wrong numbers keep returning, the cause is almost always structural: two systems writing the same field, or a habit of overwriting where adjusting was needed. Fix the structure, not the symptom.

Which kind of wrong is it?

The stock number looks wrong. What exactly is wrong?
It never moved after ordersCheck the master switch, the product setting, the order status path and any filter or plugin that blocks reduction.
It moved twice or came backLook for a second system deducting, a status flip-flop or a duplicate order from a gateway retry.
Shop and admin disagreePurge page and object caches, then save the product so the lookup table and status refresh.
Units are blocked, none soldInspect reserved holds and confirm the cleanup job runs on a real schedule.
Classify the symptom first; each kind of wrong has its own place to look.

Checklist

  • Confirm the global Manage stock setting is on and every physical product manages stock or has a deliberate manual status.
  • Set Hold stock minutes longer than your slowest payment path and confirm the unpaid-order cleanup actually runs.
  • Send stock notification emails to a shared mailbox, not one person.
  • Replace the default low-stock threshold on fast sellers with a reorder point from sales rate and lead time.
  • Decide whether to use the out-of-stock threshold as a safety buffer and tell staff what it means.
  • Choose parent-level or per-variation stock for each variable product and remove mixed setups.
  • Keep unique, stable SKUs in one format across every system.
  • Allow backorders only with the notify option and a realistic lead time on the page.
  • Leave refund restocking unticked until returned items are inspected, then adjust by hand.
  • Never edit stock with direct database queries on a live store.
  • Check the scheduled actions screen for stuck jobs and run a real server cron behind WP-Cron.
  • Name one source of truth per field in every integration and sync deltas, not absolute counts.
  • Run imports on staging first and check the Stock and In stock columns before a live run.
  • Review negative quantities and status mismatches every week.
  • Cycle-count a slice of fast movers weekly and log each variance with a reason.
  • Rehearse checkout with real payment methods on staging before any launch.

About this guide. This is general guidance written by WPresident Editorial from documentation and widely used practice. WPresident has not benchmarked the products or methods described. Interfaces and plan limits change, so check the vendor’s current documentation before you act. Not legal, tax or financial advice. See our editorial policy.

Frequently asked questions

Why did stock not reduce when an order came in?

Usually one of four causes: Manage stock is off globally or on the product, the order has not reached a status that reduces stock (a pending order created by hand will not), a plugin or snippet blocks the reduction through a filter, or the order was already marked as reduced. Open the order notes and look for a stock levels reduced line, then trace the status path.

Does adding a product to the cart reserve stock?

No. The cart reserves nothing. A hold starts when checkout creates an order, and only if the Hold stock setting is not blank. Until then another shopper can buy the last unit, which is why an item can pass the cart and still be refused at checkout. The cart and checkout validate stock against live data each time, so the refusal is the system doing its job, not a bug.

How long does WooCommerce hold stock during checkout?

The default is sixty minutes, set as Hold stock in the Inventory settings, and a blank value disables holds. The reservation expires by timestamp, while the job that cancels old pending orders runs separately and can lag, so a pending order may outlast its hold. Developers can change the reservation length with a filter, but should keep it consistent with the cleanup interval.

Should I allow backorders?

Only if you can restock reliably and are willing to tell customers. The notify option shows the delay on the product page, cart and checkout, while plain allow shows no backorder message at all. Backorders let quantity go negative, skip checkout holds and can leave mixed orders waiting for the slowest item. For made-to-order goods, skipping stock management is often simpler and clearer for everyone.

Does WooCommerce restock refunded items automatically?

Not by default. Moving an order to refunded does not return units. Stock comes back only if you tick the option to restock refunded items on the refund form. Because money and goods move separately, many stores leave it unticked until returned items are inspected, then adjust the quantity by hand or tick the option for items that are clearly sellable again.

Why does a variable product show in stock when my size is sold out?

A parent that does not manage its own stock counts as in stock when at least one variation can be bought. Shop and category pages show that roll-up, so shoppers see the sold-out size only after choosing options. Keep retired variations disabled, check the status of each variation, and consider showing stock quantities on the product page so the choice is clearer earlier.

Can WooCommerce manage inventory across multiple warehouses?

Not in core, which keeps one quantity per product or variation. Multi-location plugins, inventory systems or an external warehouse system add locations and order routing. Check that any add-on writes to the core stock fields, deducts through the normal hooks, supports block checkout and high-performance order storage, and test it with replayed orders. Expect to configure which location fulfills each order.

Does a CSV import overwrite stock?

Yes. Matching products by ID or SKU replaces the quantity with the value in the file, and a blank Stock column turns stock management off for that row. Orders placed while the import runs are not in your file, so test on staging, import in a quiet period on a live store, or send adjustments instead of absolute numbers where you can.

How should I sync stock with a marketplace or ERP?

Choose one source of truth per field, send changes as deltas keyed by SKU with ids and timestamps, apply them through the stock functions, log before and after values, and run a scheduled reconcile that reports drift instead of hiding it. Add a safety buffer for the delay between a sale and the sync reaching the other system, since that gap is where most cross-channel oversells happen.

How often should I count stock?

Count fast movers and high-value items weekly or monthly, slow items quarterly, and run a full count at least once a year. Record the system quantity when the count starts and adjust for orders that reduced stock during it. Investigate every recurring variance, since it points to a process fault such as mislabelled bins, unrecorded returns or a sync that double counts.

W
Written byWPresident EditorialThe WPresident editorial team. Every article says whether it comes from hands-on use or from documentation, and anything paid for is labelled.

Keep reading

Get the Monthly Launch Report

One email a month: the best of last month's articles, new reviews and what changed in WordPress, without the noise.

No spam. Unsubscribe in one click.

Signed and sealed,
The WPresident
↑↓ move↵ openEsc closeAll results