Optimising Your WordPress Database (Firstserv Guide)
As your WordPress site grows, your database will gradually accumulate additional data—such as post revisions, drafts, user data, and temporary (transient) information. Over time, this can increase database size and impact performance.
Regularly cleaning and optimising your database helps keep your website running efficiently.
Before You Begin
⚠️ Always take a full backup of your website before performing any database optimisation.
While these actions are generally safe, having a backup ensures you can quickly restore your site if anything unexpected occurs.
Using the LiteSpeed Database Optimiser
The easiest way to clean your WordPress database is by using the LiteSpeed Cache plugin, which includes a built-in Database Optimiser.
Access the Optimiser
- Log in to your WordPress dashboard
- Go to LiteSpeed Cache → Manage
- Open the DB Optimiser tab
Understanding the Interface
- ✅ Blue check marks – This area has already been cleaned
- ❌ Red crosses – Cleaning is available for this item
Optimisation Options Explained
Clean All
Runs most cleanup tasks in one go.
⚠️ Note: This does not include:
- Optimise Tables
- Clean CSS/JS Optimiser
Post Revisions
Removes old versions of posts and pages.
- Keeps only the current version
- Frees up database space
⚠️ You won’t be able to restore previous revisions after removing them.
Auto Drafts
Deletes automatically saved drafts created while editing posts.
Safe to remove if:
- You have no incomplete or unsaved work
Trashed Posts
Permanently deletes posts and pages that have been moved to the rubbish bin.
Spam Comments
Removes all comments marked as spam.
✅ Recommended, as these serve no purpose and take up space.
Trashed Comments
Permanently deletes comments that have been placed in the trash.
Trackbacks & Pingbacks
Removes trackbacks and pingbacks (external links from other sites).
- Safe to delete if you don’t use or display them
Expired Transients
Deletes expired temporary data stored in the database.
✅ Recommended for regular cleanup.
All Transients
Removes all transient data (both expired and active).
⚠️ Notes:
- Some transients may remain or be recreated automatically
- Used by plugins for caching and temporary storage
Optimise Tables
Optimises the structure of your database tables for better efficiency.
✅ Helps improve database performance
❗ Not included in “Clean All”—must be run separately
Clean CSS/JS Optimiser
Removes stored data related to CSS/JavaScript optimisation.
✅ Useful if you are using LiteSpeed’s:
- Minification
- Combination features
❗ Not included in “Clean All”
Best Practices
- Run database cleanups regularly
- Avoid removing data you may still need (e.g. revisions if you rely on them)
- Monitor site performance after optimisation
- Combine this with caching and image optimisation for best results
Benefits of Database Optimisation
- Faster page load times
- Reduced server resource usage
- Smaller database size
- Improved backend and admin performance
Summary
Keeping your WordPress database clean is an important part of ongoing site maintenance. Using the LiteSpeed Database Optimiser, you can quickly:
- Remove unnecessary data
- Improve performance
- Keep your site running efficiently
If you need help optimising your database or configuring LiteSpeed tools, the Firstserv support team is always available to assist.
