Knowledgebase

Cleaning Up a Bloated WordPress Database Print

  • wordpress, database, performance, phpmyadmin, plugins, woocommerce, cpanel, spam, domainrenewal, php
  • 0

Over time the database fills with data no visitor ever sees, which slows queries and inflates backups.

What accumulates

  • Post revisions — a page edited 40 times stores 40 full copies
  • Auto-drafts and trashed posts
  • Spam and trashed comments
  • Expired transients
  • Orphaned postmeta from plugins you deleted
  • WooCommerce session and scheduled-action tables

How to clean safely

  1. Back up the database first — cPanel → phpMyAdmin → select the database → Export → Go.
  2. Install WP-Optimize or Advanced Database Cleaner.
  3. Run the cleanup items one at a time rather than selecting everything at once.
  4. Finish with the table optimisation option to reclaim disk space.

Limit future revisions

Add this to wp-config.php to keep only the last five revisions per post:

define('WP_POST_REVISIONS', 5);

Warning

Do not delete tables manually in phpMyAdmin unless you are certain what they belong to. Removing a table a live plugin depends on will break the site.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot