wc_batch_update_variations: change variations in bulk
Applies updates to several variations in one call. It is a loop around wc_update_variation, not a transaction.
Arguments
| Argument | Required | Meaning |
|---|---|---|
variations |
Yes | A list of update payloads, each with its own id |
dry_run |
No | Preview every entry instead of writing |
Each entry accepts the same fields as a single variation update: sku, regular_price, sale_price, description, stock_quantity, attributes.
Permissions
Allow WooCommerce catalog writes open, plus manage_woocommerce or edit_products. Each entry is checked individually, so a closed gate refuses all of them.
Failures are partial, not atomic
The response is a results list, in the order you sent. Each entry is either an updated variation or an error — and the tool keeps going after an error.
So a batch of twelve where the fourth has a duplicate SKU leaves eleven changed and one not. There is no rollback.
Read every entry in the response, not just the fact that the call succeeded:
Apply the batch, then show me a table of which variations succeeded and which failed.
An assistant that reports "done" without walking the results is hiding the failures.
Entries without an id are silently skipped
In the standard transport, an entry that is malformed or omits id is skipped. WordPress MCP Adapter validates the array and required IDs before execution and refuses an invalid batch.
That means the results list can be shorter than what you sent, and nothing says so. Compare the counts:
Confirm the results list has as many entries as variations I sent.
A batch preview covers every entry
When the batch has dry_run: true, every entry is a preview, even if an entry supplies dry_run: false. An entry cannot turn a batch preview into a write.
When the batch permits writes, an individual entry can still request dry_run: true. Read each result to distinguish previews from saved changes.
Preview the whole batch first
With dry_run at the batch level you get a before and after for every entry:
Dry-run the batch and show me a table of every variation, its current price and its new one.
That table is the review step. It exposes the entries that would not change anything, the ones already on sale, and any ID that does not resolve.
Read the current state before building the batch
There is no revision history. The list from wc_get_product_variations, read before the batch, is your only restore path.
List every variation of product 219 with its prices and stock, then build the batch.
Keep that listing. If the batch goes wrong, you rebuild from it — as another batch.
Percentage rules need a decision about sales
"Raise all variations by 10%" is ambiguous when some are on sale. Raising regular_price on a discounted variation changes nothing customers see; raising sale_price deepens the discount's confusion.
Decide before the batch is built:
Raise regular_price by 10% on the variations that are not on sale, and list the ones you skipped.
Size the batch to what you can check
The batch is convenient, and that is the risk: one call can change every combination of a product, publicly, with no undo.
Start with two or three entries, verify the storefront, then run the rest. A batch that touches sixty variations is one you cannot meaningfully review after the fact.
After writing
- Walk the
resultslist and account for every entry. - List the variations again and compare against your pre-batch table.
- Open the product page and select two or three affected combinations.
- Check the product's price range on listing pages.
- Purge the cache, then the CDN.
Common problems
| Symptom | Cause |
|---|---|
| The write is refused | Catalog write gate closed |
| Some entries succeeded, others failed | Expected; the loop does not stop or roll back |
| Fewer results than variations sent | Entries missing an id were skipped |
| An entry stayed unchanged during a write batch | Check whether that entry requested dry_run: true |
pom_ai_mcp_wc_variation_not_found on one entry |
A stale or wrong ID in that entry |
| Customer prices unchanged | Those variations are on sale |
| A combination disappeared from the selector | An entry changed attributes |
Related
wc_update_variation— the single-item formwc_get_product_variations— read before, compare after- Manage product variations