Set product categories
ps_set_product_categories
Moves products into or out of categories.
Ask Claude
„Move all products from Corner sofas to Sofas, make Sofas their default category, and also add them to Sale.”
Example preview
14 products. Product 140 Corner sofa Bergen: categories [Corner sofas] -> [Sofas, Sale], default Corner sofas -> Sofas. URL: /corner-sofas/140-bergen.html -> /sofas/140-bergen.html, old URL will redirect 301.
Technical details
Adds products to categories, removes them, and sets the default category, for a list of products or all products of a source category. Example "move from X to Y and also add to Z": from_category_id=X, add_category_ids=[Y,Z], remove_category_ids=[X], default_category_id=Y. When the category is part of the product URL, the preview shows the URL changes and whether old URLs will redirect with 301.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| products | array of string | no | List of products (max 200), or use from_category_id. |
| from_category_id | integer | no | All products assigned to this category (without subcategories). |
| add_category_ids | array of integer | no | Categories to add (max 20). |
| remove_category_ids | array of integer | no | Categories to remove (max 20). |
| default_category_id | integer | no | New default category (also added to the product's categories). |
| shop_id | integer | no | Shop ID in a multistore installation. Defaults to the shop in the connector address. IDs are listed by ps_get_shop_info. |
| confirm | boolean | no | false (default) returns a preview and saves nothing. true executes, only after the user approved the preview, together with change_token. |
| change_token | string | when: confirm=true | Token from the preview. Required with confirm=true. Valid 30 minutes, single use, bound to the previewed arguments and data state. |
Limits
Max 200 products per call, max 20 categories to add and 20 to remove.
What you see before anything is saved
Claude first calls the tool without confirming it. The module returns a preview (current and new values) and a single-use token valid for 30 minutes. Claude shows you the preview and saves the change only after your yes.
Related tools
- Category tree ps_get_category_tree
- Diagnose product visibility ps_diagnose_product_visibility
- Revert change ps_revert_change
- Inspect a store page ps_inspect_page
Last updated: 2026-10-03