Organize product categories in bulk

WooCommerceIntermediate~25 min

Before you start

A connected store with the WooCommerce integration enabled and the term read, create, update, and add-post-terms abilities turned on.

Product categories grow by accident. A “Misc” bucket fills up, two categories end up meaning the same thing, and the tree that made sense at fifty products is a mess at five hundred. Tidying it in the admin means clicking through the categories screen and editing products one by one.

This lets the agent read the current tree, lay your reorganization out beside it, and make the moves once you approve. Reparenting is guarded so a category can never become its own ancestor, and adding a product to a category leaves its existing ones in place.

The prompt
I want to reorganize the product categories in my store. Here is the change I
want: [rename "Misc" to "Accessories", move "Hats" and "Scarves" under a new
"Winter" parent, and put the products tagged [X] into "Winter"]. Do not change
anything yet.
First, list the current product categories with the number of products in
each, and show me the new tree beside the current one plus the exact list of
products that would move. Flag anything that would create a loop, like making
a category its own parent.
Once I approve, create and rename the categories, then add the named products
to their new categories in batches of [20], and pause between batches. Note
that adding a category does not remove the old one, so tell me which old
categories to clear if I want a clean move. At the end, list every category
you created or renamed and every product you reassigned.

Why this is safe to run

The first pass is a read. Listing the categories and their product counts changes nothing, so you approve a before-and-after tree rather than reshape live data blind. Any reparenting is checked against a circular-hierarchy guard, so an approved move can never leave a category pointing at itself as its own parent.

The writes are additive by design. Renaming and reparenting edit a category in place, and attaching a product appends the new category without stripping the ones it already has, so nothing is quietly un-categorized. There is no delete in this recipe at all: clearing an old category is a deliberate, separate step you take yourself. The term abilities stay off until you enable them, every write is checked against the capability of the bound user, and each change is recorded in the Activity Log.

Already connected? Skip the paste. Ask your agent for the “organize product categories in bulk” recipe, or just describe the tree you want, and it runs the same read-then-approve flow on your own store.

How it works

  1. List the current product categories and how many products each holds.
  2. Lay out the change you describe: renames, reparenting, new categories, and which products move where.
  3. Show the before-and-after tree and the product moves, and wait for your approval.
  4. Create and rename the approved categories, then attach the named products in small batches.
  5. Report every category created or renamed and every product reassigned.

Questions

Does it remove a product from its old category when it adds a new one?
No. It appends the category you name and leaves the existing ones in place, so nothing loses its current category by surprise. Clear the old one yourself if you want a clean move.
Can it delete a category?
No. This recipe only lists, creates, renames, and reparents categories and adds products to them. Deleting a category is a separate ability you would enable on its own.