wc_update_product: update a product
Updates an existing product. The highest-stakes write available through MCP.
Arguments
| Argument | Required | Meaning |
|---|---|---|
id |
Yes | The product |
name, slug, status |
No | Post fields |
description, short_description |
No | Copy |
sku |
No | Stock keeping unit |
regular_price |
No | Normal price |
sale_price |
No | Sale price |
manage_stock |
No | Whether to track stock |
stock_quantity |
No | Stock level |
categories |
No | Category IDs |
dry_run |
No | Report without writing |
Only the fields you pass are changed.
Permissions
Allow WooCommerce catalog writes open, plus manage_woocommerce or edit_products.
Everything here is immediately public
There is no draft state for a price. A write lands on the storefront as soon as it saves, and customers can act on it before you notice a mistake.
That is why this page recommends the dry run more insistently than any other in the reference.
Use the dry run every time
The update dry run returns a genuine before and after:
Use a dry run to set the regular price to 24.90 and show me the before and after.
Read the before carefully. It tells you whether a sale price is currently active — which determines whether your change will affect what customers pay at all.
Name the field, exclude the rest
The three price-shaped fields are the trap:
Update only the regular price of product 219. Do not change the sale price, stock, description, categories or status.
Writing sale_price when you meant regular_price starts a discount. Writing regular_price on a product already on sale changes a number no customer sees. Neither raises an error.
price cannot be written — it is WooCommerce's computed result and appears in the response so you can verify the outcome.
Clearing a sale price
To end a sale, set sale_price to an empty value. Omitting the argument leaves the existing sale price in place, which is the opposite of ending it.
This catches people: "remove the discount" is not achieved by updating the regular price.
Stock
manage_stock and stock_quantity are independent. Setting a quantity while management is off stores a number nothing uses; enabling management without setting a quantity can make a product show as out of stock.
Read both before changing either.
Changing the slug changes a public URL
A product URL that customers have bookmarked, that appears in campaigns, or that a marketplace feed references. Plan redirects before changing it.
Changing name alone does not move the URL.
Categories replace
categories sets the full list of category IDs. Passing one category removes the others — the same replace-by-default behaviour as wp_add_post_terms, and with the same consequence for shop navigation and filters.
Read the current categories first and pass the complete intended set.
Other plugins hook product saves
Dynamic pricing, currency, feed and inventory plugins commonly act when a product is saved. The value you wrote is not always the value that ends up stored.
Read the product back independently after writing, not just the tool's response.
Bulk price changes
Pilot on one product, check the storefront, then continue:
Show me the before and after for the first product only, then stop.
A percentage rule applied across a catalogue behaves differently on products that are on sale. Establish what the rule should do in that case before running it.
After writing
- Read the product back.
- Open the product page on the storefront and check the displayed price.
- Check the shop and category listing pages.
- Purge the cache, then the CDN.
Common problems
| Symptom | Cause |
|---|---|
| The write is refused | Catalog write gate closed |
pom_ai_mcp_wc_product_not_found |
Wrong ID |
pom_ai_mcp_wc_forbidden |
Missing shop capability |
| The customer price did not change | A sale price is still active |
| A discount started unexpectedly | sale_price was written |
| Categories disappeared | The list replaces rather than appends |
| The stored value differs from what you sent | Another plugin acted on save |
| The storefront shows the old price | Cache or CDN not purged |
Related
wc_get_product— always read firstwc_update_variationfor variable products- Manage the product catalog