LiteSpeed Cache can be considered as the most comprehensive free WordPress source code optimization plugin up to now. Even premium plugins like WP Rocket or Swift Performance can’t match it. In addition to the ability to optimize static data (CSS, JS, images …) LiteSpeed Cache can also help you clean and optimize the database to give your website the best performance. If you are using the LiteSpeed Cache plugin on your website, here are the detailed instructions.
Database optimization with LiteSpeed Cache plugin
In the admin interface of WordPress, you go to LiteSpeed Cache => Database. Here, you will see 2 tabs including  Manage and  DB Optimization Settings.
The Database Optimizer section of the Manage tab integrates several features as shown below.
- Clean All: clean all unnecessary data in the database.
- Post revisions: delete all revisions of the post.
- Auto Drafts: delete all automatic saves of articles.
- Trashed Posts: delete all posts and pages in the trash.
- Spam Comments: delete all comments that have been marked as spam.
- Trackbacks / Pingbacks: Delete all trackbacks and pingbacks.
- Expired Transients: deletes expired transients in table options.
- All Transients: delete all transients in table options.
- Optimize Tables: optimize the tables in the database.
- Clean CSS / JS Optimizer: clears data about CSS / JS files that the LiteSpeed Cache plugin has optimized.
Click on the corresponding items to initiate the cleaning and optimization process. Usually, these will not cause any problems for the website. However, to ensure 100% safety, you should still perform a database backup first.
Scroll down to Database Table Engine Converter. This is the place that will allow you to convert database storage technology from MyISAM to InnoDB. If you do not understand why you should do so, you can refer to the article “Moving database storage technology from MyISAM to InnoDB” for more details.
Click the Convert to InnoDB button corresponding to the table to convert. Let’s do it one at a time until we get the message: “We are good. Notable uses MyISAM engine “.
Switch to the DB Optimization Settings tab, you will see a few options as follows.
- Revisions Max Number: the number of post revisions that will be retained (not deleted) during the database cleaning process. If you want to delete all then set the value to 0.
- Revisions Max Age: Modifications with a number of days less than or equal to the number of days set in this section will be retained during database cleaning. If you want to delete all, then set the value to 0.
After setting, click the Save Changes button to save. Simple as that. Good luck!
Database optimization is a handy feature of the LiteSpeed Cache plugin. It is very effective, secure, and does not pose any risk to your WordPress website. With this feature, you can boldly remove plugins such as WP-Optimize, WP-Sweep … However, it would be perfect if LiteSpeed Cache is equipped with a feature to schedule cleaning and automatic database optimization.
Which plugin are you using to clean and optimize the database for your WordPress website? How do you evaluate the database optimization feature of the LiteSpeed Cache plugin? Let us know in the comments box below.