There is one database problem that slows WordPress on every single request, and it is not the one the cleanup plugins advertise. Autoloaded options are loaded from the database into memory on every page load, including cached ones on some configurations, and plugins add rows to that table freely and remove them on uninstall rather […]
The post Best Database Optimisation and Cleanup Plugins for WordPress appeared first on ThemeAlley.
There is one database problem that slows WordPress on every single request, and it is not the one the cleanup plugins advertise. Autoloaded options are loaded from the database into memory on every page load, including cached ones on some configurations, and plugins add rows to that table freely and remove them on uninstall rather less freely. A site that has tried twenty plugins over five years can be loading megabytes of settings belonging to software it no longer runs.
Post revisions and expired transients get all the attention because they are easy to count and satisfying to delete. Autoloaded data is the one worth measuring. This article covers what accumulates, which of it matters, and how to clean it without breaking anything.
Verified August 2026. Prices confirmed against vendor pages.
Post revisions are stored copies of every save. A page edited fifty times carries fifty revisions, each a full row with its own metadata. They inflate the posts table and slow queries that scan it, and on a content site with years of editing they can outnumber real posts several times over.
Transients are cached values with an expiry, and WordPress does not reliably clean up expired ones. They accumulate in the options table indefinitely, which is untidy rather than catastrophic unless a plugin generates them per visitor, at which point the table grows alarmingly.
Orphaned metadata is rows in the meta tables pointing at posts, users or comments that no longer exist. Deleting a plugin’s custom post type rarely removes its meta, so the rows sit there being scanned by queries that will never use them.
And autoloaded options, the one that matters most. Every option marked to autoload is read on every request. Healthy is usually well under a megabyte total; sites with a long plugin history routinely have several. Because this cost is paid per request rather than per query, it is the accumulation most worth measuring before you do anything else.
The most widely used cleanup plugin, free for the essential work, from the UpdraftPlus team. It removes revisions, auto-drafts, trashed items, spam and expired transients, and it optimises tables, all from one screen with checkboxes.
Its practical advantage is scheduling. A one-off cleanup fixes today and the accumulation resumes immediately, so the useful configuration is a weekly automatic run that keeps the database from ever getting bad again. It also integrates with UpdraftPlus, which matters because the correct order of operations here is always backup then clean, and having both from one vendor makes that a single habit. Premium tiers add multisite support and more granular control. For most sites the free version does everything that needs doing.
The one that addresses the problem this article opened with. Beyond the usual cleanup, it identifies orphaned options and tables left behind by plugins you have deleted, and tells you which plugin each belongs to.
That attribution is the valuable part. Anybody can show you a list of database tables; showing you that a particular table belongs to a plugin you removed in 2023 is what makes deletion safe rather than a gamble. It does the same for options, which is the route to reducing autoloaded data. Free and premium versions exist. Treat it as an occasional audit tool rather than a scheduled task: run it once, understand what your database is carrying, remove what is genuinely dead, and repeat annually. The risk is real and worth stating: deleting a table belonging to a plugin you still use loses data permanently, so back up first, every time.
$29.95 a year for one site, $59.95 for three, $124.95 for unlimited sites, and relevant here for prevention rather than cleanup. It limits post revisions, controls the autosave interval, and disables features that generate database writes you do not need.
Prevention beats cleanup on a metric nobody measures: the cleanup you never have to run. Capping revisions at five per post means the problem stops growing, which is worth more than deleting fifty thousand rows once and watching them return. Its wider value is the script management described elsewhere in this pillar, so the database features are a bonus on a purchase justified by other means. At $124.95 for unlimited sites, an agency applying sane revision limits across a portfolio is doing more good per pound than any cleanup schedule.
Free, and doing something entirely different from everything else here: it adds database indexes to WordPress’s core tables so that common queries run faster without deleting anything at all.
This matters because on a large site the problem frequently is not that the database contains junk but that the queries scanning it are inefficient. WordPress’s default indexes were designed for smaller sites, and on a posts table with hundreds of thousands of rows, or a postmeta table in the millions, the right index can turn a slow query into an instant one. Nothing is removed, so nothing is at risk of being removed wrongly, which makes it an unusually safe intervention. If your site is large and slow in the admin, particularly when filtering posts or orders, try this before deleting a single revision.
Free, and the diagnostic tool that tells you whether any of this is your problem. It reports every database query a page runs, how long each took, and which plugin or theme was responsible.
Installing it before buying anything is the advice this whole category needs. Sites are routinely cleaned of fifty thousand revisions with no measurable improvement, because the actual problem was one plugin running a slow uncached query on every page load, which Query Monitor would have named in thirty seconds. It also reports the total number of queries per page, and a page running four hundred queries has a plugin problem rather than a housekeeping problem. Deactivate it when you are finished, since it adds overhead of its own.
Free, permanent, and it stops the largest source of accumulation before it starts. Setting a revision limit and lengthening the autosave interval takes two minutes and no plugin at all.
Limiting revisions to a small number, five is generous for most sites, means a heavily edited page keeps its recent history and discards the rest automatically. Extending the autosave interval from the default reduces the write frequency while editing, which matters on sites where several people work at once. Combined, these prevent the two mechanisms that generate most of the rows a cleanup plugin later removes. Everything else on this list is treatment; this is the vaccine, and it is free. Add an object cache if your host offers Redis or Memcached and you have addressed database load from both directions.
| Option | Price | Cleans | Prevents | Risk |
|---|---|---|---|---|
| WP-Optimize | Free; premium tiers | Revisions, transients, trash | Via scheduling | Low |
| Advanced Database Cleaner | Free; premium | Orphaned tables and options | No | High if careless |
| Perfmatters | $29.95 to $124.95/yr | No | Yes, revision limits | Low |
| Index WP MySQL For Speed | Free | Nothing, adds indexes | Not applicable | Very low |
| Query Monitor | Free | Nothing, diagnoses | Not applicable | None |
| wp-config.php settings | Free | No | Yes, at source | Low |
Database cleanup is the one performance task that can destroy data rather than merely fail to help. The precautions are short and non-negotiable.
Then set a revision limit so you do not have to do most of it again. The sites that need repeated cleanup are the ones that never stopped the accumulation.
Sometimes, and less often than the plugins imply. Excessive autoloaded options and inefficient queries slow sites measurably; fifty thousand post revisions frequently do not. Measure before and after.
How many revisions should I keep?Between three and ten for most sites. Zero is tempting and unwise, since revisions are how you recover from a bad edit. Five is a sensible default.
Is it safe to delete orphaned tables?Only with a backup and preferably after testing on staging. Attribution tools make an educated guess, and deleting a table belonging to a plugin you still use loses that data permanently.
What is a healthy autoload size?Comfortably under a megabyte on most sites. Several megabytes means plugins are autoloading data they should not, and identifying which is a better use of time than deleting revisions.
Should I schedule automatic cleanup?Yes for the safe categories, revisions, transients and trash, on a weekly schedule. No for orphaned tables and options, which need human judgement each time.
Does an object cache help?Considerably, if your host offers Redis or Memcached. It keeps query results in memory instead of hitting the database repeatedly, which addresses the load rather than the contents.
Diagnose first with Query Monitor, free. It names the plugin behind each slow query, and it regularly reveals that the database was never the problem.
Then set a revision limit in wp-config.php. Two lines, free, permanent, and it prevents the accumulation that cleanup plugins exist to remove.
For routine cleanup: WP-Optimize, free, on a weekly schedule covering revisions, transients and trash. For an occasional audit of what dead plugins left behind, Advanced Database Cleaner, with a backup taken first.
And if your site is large and the admin is slow, try Index WP MySQL For Speed before deleting anything. Adding the right index is free, removes nothing, and fixes a class of slowness no amount of cleanup touches.
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Best WordPress Caching Plugins for Core Web Vitals | 0 | 7.28 | 20-08-2026 |
| 2 | WordPress Font and Third-Party Script Management Plugins | 0 | 9.09 | 20-08-2026 |
| 3 | Performance Plugins for WooCommerce Stores | 0 | 8.26 | 20-08-2026 |
| 4 | WordPress : optimiser les requêtes SQL des plugins | 0 | 9.07 | 06-08-2026 |
| 5 | Nettoyer et optimiser sa base de données avec WP-CLI | 0 | 12.19 | 31-07-2026 |
| 6 | Best Image Optimisation Plugins for WordPress | 0 | 8.2 | 20-08-2026 |
| 7 | WordPress Activity Log Plugins for Compliance and Auditing | 0 | 7.98 | 20-08-2026 |
| 8 | Best Free WordPress Security Plugins | 0 | 12.05 | 20-08-2026 |
| 9 | Best WordPress Social Media Plugins for 2026: Choose by Workflow, Not Hype | 0 | 7.4 | 12-06-2026 |
| 10 | WordPress CDN Plugins and Integrations Compared | 0 | 9.84 | 20-08-2026 |