Knowledgebase

Cleaning Up Database Bloat Print

  • databasesphpmyadmin, databases, database, wordpress, plugins, performance, spam, domainrenewal, phpmyadmin, php
  • 0

Reclaiming size and speed.

WHERE BLOAT ACCUMULATES

Post revisions, one per edit, indefinitely Expired transients, which are rarely cleared Spam and trashed comments Orphaned metadata from deleted content Log tables from plugins Session data Statistics tables

THE COMMON DISCOVERY

A site whose database is mostly not content. Reductions of eighty per cent or more are routine.

FINDING WHAT IS LARGE

phpMyAdmin lists tables with their sizes. Sort by size.

Anything named log, stat, transient or session is worth investigating.

CLEANING SAFELY

Use a maintenance plugin that understands the application, rather than deleting rows directly.

It removes the related metadata as well, which direct deletion misses.

BACK UP FIRST

Always. Cleanup tools occasionally remove more than intended.

LIMITING REVISIONS

In WordPress, define WP_POST_REVISIONS in wp-config.php to cap how many are kept.

Three is usually plenty and prevents indefinite growth.

AFTERWARDS

Optimise the affected tables to reclaim the space.


Was this answer helpful?
Back

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


Trustpilot