Knowledge Base

How to Optimise Your WordPress Database

As your WordPress site grows, your database also expands. This growth includes previous versions of posts and pages, user accounts, and other ‘transient’ data. Over time, this extra data can slow down your site. Regularly cleaning your database can help maintain optimal performance. The LiteSpeed Database Optimizer, part of the LiteSpeed cache plugin, is an excellent tool for this task.

Steps to Optimize Your WordPress Database

Before you begin, ensure you have a backup of your site. While database optimisation is generally safe, it’s always good to have a backup in case something goes wrong.

  1. Access the Database Optimizer: In your WordPress dashboard, go to LiteSpeed Cache > Manage. Then click the DB Optimizer tab.
  2. Understand the Optimization Options: Some buttons have blue check-marks, indicating that the area has already been cleaned. Red crosses indicate areas that need optimization.
  3. Clean All: This button cleans up everything at once, except for Optimize Tables and Clean CSS/JS Optimizer.
  4. Post Revisions: This option removes all old post revisions from the database, leaving only the currently-published version of each post.
  5. Auto Drafts: WordPress automatically saves drafts when you edit a post. This option removes these automatic drafts.
  6. Trashed Posts and Comments: These options permanently delete any posts, pages, or comments that have been placed in the Trash.
  7. Spam Comments: This option permanently erases comments that have been marked as spam.
  8. Trackbacks & Pingbacks: This option clears trackbacks and pingbacks from the database.
  9. Expired Transients: This option clears all of the expired transients from the database.
  10. All Transients: This option clears all of the transients in the database, whether expired or not.
  11. Optimize Tables: This button optimizes the database tables. This function is not included in a Clean All.
  12. Clean CSS/JS Optimizer: If you use the Minification and/or Combination functions for CSS and/or Javascript, you can clean up the related data with this button. This function is not included in a Clean All.

Remember, if you’re unsure about something, don’t hesitate to contact WebClients support team. We’re here to help!