Tutorials WordPress

How to Limit/Disable WordPress Revisions (with & without a plugin)

Updated

Written by

Dave Warfel

Reading Time

10 minutes

If you buy something from one of our links, we may earn a commission.

This article is all about managing WordPress post revisions: what they are, how to disable, limit and delete them, why you should, and multiple ways to do all of the above. I’ve included quick links below so you can jump directly to the section that applies to you. But first, here’s a quick piece of advice when considering which option (code vs. plugin) is best for you.

  • If you’re a beginner with zero coding knowledge, a plugin is probably best.
  • If you have some coding experience, or have a developer who can help, you might prefer to use your own code (edit your wp-config.php file)
  • If you aren’t already using a performance plugin, I highly recommend you consider Perfmatters + WP Rocket, which will satisfy all your post revision needs and boost your performance in many other ways.

In this article…

NOTE: Some WordPress hosts will help you implement the code to limit or disable WordPress revisions. You can simply reach out to your hosting support & ask.

What are WordPress post revisions?

When you’re working on a piece of content in WordPress, whether it be a post, page or custom post type, WordPress keeps track of the changes you make.

LEARN: What’s the difference between a post & a page?

Each time you click the Save Draft or the Update button, WordPress saves a copy of your content at that time. Each copy is called a revision. You can view all of your revisions directly from the post/page you’re editing.

  1. Find the Publish meta box in the top-right corner of the post edit screen
  2. Click the Browse link to view all revisions
WordPress revisions on the post edit screen
Browse WordPress revisions from the post edit screen

From there, you can revert back to a previous revision if you need to recover any of your content that you’ve since deleted or changed.

How revisions negatively affect WordPress performance

Just like your published posts & pages, revisions are stored in your WordPress database. Each revision adds a new record to your database. If you have 100 posts, and each post has 5 revisions, that’s 500 additional records in your database.

When someone visits your site, they only see 1 record in your database, and that’s the one for the published post. They don’t care about all the revisions. The revisions are only for you internally, if you need them.

Each time a visitor hits a page on your site, your server queries the database to find the relevant information to display to the visitor. The more records you have in your database, the longer that query can take. The longer it takes, the slower your website becomes.

Therefore, keeping the minimum number of revisions you need, and deleting all the rest, is one of several ways to optimize your database and speed up your WordPress site.

What I use & recommend

Because I’m a big fan of transparency, I want to show you exactly what I’m using on this site (and all sites I build), and share my recommendations based on experience.

What I Use

I personally DO NOT like to completely disable post revisions. Although I have rarely needed to restore a revision, I can see a few instances where it could potentially save me from a lot of trouble.

  • I often revisit old content to make fairly substantial updates. It’s nice to have one or two copies of the previous version.
  • Some posts take multiple days (weeks even) to write. I might want to jump back to something I wrote previously, but have since erased.
  • I’m sure you’ve heard it a million times, but “It’s always good to have a backup.”

I limit post revisions to 4

I couldn’t decide between 3 or 5, so I went with 4 🤷🏼‍♂️. It’s just enough that I have a few versions to fall back on if I need to, but not too many that it will slow down my site, or clog my database.

And because I’m comfortable editing my wp-config.php file, I use code to limit revisions on my entire site, for all post types.

I use WP Rocket to improve WordPress performance

WP Rocket WordPress plugin

WP Rocket provides an option to delete all post revisions from your WordPress database. This is helpful if you need to retroactively delete revisions, but it won’t prevent them from being stored in the future (see “The Ultimate Combination” below for a way to do both).

Deleting old post revisions is nice, but I love WP Rocket for all the other performance benefits it provides. See below for a brief rundown of its best features.

The Ultimate Combination 🚀

I truly believe the ultimate WordPress performance plugin would be a combination of WP Rocket & Perfmatters. They have a little bit of overlap, but most of their features are unique, and incredibly useful on their own.

WP Rocket logo Perfmatters logo

Both plugins deal with WordPress post revisions, but in different ways. Let me briefly explain how they each deal with revisions, and show you how they offer so much more in terms of performance.

Perfmatters

In terms of WordPress revisions, Perfmatters provides an easy way to:

  • completely disable post revisions
  • limit revisions to 1, 2, 3, 4, 5, 10, 15, 20, 25 or 30 per post
Perfmatters plugin - disable/limit post revisions
How to disable or limit WordPress revisions with Perfmatters (screenshot from perfmatters.io)

Other Performance Benefits of Perfmatters

Perfmatters is a premium plugin, but it’s incredibly affordable for a low, yearly price. And it not only makes it easy to disable or limit post revisions, but it provides a bunch of additional performance enhancements that are guaranteed to speed up your site.

  • Disable scripts on per page/post basis
  • Disable embeds, emojis, jQuery migrate and a bunch of other scripts that slow down your site
  • Enable DNS prefetching & Preconnect
  • Remove unnecessary info from the <head> section
  • Optimize WooCommerce by removing unused features & scripts
  • Check out our comprehensive review »

WP Rocket

When it comes to WordPress revisions, WP Rocket makes it easy to delete all existing post revisions. You can also remove any auto drafts, as well as trashed/deleted posts. If you’ve been running your site for a while with revisions enabled, they make it simple to remove everything and start with a clean slate.

WP Rocket post cleanup options
How to delete post revisions with WP Rocket

To keep them disabled (or limit them) moving forward, you should either update your wp-config.php file or use the Perfmatters plugin.

Other Performance Benefits of WP Rocket

WP Rocket is hands-down the best WordPress caching solution money can buy (What’s caching?). There are some free caching plugins that do an OK job, but none are as easy to set up, as good at what they do, or integrate so well with other hosting platforms & plugins as WP Rocket does.

  • Complete WordPress caching solution
  • Compatible with most popular WordPress hosts, Cloudflare, third-party CDNs and many other WordPress plugins.
  • Database optimization
  • Automatic ecommerce integration with WooCommerce, Easy Digital Downloads and other shopping cart plugins
  • Lazyloading, CDN support, preloading, defer JavaScript, critical path CSS, minification, concatenation, and so much more.
  • See a full list of features »

Now, if you’re already using a different WordPress performance plugin, and just simply need to adjust your WordPress post revisions…

How to disable WordPress revisions

There are several ways to disable post revisions in WordPress. Which method you choose will depend on how much control you want over your revisions, as well as your technical expertise. Jump to the section that applies to you.

  • Disable all revisions for your entire site (using code)
  • Disable revisions only for certain post types (free plugin)
  • Disable revisions + other performance benefits (premium plugin)

Disable revisions in wp-config.php file (using code)

Add the following line of code to your site’s wp-config.php file:

// Disable Post Revisions
define( 'WP_POST_REVISIONS', false );

This code must be placed above the line that says, “That’s all, stop editing!”.

Here’s an example:

WordPress disable post revisions code

NOTE: If you don’t know how to locate your wp-config.php file, you probably shouldn’t be editing it. Either ask a WordPress developer to help you, or try one of our plugin methods.

Disable revisions for certain post types (free plugin)

If you want to disable WordPress revisions for only certain post types…

  1. Install & activate the Disable Post Revision WordPress plugin
  2. Navigate to Settings > Writing
  3. Under “Writing Settings,” look for Disable Post Revisions
  4. Hold down the control/cmd key and select the post types that you’d like to disable revisions for
  5. Scroll to the bottom and click Save Changes
Disable WordPress revisions by post type
How to disable revisions by post type, using a plugin

Disable revisions + performance benefits (premium plugin)

If you’d like to disable WordPress revisions & receive a bunch of additional performance benefits from the Perfmatters plugin…

  1. Purchase & install the Perfmatters plugin
  2. Navigate to Settings > perfmatters
  3. Look for Limit Post Revisions
  4. Choose Disable Post Revisions
  5. Click Save Changes at the bottom

How to limit WordPress revisions

The simple, free way to limit WordPress post revisions is by editing your wp-config.php file. However, if you are not comfortable editing this file, you can use an inexpensive premium plugin to do the job.

Limit revisions in wp-config.php file (free, using code)

NOTE: Your wp-config.php file is vital to your site running properly. One small mistake can bring your entire website down. Edit with caution or ask for help.

Add the following line of code to your site’s wp-config.php file. You can change the 4 to any number you’d like. I recommend no more than 5 to keep your site running fast.

// Limit Post Revisions
define( 'WP_POST_REVISIONS', 4 );

This code must be placed above the line that says, “That’s all, stop editing!”.

Here’s an example:

WordPress limit post revisions code

Limit revisions + performance benefits (premium plugin)

Again, the Perfmatters plugin gives you a bunch of options for limiting your post revisions (1, 2, 3, 4, 5, 10, 15, 20, 25 or 30 revisions).

Follow the instructions above and choose a limit instead of disabling them.

How to delete WordPress revisions

Reminder: All of the above solutions to disable or limit your revisions only work from this point forward. They will not retroactively delete old revisions. But I’ll show you how to do that right now.

You’ve got a few options (click link to jump to a section):

  • Free Plugin (free, one-time deletion)
  • Premium Plugin (schedule deletion, plus additional performance benefits) (recommended)
  • MySQL query (highly technical, not recommended unless you are a developer)

Before making any changes to your database, you should always create a backup of your site.

Delete WordPress revisions with a free plugin

The best free plugin to delete WordPress revisions is the Bulk Delete plugin by Sudar. It has great reviews, is actively maintained, and Sudar is a seasoned developer.

  1. Install & activate the Bulk Delete plugin
  2. Navigate to Bulk WP > Bulk Delete Posts
  3. Scroll down until you see the By Post Revision section
  4. Check the box for All Revisions
  5. Click Bulk Delete

This action cannot be undone, so make sure you have a recent backup, and you are OK losing all of your revisions.

If you think your database is running slow, or would like to optimize your entire database (including post revisions), consider the WP-Optimize plugin.

Delete revisions with a premium plugin

My preferred method of handling old post revisions is with the WP Rocket plugin. I already have it installed for the many performance benefits it provides, and it also includes a really simple way to delete old revisions.

You can even schedule WP Rocket to automatically delete revisions (and optimize your entire database) on a daily, weekly or monthly basis. I have my database automatically optimized once a week.

WP Rocket post cleanup options
How to delete post revisions with WP Rocket
  1. Navigate to Settings > WP Rocket
  2. Click on the Database tab
  3. Choose what you’d like to delete & optimize
  4. (optional) At the bottom, choose a schedule frequency
  5. Click the Optimize button

Delete revisions in your database with a MySQL query

I was planning on including a MySQL query you could run on your database to delete all post revisions, but…

  • there seems to be conflicting information on which method is the best one
  • it’s dangerous to edit your database directly in this way
  • if you have a highly customized site/database, the code might not work for you
  • there are quality plugin solutions that can do it

For those reasons, I highly recommend using Bulk Delete (free), WP-Optimize (free) or WP Rocket (premium) to delete WordPress revisions from your site.


That covers just about every possible method for managing your WordPress post revisions. As you can tell, there is no single solution that’s best for everyone. I tried to provide options for various scenarios, so please take your site’s current setup into consideration when choosing how to best disable/limit your revisions.

And as always, if you have any questions, please ask them in the comments.

Dave Warfel

LinkedIn  •  X (Twitter)Dave has been working with WordPress since 2011. He's built 100s of client sites and almost a dozen of his own. He's tested almost every plugin you can think of, hosted with at least 10 different companies, and gone down every SEO rabbit hole you can imagine. When's he's not tinkering with new software, you'll find him in the mountains of Colorado, trail running, summiting peaks, and rippin' downhills on his mountain bike. 🏔️🏃🚴🤸

2 responses to “How to Limit/Disable WordPress Revisions (with & without a plugin)”

  1. hanikura Avatar
    hanikura

    Hey there! Quick question that”s entirely off topic. Do you know how to make your site mobile friendly? My web site looks weird when browsing from my apple iphone. I”m trying to find a theme or plugin that might be able to correct this problem. If you have any recommendations, please share. Appreciate it!

    1. Dave Warfel Avatar

      Hi hanikura — I actually wrote an article about this exact topic a while back. It’s 2 years old but still relevant. I’d still recommend the plugins on the list.

      How to make WordPress sites mobile-friendly

      WPTouch is by far the best option, with Jetpack also doing a nice job. But keep in mind, Jetpack comes with A TON of other features, so if you don’t want those, WPTouch is the way to go. Obox is still worth checking out, but use this link to their website instead.

      You could also change your theme, but that will completely change the look of your site on desktop, as well. And depending on the level of customization you have with your current site, it could be a much larger undertaking to switch themes. A plugin is probably your best/quickest option.

      Let me know if you have further questions.

Leave a Comment