Bulk-set out-of-stock status on products

WooCommerceIntermediate~15 min

Before you start

A connected store with the WooCommerce integration enabled and its read abilities on. The product write ability stays off until you switch it on for the update pass.

Sometimes you need a batch of products marked out of stock in one go: a supplier dropped a line, a seasonal run sold through, or you are pulling a range before a relaunch. Doing it by hand means opening each product and setting the same field over and over, which is exactly the kind of repetitive edit that invites a mistake on product forty.

This reads your list, shows you what would change, and flips the stock status per product only after you approve. One honest limit up front: it works on each product’s own stock status, not on the store-wide setting that decides whether out-of-stock items stay visible.

The prompt
I want to mark a set of products out of stock on this WooCommerce store: [name
the set, for example "everything in the Summer 2025 category" or paste a list
of product names or SKUs].
First pass, change nothing: list those products with their current stock
status and show me exactly which ones would flip to out of stock. Let me
confirm the list is right.
Only after I approve, set each product's stock status to out of stock, a few
at a time, and show me each batch before it saves. Work on the per-product
stock status only. At the end, list every product you changed with its old and
new status.

Why this is safe to run

The first pass is reads. Listing the products and their current stock status writes nothing, so you confirm the exact set before any status flips.

Here is the honest scope, because it matters. This recipe sets the stock status on each product one at a time, and that is all it does. It does not touch WooCommerce’s store-wide “hide out of stock items” option, because that global catalog setting is not one of this plugin’s abilities. If you want out-of-stock products hidden from the shop, that toggle stays a decision you make yourself in WooCommerce. The product write ability stays off until you enable it, work runs in small batches you approve, each call is checked against the capability of the user you bound the agent to, and every write lands in the Activity Log. Because the change is a single field per product, the same flow in reverse puts them back in stock.

Already connected? You do not have to paste this at all. Ask your agent for the “bulk-set out-of-stock status” recipe, name the set, and it runs the same review-then-update flow on your own store.

How it works

  1. List the products in the set you name, with their current stock status.
  2. Show you which ones would change to out of stock, and change nothing yet.
  3. After you approve, set each product's stock status to out of stock, one batch at a time, showing each batch.
  4. Return every product it changed with its old and new stock status.

Questions

Does this hide the out-of-stock products from my shop?
No, and this is worth being clear about. It sets each product's own stock status to out of stock, one product at a time. Whether an out-of-stock product still shows in your catalog is controlled by WooCommerce's store-wide "hide out of stock items" setting, which is a global option this plugin does not manage. You would flip that toggle yourself in WooCommerce.
Can I put them back in stock the same way?
Yes. The change is just a stock-status field per product, so the same recipe in reverse sets them back to in stock. The change list records the old status next to the new one, so you always have the previous value.