WordPress revisions, know how to undo changes; Whenever you save a draft or update a published WordPress page or post, a content management system (CMS) automatically creates revisions. When enabled, this feature prevents you from missing out on important work. So, unfortunately, over time, WordPress revisions can take up unnecessary disk space and affect your site’s performance.
Fortunately, you can use methods to minimize the negative effects these stored revisions have on your site. For example, in addition to excluding, deactivating, or limiting them, you can also optimize your revisions database.
This guide will introduce WordPress revisions and explain where to find them. We will then guide you on using revisions and prevent them from negatively affecting your site.
Let’s start!
WordPress revisions
So, WordPress revisions automatically record changes you make to pages or posts on your site. So, a new copy of a page is created every 60 seconds by default, like when you click the Save Draft, Publish, or Update buttons.
WordPress revisions are useful for any website owner. They serve as backups that you can restore in an unexpected outage, such as accidentally closing your browser tab or experiencing a power outage.
They also allow you to revert to older versions of your content. For example, you might find that a post isn’t performing as well as it used to, and you want to revert some recent changes.
Revisions are also very useful when you have a team working on your site’s content. In addition to letting you see what made post/page edits and what edits were made, WordPress’s revisions feature also records the username and timestamp of those changes. This increases transparency and facilitates collaboration in editorial work.
Problems with WordPress revisions
WordPress revisions can become a serious problem if you don’t manage them properly. So, the more pages and posts you add to your site and will generate the more comments.
If you have a large site or make changes frequently, this can quickly lead to unnecessary database bloat. This is because every time a revision is created, an additional row is added to the WordPress database table, with a value of .wp_postpost_typerevision.
The larger your database, the more storage space it will take up. Unfortunately, this can slow down your site and lead to longer load times, hurting your site’s user experience and search engine optimization (SEO).
So therefore, it is critical to learn how to control revisions in WordPress in your favor. So, whether you want to delete revisions entirely, disable or limit them, or optimize your revisions database, you have many options.
What Actually Gets Stored in a Revision (and Why It Adds Up Fast)
Understanding exactly what WordPress stores every time it creates a revision explains why the database bloat problem described above happens as quickly as it does.
Each time WordPress saves a revision, it does not store just the changes you made. It stores a complete, full copy of the post or page’s content, title, and excerpt as a new row in the wp_posts database table, with its post_type column set to “revision” and a post_parent value pointing back to the original post or page it belongs to. This means a 5,000-word blog post that has been edited and saved 50 times has roughly 50 full copies of that 5,000-word post sitting in the database, not 50 small diffs.
This is why revision buildup scales with both content length and edit frequency. A short, rarely-edited page accumulates very little revision data. A long-form article that gets revised regularly, or a WooCommerce product description updated frequently for pricing or stock changes, accumulates revision data fast, because every save duplicates the entire content again.
By default, WordPress does not limit how many revisions it keeps per post. Left unmanaged on an active site, this is exactly how sites with thousands of posts end up with revision tables many times larger than the actual published content they are meant to support.
Where to find revisions in WordPress
Before discussing the different ways to use and change revision settings in WordPress, it is important to first understand where to find them. In the editor screen of your post or page, go to the menu on the right and click on the Document tab.
So, if revisions are enabled and changes have been made, you will see the number of revisions in the Status and Visibility section.

Click on it to visit the Revisions page, where you can see all saved edits and compare any two revisions side by side. You will see two columns: the left shows the previous version of the post or page, and the right shows the selected version.
Don’t forget to save the file.
So, when you log back into WordPress, you should see the revisions feature turned on. To ensure it’s working, open the editor for any page or post and check the Revisions option under the Document tab.
So, the longer you run your website, the more revisions you may have stored in your database. But, of course, if you spend years updating and editing content, you’ll accumulate a lot of revisions.
Use the slider to navigate through the various restore points. This system highlights content that has been added (plus and green) or removed (minus and red and green).
So, if you want to keep the existing version and return to the editor screen without making any changes, just click the article title at the top of the screen or the “Return to Editor” link.
How to disable WordPress revisions
On the other hand, you can completely disable WordPress revisions. You can also leave this feature enabled to limit or exclude revisions to minimize the space occupied by the database. So, the next section describes how to do this.
However, if you don’t find any purpose or use for this feature, you can disable it completely. To do this, use the same method we discussed above, editing your site’s wp-config.php file. The only difference is that the value must be set to false to disable revisions entirely, rather than to a number to limit them.
If you don’t feel comfortable editing your wp-config.php file, you can also disable revisions in WordPress using a lightweight plugin like Disable Post Revision. After installing and activating this tool, you can access it by going to Settings > Writing in your WordPress dashboard:

So, select the post types you want to disable revisions and save your changes. That’s it!
How to Limit the Number of Revisions WordPress Keeps
Disabling revisions entirely removes a genuinely useful safety net: the ability to recover from an accidental edit or compare how a piece of content has evolved. For most websites, limiting the number of revisions kept per post, rather than turning the feature off completely, is the better approach. This is the method this article’s introduction promises but does not actually show, so here it is in full.
Setting a revision limit via wp-config.php
Open your site’s wp-config.php file using your hosting file manager or an SFTP client. Look for the line that begins with /* That's all, stop editing! Happy publishing. */ and add the following line directly above it:
define('WP_POST_REVISIONS', 5);
This tells WordPress to keep only the 5 most recent revisions for each post or page. Once a sixth revision is created, the oldest one is automatically deleted. You can set this number to whatever fits your editorial workflow. A small number like 3 to 5 is reasonable for most sites. A content-heavy site with a multi-person editorial process that benefits from a longer audit trail might prefer 10 to 15.
This single line, set once, prevents the unlimited buildup problem described earlier in this article for every future revision, without requiring any ongoing manual cleanup.
The three possible values for WP_POST_REVISIONS
To avoid confusion between disabling, limiting, and the default behavior, here is the complete picture of what each value does.
define('WP_POST_REVISIONS', true); is the default behavior if no line is set at all. WordPress keeps an unlimited number of revisions per post.
define('WP_POST_REVISIONS', false); disables the revisions feature entirely. No new revisions will be created, and any existing revisions remain in the database until manually removed.
define('WP_POST_REVISIONS', 5); (or any whole number) limits the number of revisions kept per post to that number, automatically deleting the oldest revision once the limit is exceeded.
A related setting: the autosave interval
WordPress also autosaves your work while you are actively editing, separate from the revision created when you click Save Draft, Publish, or Update. By default, this autosave happens every 60 seconds. If you want to reduce how often autosaves occur (which reduces overall database writes, though autosaves are typically overwritten rather than accumulated like revisions), you can add this line alongside the revisions setting:
define('AUTOSAVE_INTERVAL', 120);
This changes the autosave interval to every 120 seconds (2 minutes) instead of the default 60. This is a minor optimization compared to setting a revision limit, but worth knowing about if you are already editing wp-config.php for revision settings.
So, how to revert to an older revision in WordPress
And sometimes you may want to undo changes made in WordPress. When that happens, how does WordPress makes it quick and easy?
By default, WordPress updates as a sequential post or page. So however, if you want to view or compare non-sequential changes, you can select the Compare any: two changes option at the top of the screen.
The option to switch to WordPress
So, then select the version you want to compare with. Then, whenever you’re done viewing and comparing more, you can restore a version by clicking Restore this version.
Reverting to an old revision in WordPress.
You click the button next to the revisions to automatically match the version you are comparing against – that revision screen in the column.
How to activate WordPress
Normally, WordPress tasks are enabled by default. However, make your hosting provider or process used to install WordPress; this feature may be disabled. It is also that you or someone else on your team has activated it.
If you want to enable the control in WordPress, you can undo changes WordPress manually enable it by editing the wpconfig.php file at the root of your website and can do this via the Secure File Transfer Protocol (SFTP) client. If your host uses cPanel instead of the Kinsta user, you can use the file manager tool.
After locating and opening the file, look for the following line of code:
define(‘WP_POST_REVISIONS’, false);
Change the false value to true.
If there is no line like this, it goes above, saying “ABSPATH” and “/* That’s all, stop editing! Happy publishing. */”:
define(‘WP_POST_REVISIONS’, true);

Disable revisions and save your changes. That’s it!
How to Optimize the Revision Database in WordPress
So, the longer you run your website, the more revisions you may have stored in your database. But, of course, if you spend years updating and editing content, you’ll accumulate a lot of revisions.
So, for example, if you have an older site, it’s not uncommon to have 100+ revisions on older or frequently updated pages. Let’s say you have 800 pages and posts on your site. If each has 100 revisions, that equates to over 80,000 entries in your database. It is a common problem in WooCommerce stores as well.
This buildup can happen quickly and occurs behind the scenes. Fortunately, in addition to completely disabling revisions, you can use a few methods to optimize your WordPress revisions. These include:
How to undo changes and remove revisions from old posts in WordPress
So, this section describes two methods you can use to permanently delete old post revisions from your WordPress site database. If you are familiar with (and are familiar with) SQL queries, you can use the first method. However, if you prefer to use a plugin, use the second method.
Method 1: Use SQL to delete existing post revisions
Clearing existing revisions from your database through SQL does not require installing a plugin, which appeals to site owners who specifically want to avoid adding more software than necessary. Follow these steps carefully, since this method directly modifies your database.
Before running any query, back up your database. This is not optional. Most hosting control panels include a one-click database backup tool, or you can use a plugin like UpdraftPlus to create a backup specifically before this kind of change.
To run the query, log in to your hosting account’s cPanel and open phpMyAdmin. In the left navigation, click on your WordPress database, then click the SQL tab.
Enter the following query, replacing wp_ with your site’s actual database table prefix if it has been customized (you can find your prefix in your wp-config.php file under $table_prefix):
sql
DELETE FROM wp_posts WHERE post_type = "revision";
This is the correct query. Note specifically that the value is “revision,” not “review.” This single word is the difference between safely clearing your revision history and accidentally deleting an entirely different category of content if your site happens to use a custom post type with a similar name.
Click Go to run the query. WordPress will not regenerate the deleted revisions, but new revisions will be created normally going forward based on whatever WP_POST_REVISIONS setting you have configured.
A more thorough version of this cleanup, which also removes orphaned metadata left behind in the wp_postmeta table after revisions are deleted, is:
sql
DELETE a,b FROM wp_posts a
LEFT JOIN wp_postmeta b ON (a.ID = b.post_id)
WHERE a.post_type = "revision";
This version removes both the revision rows and their associated metadata in a single query, leaving a cleaner database than deleting from wp_posts alone.
For developers comfortable with WP-CLI, the command-line equivalent avoids direct SQL entirely and is considered safer by many WordPress developers because it uses WordPress’s own functions rather than a raw database query:
wp post delete $(wp post list --post_type='revision' --format=ids) --force
This command retrieves the IDs of all revision posts and deletes them using WordPress’s built-in deletion process, which automatically handles related metadata cleanup.


Method 2: Delete old post revisions using a WordPress plugin
While it is possible to undo changes and delete post revisions from your WordPress site by running a single SQL query, you may find installing the plugin easier and letting it do all the work. This may be because the plugin provides additional benefits (database maintenance, removal of unnecessary files, etc.) or simply because you are not familiar with programming.
Whatever the reason, you can use a variety of plugins to delete old post revisions. Something you might consider is WP-Optimize.
So, although this plugin offers a premium version with advanced features, you can download it for free and use it to remove older versions. WP-Optimize is a complete plugin that allows you to optimize your WordPress database. You can use it not only for removing revisions but also for important maintenance tasks such as image compression and caching.
And so once the plugin is installed and activated, it will add a WP-Optimize menu item to your WordPress dashboard. So, for example, you can navigate to WP-Optimize > Database to delete post revisions.
Under Optimization, you can check the box next to Remove all post revisions and click the Run Optimization button:

So, you can delete the plugin or disable it when you are done with this process. And then, you don’t have to worry about taking up unnecessary space in your WordPress database.
Other plugin options worth knowing about
- WP-Optimize is a solid choice and the one this article recommends, but it is not the only option, and knowing the alternatives helps if WP-Optimize does not fit your specific setup.
- WP Revisions Control (mentioned in this article’s conclusion but not previously explained) is a lightweight, free plugin focused specifically on revisions rather than broader database optimization. It lets you set different revision limits for different post types directly through a settings page, without needing to edit wp-config.php at all. This is a good fit if you want post-type-specific control, for example, keeping more revisions for your blog posts than for your product pages, which the wp-config.php method alone cannot do.
- Advanced Database Cleaner is another option that, like WP-Optimize, covers broader database maintenance beyond just revisions, including the cleanup of orphaned postmeta, expired transients, and spam comments alongside revision management.
For most sites, either setting a revision limit through wp-config.php (covered earlier in this guide) combined with an occasional one-time cleanup using WP-Optimize or the SQL method, or installing WP Revisions Control for ongoing, granular per-post-type management, will solve the database bloat problem completely.
Frequently Asked Questions About WordPress Revisions
There is no single correct number, but a commonly recommended range for most websites is 5 to 10 revisions per post. This provides enough history to recover from a mistaken edit or compare recent changes without allowing unlimited buildup over the life of a long-running site. Sites with a formal multi-editor review process, where tracking a longer history of who changed what is valuable for accountability, may prefer to keep more, in the range of 15 to 20. Setting this through the WP_POST_REVISIONS constant in wp-config.php, as described earlier in this guide, applies the limit automatically going forward.
Revisions themselves do not directly slow down the page a visitor sees, since revision data is not loaded on the public-facing version of a post or page. However, an excessively large wp_posts table, bloated by years of unmanaged revisions, can slow down database queries across your site, including the queries that load content for your visitors and the queries your WordPress dashboard runs when you are editing content. The practical effect tends to be more noticeable for site owners working in the WordPress admin (slower page loads when editing) than for visitors browsing the public site, though severely bloated databases can affect both.
No. Once a revision is deleted, whether through the disable revisions setting, a WP_POST_REVISIONS limit removing older entries, or a manual cleanup using SQL or a plugin, that specific saved version cannot be recovered unless you have a separate site backup that includes it. This is the most important reason to back up your database before running any cleanup method described in this guide, and why many WordPress professionals recommend limiting rather than fully disabling revisions, since a limited revision history still provides recent recovery options.
WordPress only creates a revision after a post or page has been saved at least twice, once at initial creation or first draft save, and again on any subsequent save, update, or publish action. A brand-new post that has only been saved once will not yet show any entries on the Revisions screen. Additionally, if your site has WP_POST_REVISIONS set to false, or if a caching or optimization plugin has revisions disabled as part of its configuration, no revisions will be created for any content regardless of how many times it is saved.
No. The undo and redo buttons (and Ctrl+Z / Ctrl+Y keyboard shortcuts) in the WordPress block editor operate on your current, unsaved editing session and are entirely separate from the revisions feature. Revisions are saved versions of your content created when you save, update, or publish, while undo and redo affect changes within your current editing session before you save. Disabling or limiting revisions through WP_POST_REVISIONS has no effect on the editor’s undo and redo functionality.
Wrapping It Up
WordPress revisions are a genuinely valuable safety net, protecting your work from accidental browser closures, power outages, and editing mistakes, while also giving editorial teams a clear record of who changed what and when. The tradeoff is database growth, which becomes a real performance concern if left completely unmanaged over the life of an active site.
The most balanced approach for most websites is setting a reasonable revision limit through the WP_POST_REVISIONS constant in wp-config.php, somewhere in the 5 to 10 range, rather than disabling the feature entirely. This keeps recent recovery options available while preventing unlimited buildup. For sites that already have years of accumulated revisions, a one-time cleanup using WP-Optimize, the corrected SQL method covered in this guide, or WP Revisions Control’s per-post-type settings will bring an existing database back to a healthy size.
Whichever method you choose, back up your database first. Revision data cannot be recovered once deleted unless a separate backup exists.
If you are managing a content-heavy site where database performance affects more than just revisions, the guide to web hosting bandwidth and what affects your site’s performance covers related infrastructure considerations. And if your team manages content through a structured editorial process, our guide on managing your editorial workflow in WordPress covers how revision history fits into a broader content review and approval process.
Infographic
