Tag your bestsellers automatically

WooCommerceIntermediate~10 min

Before you start

WooCommerce enabled, with the top-sellers report and the term abilities turned on. The product tag you want must already exist in WooCommerce.

A “Bestsellers” tag is only useful if it actually holds your bestsellers, and keeping it current by hand means re-checking the sales report every month and editing each product. Since a WooCommerce product is a post type underneath, the agent can read the top sellers and append your tag to exactly those products, without touching anything else on them.

The prompt
I want to tag my best-selling products. First, change nothing: pull the top
sellers for the [last 30 days], and look up my existing product tag named
[Bestsellers] so we are pointing at the right one.
Show me the match: the products that will get the tag, with their sales
counts, so I can confirm the list. Do not tag anything yet.
Once I approve it, append the [Bestsellers] tag to those products in small
batches, leaving their other tags untouched, and show me each batch. At the
end, list every product you tagged.

Why this is safe to run

The reads come first and carry no risk: pulling the top-sellers report and looking up the tag change nothing, so you approve the exact match list before any product is touched.

The write is the gentlest kind. Appending a term adds your tag and leaves every existing tag in place, so nothing a product already had is lost, and it never edits the product’s name, price, stock, or description. It works in batches you watch, only on the products you approved, and every change is checked against the capability of the user you bound the agent to and recorded in the Activity Log. If a product was tagged by mistake, you remove the tag from it in WooCommerce and the rest stand.

Already connected? Skip the paste. Ask your agent for the “tag your bestsellers automatically” recipe, or just tell it which tag and which period, and it runs the same reads-first flow on your own store.

How it works

  1. Read the best-selling products for the period you name.
  2. Look up the existing product tag you want to apply and confirm it is the right one.
  3. Show the match list (which products get the tag) and wait for your approval.
  4. Append the tag to the approved products in small batches, never replacing their other tags.
  5. Return the list of every product it tagged.

Questions

Will this remove the tags a product already has?
No. It appends the tag and leaves every existing tag in place, so a product keeps whatever it already carried plus the new one.
Can it create a new tag if the one I want does not exist yet?
No. This recipe only applies a tag that already exists. If you need a fresh Bestsellers tag, create it once in WooCommerce first, then run this to fill it.