Fill the Server: 80% off your first 4 monthly invoices, monthly billing. Ends Nov 30, 2026. 25 spots in this batch.FILL25
Fill the Server, annual: about 29.63% off your first annual invoice. Ends Nov 30, 2026.FILL25Y
Fill the Server, 2 year term: about 15.69% off your first biennial invoice. Ends Nov 30, 2026.FILL25B
Fill the Server, 3 year term: about 11.11% off your first triennial invoice. Ends Nov 30, 2026.FILL25T
80% off your first 3 months, monthly billing. Ends Dec 25, 2027.3MONTHS80
50% off your first annual Shared term. Ends Dec 31, 2027.50SHARED
Shared Starter, 3 year term: C$105.84 total.MOOSE294
20% off your first 3 monthly VPS invoices. Ends Dec 31, 2027.20VPS3
25% off your first annual base VPS term.25VPS

← All guides

WordPress

WordPress database cleanup: remove old data without breaking a plugin

Published August 2026 · 2 min read · Updated 2026-09-05

WordPress database cleanup is safest when every table and row class has an owner. Revisions, transients, sessions, plugin logs, Action Scheduler data, orphaned metadata, and deleted-plugin tables can grow, but “cleanup” tools can also remove data a plugin still needs.

Take a database backup and inventory tables

Record database size by table, row counts, storage engine, and the plugin/core feature associated with large tables. Export a recoverable database copy before destructive operations.

A table name prefix can hint at ownership but is not proof when plugins share core tables.

Understand each cleanup category

Expired transients are different from active options; post revisions may matter to editors; ecommerce sessions and scheduled-action history may have retention rules; logs may be operational evidence.

Use plugin/vendor documentation for purpose-built pruning when available.

Delete in bounded batches

Large deletes can lock tables, generate replication/binlog work, or cause I/O spikes. Batch cleanup and observe application/database latency. Avoid a massive delete during peak traffic.

Table optimization may require additional temporary disk space and should be planned separately.

Fix the retention source

After cleanup, configure log/session/action retention or remove abandoned plugins so growth does not immediately return. Monitor table size trend and query performance over time. Keep the before/after table-size report with the maintenance record so future operators can tell which growth is expected and which table changed unexpectedly.

  • Back up before deletion.
  • Map tables to owners.
  • Prune in controlled batches.
  • Add ongoing retention.

Next step

Map large tables to their owners, back up first, prune known data classes in bounded batches and fix the retention source so database growth stays controlled.

Explore DotMoose WordPress hosting

Keep reading

Related guides.

Do I need web hosting for WordPress? What WordPress actually needs

Self-hosted WordPress needs web hosting, but it does not require a specially branded WordPress plan. Compare WordPress.com, regular shared hosting, WordPress hosting and VPS options.

Read the guide

How to move web hosting without downtime

Move a website and database with destination testing, final synchronization, controlled DNS cutover, and rollback while preserving separate mail routing.

Read the guide

PHP timeout troubleshooting: PHP, PHP-FPM or the web server?

Find which PHP timeout fired, check the right configuration, and distinguish PHP execution limits, PHP-FPM termination and nginx FastCGI read timeouts.

Read the guide

More wordpress guides

We will handle the move. You check it first.

Your current site stays online until your new one is ready. You approve the copy first, and if anything is not right we switch you back right away. The price you pick is the price you renew at.

Start my free moveSee plans and prices
See pricesFree move