WooCommerce Database Cleanup: Sessions, Logs and Old Data Safely
Stores accumulate sessions and logs. Clean them carefully to keep the database light.
Reference guide. This guide is written from established practice and the official documentation of the tools involved. We have not yet tested every step on a live demo site. Back up your site before you change anything.
What can pile up
- Customer sessions and expired data.
- Logs (WooCommerce, Status, Logs).
- Action Scheduler records.
- Old pending or failed orders.
Cleanup
- Back up first. See WordPress backups.
- Delete old log files and set log retention.
- Clear expired transients and sessions via tools. See Clean Expired Transients and Old Sessions Safely in WordPress.
- Trash only orders you are legally and practically allowed to remove; keep accounting records.
- Optimize tables afterwards. See Repair and Optimize the WordPress Database (Corrupted Tables).
Related guides
- WordPress: Remove Query Strings From Static Resources: Pros and Cons
- WordPress Plugin Bloat: How Many Plugins Are Too Many?
- WordPress: Optimize Images in Bulk Without Changing URLs
- WordPress: Delete Expired Transients Safely
Did this solve it? If not, email hello@sitefixlab.org with the exact error text and we will look into it. Try the problem finder.