Articles on: First steps
This article is also available in:

What database optimization does in Modular DS

Modular DS database optimization lets you clean up the leftover data that WordPress accumulates over time. It is one of the features that helps you keep your websites lighter and faster, and that lets you offer added value in your maintenance plans.


You can access the global database optimization page from "[Database Optimization" in the left side menu of your dashboard.



You can also do it at the site level using the side menu.




Why optimize the database?


Every time you edit a post, moderate a comment, or install a plugin, among many other things, WordPress stores data in its database. A lot of that data is no longer useful: intermediate drafts, old post versions, trashed comments, expired cached values, etc...


Over time it builds up, and the database becomes bloated. That slows down queries and takes up space. Optimization removes that excess and keeps the database lightweight.


What optimizations you can run


Modular DS groups optimizations into four categories. You can select the ones you want and leave the rest out.


Below, we explain what each of the optimization options means.


Posts


  • Clean all auto drafts: deletes the drafts that WordPress saves on its own every few minutes while you edit. Once the post is published, they are useless and take up space.
  • Remove orphaned post metadata: removes custom fields that are no longer linked to any post (because it was deleted or reimported). They slow down metadata searches.
  • Clean all post revisions: deletes the old versions that WordPress saves each time you update a post. Useful while you write, dispensable afterwards.
  • Clean all trashed posts: permanently deletes the posts sent to the trash, which still take up space and are counted in every listing.


Comments


  • Clean unused Akismet metadata: removes the information that Akismet adds to detect spam and that is no longer used.
  • Remove orphaned comment metadata: deletes data associated with already-deleted comments.
  • Remove all pingbacks: This removes the automatic notices generated by external links. If you do not use them, they are just noise.
  • Remove spam and trashed comments: empties both folders and reduces the total number of stored comments.
  • Remove all trackbacks: deletes trackbacks, a type of link notice that has fallen out of use.
  • Remove unapproved comments: deletes comments pending moderation.


Users


  • Remove orphaned user metadata: deletes the custom fields that were left associated with users that no longer exist.


Others


  • Reduce database table overhead: compact free space, reorganize indexes, and remove the internal fragmentation of the tables. It reduces their size and improves read and write speed.
  • Remove orphaned relationship data: deletes rows that no longer point to any valid post, page, or comment. These dangling records bloat the tables and slow down queries.
  • Remove expired transients: deletes the cached values whose expiration date has already passed. They still take up space and are read in every query to the options table.


Is it safe to optimize?


Yes. Optimization is safe and reliable under normal conditions.


When you click "Optimize," you will see a notice recommending you make a backup before continuing. It appears for two reasons: the action cannot be undone and, in very rare cases, a server failure right during the process could affect the data.


It is a standard precaution, not a sign that something is going to go wrong. The practical recommendation: make sure you have backups enabled in Modular DS in case you need to restore one of them, or make a backup beforehand and optimize with peace of mind. If you want, check out how to make an instant backup.


How to run an optimization


  1. Go to Database Optimization from the sidebar.
  2. Check the optimizations you want to apply. Next to each one you will see how many items need cleaning.
  3. Click Optimize and confirm in the notice.


Updated on: 10/07/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!