Coupon housekeeping: find and disable stale coupons

WooCommerceIntermediate~15 minUpdated

Before you start

A connected store with the WooCommerce integration enabled and both its coupon read and write abilities on. Turn on the coupon write ability only for a run you are supervising. This plugin's Update coupon tool is high-risk, so it stays locked until High-risk abilities is unlocked in Settings, even if you ticked it in Abilities. A connection on the Shop manager preset never gets it.

Coupon lists grow the way junk drawers do. A launch code, three test coupons a developer made, last year’s Black Friday code that technically still works, a “one-time” discount you gave a customer and forgot. Most stores have a pile of them and no idea which are live. This prompt reads the whole list, flags the ones that look dead, and switches off only the ones you sign off, so the code keeps working for the coupons you actually still run.

The prompt
Help me tidy up coupons. Read first, then let me approve before you change
anything.
List every coupon with its code, discount, expiry, and how many times it has
been used. Then read the ones that look stale by this rule: [never used and
no expiry date]. Tell me separately which coupons
are already past their expiry, since those need nothing. Build me a table of
the ones you would switch off, with the code, why it qualifies, and its usage
count. You cannot see when a coupon was created, so do not guess at its age.
Do not change anything yet.
I will tell you which ones to switch off. Only those. Switch them off by
setting the expiry date to yesterday (do not delete them), in batches of
[10], and show me each batch after you do it. At the end, list every coupon
you changed and its old expiry, so I can put any of them back.

Why this is safe to run

The whole first pass is reads. Listing the coupons and reading each candidate’s terms and usage changes nothing, so you approve the list before a single coupon is touched. Switching a coupon off this way is a reversible write, unlike a delete: the past expiry date stops the code from working while the coupon and its usage history stay in place, and you can restore the old date if you switched one off too eagerly. The prompt has the agent report each old expiry so you have it. It is still gated the careful way, with explicit approval of the list, small batches, and a pause to show you each batch, and the coupon write ability stays off until you enable it for a run you are watching. Every call is checked against the capability of the user you bound the agent to and lands in the Activity Log, so you can see exactly which coupons changed and when.

Already connected? Skip the paste. Ask your agent for the “coupon housekeeping” recipe, set your own rule for what counts as stale, and it runs the same read-first, approve-the-list flow on your own store.

How it works

  1. List every coupon with its code, amount, expiry, and usage count.
  2. Read the ones that look stale for their full terms and restrictions.
  3. Show you a table of candidates to switch off and why, and wait for your approval.
  4. Switch off only the coupons you approve by setting their expiry to yesterday, in small batches, pausing to show each batch.
  5. Return the list of coupons it changed so you can review them.

Questions

Does it delete the coupons?
No. There is no delete or draft switch for coupons in these tools. To switch one off, the agent sets its expiry date to yesterday, so the code stops working while the coupon and its usage history stay in place. Nothing changes until you approve the list, and you can put a coupon back by giving it a later expiry date or clearing the date.
How does it decide which coupons are stale?
It reads each coupon's expiry date and usage count and proposes candidates against the rule you set, like never used. It cannot see when a coupon was created, so a rule about age is not something it can check. It only proposes, and you approve which ones actually get switched off.
What about coupons that have already expired?
They are listed as already dead and left alone. An expired coupon cannot be used, so there is nothing to switch off.