Your prompt
Clear expired WooCommerce sessions and transients and tell me how much database space we saved.
What this prompt does
WooCommerce stores temporary data such as customer sessions and transients in your database. This prompt asks your assistant to remove the expired ones and report how much space that freed.
WooCommerce includes tools for this under Status, Tools, so a careful assistant can use the built-in routines rather than raw database commands. That is the safer route.
Sessions and transients are expected to come and go, which is why clearing expired ones is generally low risk. The goal is housekeeping, not a dramatic fix, and the saving depends entirely on how long your store has been collecting them.
Think of it as tidying a cupboard. You are not changing how the shop works, just removing leftovers that serve no purpose and that your database would otherwise keep carrying.
Before you run it
Expired items are safe to clear. Active carts are not.
- Back up your database first.
- Choose a quiet time so you do not clear a live customer’s session.
- Ask it to clear only expired items, not every session.
- Record the database size beforehand so the comparison means something.
- If you use an object cache such as Redis, mention it, because some transients live there instead of in the database.
- Tell your assistant which database tool or plugin you already use, so it does not install another one for a job that WooCommerce can do itself.
What to check afterwards
- Compare the database size before and after.
- Add a product to the cart and complete a test order.
- Check that the site and admin load normally.
- Confirm the report names what was removed.
- Note the figure your assistant reports and treat it as an estimate.
- Look at the Scheduled Actions screen for new failures, since cleanup should not cause any.
Ways to adapt it
- Make it regular: Suggest how I can do this on a schedule.
- Widen it: Also report the largest tables in my database.
- Estimate first: Tell me how much I could save but change nothing.
If it goes wrong
- The space saved is tiny. That is fine. A small result means little was stored.
- Customers lost their carts. Active sessions were cleared. Limit the job to expired data next time.
- Transients come back. They regenerate normally as the site is used.
- The tool you want is not there. Tool names change between versions. Ask your assistant to look for the equivalent under WooCommerce Status.
For more background, read our guide to cleaning your database safely and WooCommerce speed checklist, or work through the backup routine tutorial.