- Behind most slow WordPress sites is a bloated, unoptimized database nobody has ever cleaned.
- Here is how to fix that safely on ordinary shared hosting.
Website owners spend most of their optimization effort on images and caching, while the database โ where every post, comment, setting and revision lives โ quietly accumulates years of clutter that slows every single page load.
What Bloats a Database Over Time
- Post revisions: WordPress saves a full revision every time a draft is saved, often accumulating dozens per post.
- Spam and unapproved comments: left sitting indefinitely in many installations.
- Transients: temporary cached data that plugins create and frequently fail to clean up after expiry.
- Orphaned data: leftover data from uninstalled plugins that never cleaned up after themselves.
Safe Optimization Steps
- Back up the database first โ non-negotiable before any cleanup operation.
- Limit post revisions going forward via a simple wp-config.php setting, preventing future bloat.
- Delete spam and trashed comments in bulk through the WordPress admin.
- Clean expired transients using a reputable cleanup plugin or a direct database query if comfortable with phpMyAdmin.
- Optimize database tables โ phpMyAdmin's "Optimize Table" function reclaims space fragmented by deletions.
Using phpMyAdmin Safely on Shared Hosting
Most shared hosting cPanel accounts include phpMyAdmin for direct database access. Always export a full backup before running any manual queries, and test cleanup operations on a staging copy first if your plan supports one.
Measuring the Impact
Check your database size before and after cleanup (visible in phpMyAdmin), and measure page load times with a tool like PageSpeed Insights before and after โ a heavily bloated database can show meaningful, measurable improvement after a thorough cleanup.
Frequently Asked Questions
How often should database cleanup happen?
Quarterly for an active site is a reasonable rhythm; more frequently for high-traffic sites with heavy comment or e-commerce activity.
Can database cleanup break my website?
Improperly targeted manual deletions can โ always back up first and use a reputable cleanup tool rather than freehand queries unless confident in SQL.
Need help with a slow, bloated database? See our hosting plans or ask our support team for a performance review.