Scheduling Automatic Database Cleanup
Instead of cleaning your database by hand each time, you can have xSpeed Cache run the cleanup for you on a set schedule.
What this does
xSpeed Cache can run database cleanup automatically on a repeating schedule. You choose how often it runs and which cleanup categories it includes. Between runs, it does the same cleanup you would run by hand, with no need to open the dashboard.
Why use it
A schedule keeps your database tidy without you having to remember. Sites that build up revisions, spam, or transients quickly benefit from regular automatic cleanups.
How to set it up
- Open the xSpeed Cache dashboard in
/wp-admin/. - Go to the Database panel.
- Set Auto-Cleanup Schedule to how often you want cleanup to run.
- Use Auto-Cleanup Types to choose which cleanup categories run on that schedule.
- Save your settings.
Important: Automatic cleanup only runs when you set a schedule and choose at least one cleanup type. If Auto-Cleanup Types is empty, no automatic cleanup happens, even if a schedule is set.
Warning: Automatic cleanup permanently deletes the data in the selected categories every time it runs. Make sure you only include categories you are comfortable removing on a recurring basis.
Settings explained
Auto-Cleanup Schedule How often cleanup runs automatically. The options are Manual, Hourly, Daily, and Weekly. The default is Manual, which means cleanup only runs when you press the clean button yourself. Choose Hourly, Daily, or Weekly to run cleanup on a repeating schedule.
Auto-Cleanup Types Which cleanup categories run on the schedule above. By default this is empty, which keeps automatic cleanup off even when a schedule is set. Add the categories you want the schedule to include, such as post revisions or spam comments.
| Setting | What it does | Default |
|---|---|---|
| Auto-Cleanup Schedule | How often cleanup runs automatically | Manual |
| Auto-Cleanup Types | Which categories the schedule cleans | (empty) |
Best practices
- Start with Weekly to see how cleanup affects your site before moving to a more frequent schedule.
- Only include categories you are sure you want removed on every run.
- Keep a backup routine in place, since automatic cleanups delete data without asking each time.
Troubleshooting
My schedule is set, but nothing is being cleaned. Check that Auto-Cleanup Types has at least one category selected. An empty type list keeps automatic cleanup off, even with a schedule chosen.
I switched back to Manual and the schedule stopped. That is expected. Setting the schedule to Manual turns off automatic cleanup, and you can still clean by hand from the Database panel.
FAQ
When does the first automatic cleanup run? The first scheduled run happens about an hour after you save the schedule, then it repeats at the interval you chose.
Does the schedule clean different categories than a manual cleanup? No. It cleans the same categories. The schedule only runs the categories you select in Auto-Cleanup Types.
Can I keep automatic cleanup off but still clean manually? Yes. Leave Auto-Cleanup Schedule on Manual (or leave Auto-Cleanup Types empty) and run cleanup by hand whenever you want.
Related
- Cleaning and Optimizing Your Database