Bulk-update stock and inventory

WooCommerceIntermediate~20 min

Before you start

A connected store with the WooCommerce integration enabled and its product and variation update abilities turned on.

After a stock take, a delivery, or a busy weekend, the numbers in WooCommerce drift from the numbers on the shelf. Reconciling them by hand means opening each product, finding the Inventory tab, and typing a count, and variable products hide the real number one level down on each variation.

This lets the agent do the reconciling. You hand it the new counts, it matches them against what the store currently shows, and it lays out exactly what would change before it writes anything.

The prompt
I need to update stock across [the "Winter" category]. I have the new counts
in [stock.csv]. Change nothing on the first pass.
Read the products in that category with their current stock quantity and
status, match them against my counts, and show me a before-and-after table of
what would change. For variable products, read and show the stock on each
variation, since that is usually where it lives.
Once I approve the table, write the new quantities and statuses in batches of
[25], updating each variation where the product is variable, and pause
between batches. Set anything with a zero count to out of stock. At the end,
list every product and variation you changed.

Why this is safe to run

The first pass reads and compares only. Reading current stock and matching it against your counts writes nothing, so you approve a before-and-after table rather than discover the change after the fact. The table is also your record if a count needs putting back.

Every stock change here is per product or per variation. The recipe sets quantities and statuses on the specific items you approve, and it never reaches for a store-wide inventory option like a global out-of-stock rule, which is not one of its abilities. The WooCommerce abilities stay off until you enable them, each write is checked against the manage-WooCommerce capability, and every changed item is recorded in the Activity Log, batch by batch.

Already connected? Skip the paste. Ask your agent for the “bulk-update stock and inventory” recipe, or just hand it your counts, and it runs the same match-then-approve flow on your own store.

How it works

  1. List the products or category you name with their current stock quantity and status.
  2. Match them against the counts you provide and mark what changes, writing nothing yet.
  3. Show the before-and-after stock table and wait for your approval.
  4. Write the approved quantities and statuses in small batches, updating each variation where a product is variable.
  5. Report every product and variation it changed.

Questions

Can it set a product to out of stock?
Yes, one product at a time. It sets the stock status or quantity on each product or variation you approve. It never changes a store-wide inventory setting.
Does it work with variable products?
Yes. Stock usually lives on the variation, so it updates each variation's quantity and status, not only the parent product.