How to optimise your WordPress database

Introduction

As your WordPress site grows, your database accumulates various data, including post revisions, auto drafts, trashed items, and more, which can slow down your site. To maintain optimal performance, it’s essential to regularly clean and Optimise your database. We recommend using the LiteSpeed Database Optimiser, a part of the LiteSpeed Cache plugin. Before you start, ensure you have a backup of your site in case of any issues. Here’s how to Optimise your WordPress database:

 

Access the Database Optimiser:

  • Log in to your WordPress admin panel.
  • In the left-hand menu, select “LiteSpeed Cache,” then click on “Manage.”
  • Go to the “DB Optimiser” tab.

 

Cleaning Options:

  • You’ll see various cleaning options listed, some with blue checkmarks (already cleaned) and others with red crosses (needs optimisation).

 

Clean All:

  • Click this button to perform a comprehensive cleanup of your database, excluding “Optimise Tables” and “Clean CSS/JS Optimiser.”

 

Individual Cleaning Options:

You can choose specific cleaning options based on your needs:

  • Post Revisions: Removes old post revisions from the database.
  • Auto Drafts: Deletes automatically saved drafts.
  • Trashed Posts: Permanently removes posts or pages in the Trash.
  • Spam Comments: Clears comments marked as spam.
  • Trashed Comments: Permanently deletes comments in the Trash.
  • Trackbacks & Pingbacks: Clears external links created by trackbacks and pingbacks.
  • Expired Transients: Removes expired transients resulting from caching.
  • All Transients: Clears all transients, expired or not. Note that some transients may remain as they are generated by plugins.
  • Optimise Tables: Optimises the database tables to improve efficiency.
  • Clean CSS/JS Optimiser: Cleans up data related to CSS and JavaScript Optimisation.

 

Additional Tips:

  • It’s advisable to perform regular database Optimisation to keep your site running smoothly.
  • Use the “Clean All” option sparingly and only after understanding its impact on your site’s functionality.

 

By following these steps, you can effectively Optimise your WordPress database and maintain the performance of your website.