A newly installed WordPress site is fast. Three years later, the same site, on the same server, with the same theme, has slowed down noticeably. The design has not changed, and traffic has not grown much either. What has changed is the accumulation: leftover records from removed plugins, hundreds of revisions, temporary data tables, media files that are no longer used, and functions that were added over time but never removed.
In this article I will explain how I audit and slim down a bloated WordPress site. The approach is simple: measure first, then delete, then optimize. Those who go in the reverse order usually break something that was working.
Backup First, Everything Else After
Do not apply any step in this article without taking a backup. Database cleanup includes irreversible operations. Take a full backup (files and database), store the backup off the server, and if possible do the whole process in a staging environment first.
Step 1: Plugin Audit
Every plugin generates three costs: the files it loads, the queries it runs and a potential vulnerability. Carry out the audit as follows.
List the active plugins in a table and answer these questions for each one: What function does this plugin provide? Is that function still in use? Is there another plugin that does the same job? When was it last updated? On how many pages of the site does it actually run?
When you fill in this table, the following three groups usually emerge:
- Can be removed: Those installed for a campaign, where the campaign has ended but the plugin remains
- Can be merged: The job of three separate plugins may be done by a single plugin
- Can be replaced with code: Plugins installed for a single small function can often be solved with a few lines of code
An important point when removing a plugin: many plugins leave their records in the database when they are removed. If there is a “delete data as well” option in the settings before removal, tick it; if not, you will have to clean up the remaining records by hand.
Step 2: Post Revisions
WordPress creates a revision on every save. On a site that has been live for a long time, a single page can have 60 revisions. These records needlessly bloat the largest table of the database.
The solution has two stages:
Clean up the existing revisions. Delete old revisions beyond a certain number. Keeping the last few revisions is a reasonable balance.
Set a limit going forward. Define a revision limit in the configuration file. Unlimited revisions are not necessary on any site.
In the same way, posts in the trash and unapproved and spam comments should also be cleaned out regularly.
Step 3: Temporary Data (Transients)
Plugins and the theme create records called transients to store temporary data. They are expected to be deleted automatically when they expire, but in practice many records stay for years.
Cleaning out expired transient records noticeably shrinks the options table and lightens the queries that run on every page load.
Step 4: Autoloaded Options
Records marked “autoload” in WordPress’s options table are loaded into memory on every page load. When the total size of this area exceeds a few hundred kilobytes, its effect becomes measurable.
What to do: list the largest autoload records, identify their source and clean out those belonging to plugins that are no longer used. Some of the necessary ones can also be moved out of autoload. This step requires technical knowledge; do not delete a record you are not sure about.
Step 5: Orphaned Tables
Removed plugins often leave their own custom tables behind. On one site I once found the tables of a forum plugin that had been installed fifteen years earlier.
List the database tables, identify those that do not belong to the WordPress core, and determine which plugin each one belongs to. If the plugin is no longer installed and you do not need the data, the table can be deleted. Before deleting, always take a separate backup of that table.
Step 6: Media Library
The media library bloats in two ways: files not used in any content, and the many size variations generated for each upload.
Unused files. Images that were uploaded and then abandoned accumulate over the years. Identifying and cleaning them saves disk space and backup time. Caution: some images may be used inside the page builder or in CSS, and scanning tools may flag them as “unused”. Do a sample check before deleting.
Size variations. The theme and plugins register their own image sizes. When you upload a single photo, eight or ten different files can be created on the server. Turning off unused size definitions prevents accumulation in later uploads.
Format conversion. Bulk-converting existing images to a modern format gains both disk space and speed.
Step 7: Scheduled Tasks
WordPress’s scheduled task system (cron) runs in response to page visits. Tasks left over from removed plugins, or jobs defined to run too frequently, create unnecessary load on every visit.
Review the scheduled task list and clean out those of unknown origin. On high-traffic sites it is healthier to disable WordPress cron and define a real scheduled task at the server level.
Step 8: Table Optimization
After delete operations, empty space remains in the database tables. Table optimization reclaims this space and refreshes the index structure. Do this step at the end of the cleanups; doing it at the beginning is pointless.
Making Maintenance a Routine
A one-off cleanup returns to the same point two years later. The lasting solution is to set up a routine:
- Weekly: Updates, spam comment cleanup, backup verification
- Monthly: Broken link scan, form tests, performance measurement, review of the 404 report
- Quarterly: Plugin audit, revision and transient cleanup, media library review, restore-from-backup test
- Yearly: Theme and infrastructure review, security audit, content inventory
Put this routine into a checklist and assign an owner. A maintenance plan without an owner does not get carried out, even if it has been written down.
Measure Before and After
To see that the cleanup worked, take measurements at the start and at the end: total database size, the size of the five largest tables, the size of the autoload data, homepage server response time, total number of queries on the homepage and mobile Core Web Vitals values.
Write these six numbers into a table. Only this way can you see the real effect of the improvement — and this is also how you can explain it to your client.
The Hidden Costs of Bloat
The effect of a site getting heavier is not limited to page load speed. The load that builds up over time has other consequences that translate directly into the business.
Backup times grow longer. Backing up a ten-gigabyte media library both takes longer and produces more storage cost. In an emergency, the restore time grows in the same proportion; every minute the site stays down has a price.
The admin panel slows down. In a bloated database, opening the post list, loading the media library and searching are noticeably delayed. This is an invisible tax paid every day by the team that produces content.
Update risk increases. A large number of plugins raises the chance of conflicts during updates. The likelihood of an update causing problems on a site with twenty plugins is much higher than on a site with six.
Troubleshooting gets harder. When an error occurs, you have to deactivate plugins one by one to find the source. As the number of plugins grows, this process stretches into hours.
Which Plugins Are Usually Unnecessary?
These are the categories of plugins I keep encountering in audits that can be removed on most sites:
Social media share button plugins usually load heavy JavaScript and have low click rates. The same function can be provided with simple links at almost zero cost.
Visitor counter and statistics plugins write to the database on every page view. If Analytics is already collecting the same data, there is no point in carrying this load.
Related posts plugins run heavy queries on every page load. A manually selected or simple category-based list is both faster and more accurate.
Image gallery and slider plugins are often installed for a single page but loaded across the whole site. If it is used in only one place, set up conditional loading or make do with the block editor’s built-in gallery.
Plugins installed for a single small function — adding a custom code snippet, hiding a field, doing a redirect — can usually be solved with a few lines of code.
Testing After Cleanup
Verifying that the site has not broken after the delete operations is as important as the cleanup itself. Be sure to test these flows: the homepage and one sample page of each template type, contact form submission, search function, add to cart and checkout step if there is e-commerce, user login and the main screens of the admin panel.
Do the test both on desktop and on a real mobile device. Repeat it after clearing the browser cache; a page that works in your own browser may not work for a new visitor.
Finally, for a week after the cleanup, monitor the error report in Search Console and the server error logs. Requests made to a deleted file show up here and let you catch an overlooked dependency early.
Conclusion
WordPress sites do not slow down on their own; they slow down because of accumulation. A regular maintenance routine extends the life of the site, lowers hosting costs and postpones the decision to rebuild for years.
If you would like me to audit your site’s database and plugins and produce a concrete cleanup plan, you can get in touch.