How to delete WordPress revisions from your database

In a previous post, I wrote about how to how to disable and limit WordPress post revisions. In this post, I will show you how to delete your old WordPress revisions and clean up/optimize your database. This ensures that your site keeps running at optimal performance.

How to delete WordPress revisions

Follow the quick and easy steps below to delete old WordPress revisions that have probably been laying around in your database for a long time.

In this tutorial, we are using our premium Perfmatters plugin. We’ve developed our database optimization feature to be as lightweight as possible, while still giving you the options you need.

If you are looking for a free solution, WP-Optimize is also good. Be careful when searching for plugins that delete post/page revisions. Some of these plugins can cause a lot of damage. Some are even banned from certain hosts due to the amount of overhead they have on your site.

Step 1

No matter how good your WordPress plugin is, it’s always recommended to take a backup of your site before doing any operation that deletes data. If you are using a premium hosting provider like Kinsta, you can quickly take a snapshot of your site. This way you can rollback with a single click if needed. Otherwise, there are free WordPress backup plugins you could use.

Kinsta WordPress site backup/snapshot
Kinsta WordPress site backup/snapshot

Step 2

After you have a WordPress backup, click into the Perfmatters plugin settings.

Perfmatters plugin settings
Perfmatters plugin settings

Step 3

Click the “Extras” tab and then click “Database.”

Perfmatters database optimization
Perfmatters database optimization

Step 4

Toggle on “Post Revisions.” The number of revisions found will show up to the right of it. This also includes page revisions and custom post types. In this example, you can see there are 322 revisions.

Perfmatters post revisions
Perfmatters post revisions

Step 5

Scroll down and click “Optimize Now.”

Perfmatters optimize database
Perfmatters optimize database

The process will run in the background. You don’t need to stay in the plugin while it’s running or worry about leaving the window open. It will and let you when it’s finished with a notification at the top of the Perfmatters plugin settings.

I have seen dramatic speed increases by doing this on client’s sites that haven’t limited the number of revisions in WordPress. Some of them cleaning up more 1,500+ revisions.

Summary

It’s important that you give your site’s database a little TLC from time to time.

Was this tutorial on how to delete WordPress post revisions helpful? If so, let me know below in the comments.

author bio
Brian Jackson

I craft actionable content and develop performance-driven WordPress plugins. Connect on X, subscribe to my newsletter (once a month), or buy me coffee.

13 thoughts on “How to delete WordPress revisions from your database”

  1. Hi there. Thanks for this article, however, I’m wondering if you’ve tried this on a WP network install, and if so, was everything good?

    Reply
  2. Hi!

    Great article!

    However……..can I use this plugin to delete Page revisions? Probably a stupid question, but everything seems to relate to Posts.

    Reply
  3. Hello friends, suppose there are 15 revisions of a post. And we want to save the last two revisions with the published post; that means there will now be three copies of the post: one – published and two – most recent revisions; i want to know if we can configure the pluggin to delete the desired number of revisions instead of deleting all of those.

    Reply
    • Hey Rashi,
      The above tutorial includes cleaning up post revisions, page revisions, and revisions for custom post types.

      Reply
  4. Thanks for this. It’s been harder than expected to find current, and reliable plugin to delete revisions. Just installed and used WP Optimize based on your recommendation. Perfect!

    Reply
    • Great Chris! Glad the WP-Optimize recommendation helped. If you get a chance to try out our Perfmatters plugin, I would love to know what you think.

      Reply

Leave a Comment