Knowing how to use WordPress revisions to restore old content is one of the most valuable skills any site owner or editor can have. Whether you accidentally deleted a paragraph, a client changed their mind, or a failed update corrupted your page, WordPress revisions act as a built-in time machine that can save the day. In this comprehensive guide, you will learn exactly how the revision system works, how to browse and compare saved versions, how to restore previous content, and how to fine-tune revision settings for optimal performance.
What Are WordPress Revisions and How Do They Work?
WordPress revisions are automatic snapshots of your posts, pages, and custom post types that WordPress saves every time you click Save Draft, Publish, or Update. They are also created at regular intervals through a feature called autosave. Each snapshot captures the full content of the post at that moment, giving you a complete history of changes.
Where Are Revisions Stored?
Revisions are stored directly in your WordPress database inside the wp_posts table. Each revision is saved as a child post with a post_type value of revision. This means every revision carries the full post content, title, and excerpt — which is why large numbers of revisions can increase your database size over time.
Autosave vs. Manual Revisions
WordPress distinguishes between two types of saved states:
- Autosave: WordPress automatically saves a draft of your work every 60 seconds in the background. Only the most recent autosave is kept per post.
- Manual revisions: Created every time you explicitly save or update a post. By default, WordPress keeps an unlimited number of these unless you configure otherwise.
How to View and Compare WordPress Revisions
Before you restore any revision, it is important to know how to browse through the history and compare differences between versions. WordPress provides a built-in revision browser that makes this process straightforward.
Accessing the Revision Screen in the Classic Editor
- Open the post or page you want to review in the WordPress admin dashboard.
- In the Publish meta box on the right-hand side, locate the Revisions link (e.g., "5 Revisions").
- Click the link to open the revision browser.
- Use the slider at the top of the screen to move between saved versions.
- Review the color-coded diff: green highlights indicate added content, and red highlights indicate removed content.
Accessing the Revision Screen in the Block Editor (Gutenberg)
- Open the post or page in the Block Editor.
- Click the three-dot menu (Options) in the top-right corner of the editor toolbar.
- Select Plugins or look under the Document panel in the right sidebar.
- In the right sidebar, scroll down to find the Revisions section and click X Revisions.
- The revision browser will open, showing the same slider-based comparison view.
Understanding the Comparison View
The comparison view shows two panes side by side: the older version on the left and the newer version on the right. You can toggle the Compare any two revisions checkbox to select non-adjacent versions and compare them directly. This is particularly useful when you want to see how content has evolved over several editing sessions.
How to Restore a Previous Version of Your Content
Restoring a revision in WordPress is a simple process, but it helps to understand what happens when you do it. Restoring does not delete your current version permanently — it actually creates a new revision of your current content before replacing it, so you can always undo a restore if needed.
Step-by-Step: Restoring a Revision
- Navigate to the post or page you want to restore in your WordPress admin panel.
- Open the revision browser using the methods described in the previous section.
- Use the slider to locate the revision you want to restore. Pay attention to the date and time stamps shown above the slider.
- Review the highlighted differences carefully to confirm this is the version you want.
- Click the Restore This Revision button (or Restore This Autosave if you are viewing an autosave).
- WordPress will redirect you back to the post editor with the restored content loaded.
- Review the restored content in the editor to confirm everything looks correct.
- Click Update to publish the restored version, or Save Draft if you want to review it further before publishing.
What Gets Restored and What Doesn't
It is important to know the scope of a revision restore. WordPress revisions capture the following:
- Post title
- Post content (body text, blocks, shortcodes)
- Post excerpt
Revisions do not capture changes to:
- Featured images
- Categories and tags
- Custom fields (in most cases)
- Plugin-specific meta data
- Page templates or parent page settings
Always double-check these elements after restoring a revision to ensure your post settings are correct.
Configuring WordPress Revision Settings
By default, WordPress stores an unlimited number of revisions. While this gives you maximum flexibility for recovery, it can bloat your database significantly on busy sites with frequently updated content. Fortunately, you can control this behavior through your wp-config.php file or by using WP-CLI.
Limiting or Disabling Revisions via wp-config.php
Open your wp-config.php file (located in the root of your WordPress installation) and add one of the following lines before the /* That's all, stop editing! */ comment:
// Keep only the last 5 revisions per post
define( 'WP_POST_REVISIONS', 5 );
// Disable revisions entirely (not recommended for production sites)
define( 'WP_POST_REVISIONS', false );
// Set autosave interval to 120 seconds instead of the default 60
define( 'AUTOSAVE_INTERVAL', 120 );
Setting WP_POST_REVISIONS to a specific integer like 5 means WordPress will keep only the five most recent revisions and automatically discard older ones. This is a sensible balance between recovery capability and database efficiency for most websites.
Managing Revisions with WP-CLI
If you have command-line access to your server, WP-CLI provides powerful tools for managing revisions in bulk. This is particularly useful for cleaning up a database that already contains thousands of old revisions.
# List all revisions in the database
wp post list --post_type='revision' --format=table
# Delete all existing revisions (use with caution)
wp post delete $(wp post list --post_type='revision' --format=ids) --force
# Count total revisions currently stored
wp post list --post_type='revision' --format=count
Always create a full database backup before running bulk delete commands. Use a tool like WP-CLI's export command or your hosting provider's backup system before proceeding.
Using Plugins to Manage Revisions
If you prefer a visual interface for managing revisions, several plugins extend WordPress's built-in capabilities:
- WP Revisions Control: Lets you set per-post-type revision limits directly from the WordPress admin settings screen.
- Revision Control: Another lightweight option for capping revisions site-wide or per post type.
- Akeeba Backup / UpdraftPlus: While primarily backup tools, they help you maintain full-site snapshots as a complement to WordPress's native revision system.
Best Practices for Using WordPress Revisions Effectively
Understanding the mechanics of revisions is only half the battle. Using them strategically will help you maintain a clean workflow and recover from mistakes quickly and confidently.
Establish a Sensible Revision Limit
For most websites, keeping between 5 and 10 revisions per post strikes the right balance. News sites or high-traffic blogs with hundreds of posts benefit most from a lower cap, while smaller sites with fewer, longer-form articles can afford to keep more history. Set your limit in wp-config.php as shown above and revisit it periodically as your site grows.
Always Preview Before You Restore
Never restore a revision blindly. Always use the comparison view to carefully read through the differences. Pay special attention to any shortcodes, block markup, or HTML that may have changed, since restoring an older revision on a site that has since installed new plugins or switched themes could result in broken content if the older markup relies on elements that no longer exist.
Combine Revisions with Regular Backups
Revisions are not a substitute for proper backups. They only cover content changes and do not protect against database corruption, server failures, or accidental post deletion (which removes the post and all its revisions permanently). Use a reliable backup plugin alongside the native revision system for comprehensive protection.
Document Major Content Changes Manually
For large collaborative sites, consider maintaining a simple editorial changelog. Each time a significant update is made, note the date, author, and nature of the change in a private note or a custom field. This makes it much easier to pinpoint which revision you need to restore without having to scroll through dozens of minor autosaves.
Troubleshooting Common WordPress Revision Issues
Even with a clear understanding of how revisions work, you may occasionally run into problems. Here are the most common issues and how to resolve them.
Revisions Are Not Showing Up
If you open a post and see no revisions listed, there are several possible causes:
- Revisions are disabled: Check your
wp-config.phpfile fordefine( 'WP_POST_REVISIONS', false );and remove or change it. - Custom post type not supported: Revisions must be explicitly enabled for custom post types. Check that the post type is registered with
'supports' => array( 'revisions' )in your theme or plugin code. - Post was never updated after the initial publish: A post that was written and published in a single action may have only one revision or none at all.
The Restore Button Is Missing
If you can see the revision browser but the Restore This Revision button does not appear, it is most likely a user permissions issue. Only users with the edit_post capability for that specific post can restore revisions. Check the user role and ensure the account has the necessary permissions assigned.
Restored Content Looks Broken
If restored content displays incorrectly on the front end — especially on block editor posts — it may be because an older revision contains classic editor markup or outdated block syntax. In this case, switch to the Code Editor view in Gutenberg (Shift + Alt + Cmd/Ctrl + M) and carefully clean up the HTML markup before republishing.
Frequently Asked Questions
How many revisions does WordPress save by default?
By default, WordPress saves an unlimited number of revisions for each post or page. Every time you save, update, or publish content, a new revision is created and stored in the database. You can limit this number by adding define( 'WP_POST_REVISIONS', 5 ); to your wp-config.php file, replacing 5 with your preferred maximum.
Can I restore a revision after permanently deleting a post?
No. When you permanently delete a post from the WordPress trash, all of its associated revisions are deleted from the database at the same time. The only way to recover content after permanent deletion is from a full database backup taken before the deletion occurred. This is why regular backups are essential alongside native revisions.
Do WordPress revisions slow down my website?
Revisions themselves do not directly slow down your website's front-end performance, because they are stored in the database and not loaded on public-facing pages. However, a very large number of revisions can increase the size of your database, which may slow down certain database queries and backup operations over time. Limiting revisions to a sensible number keeps your database lean and efficient.
Are revisions available for custom post types?
Yes, but only if the custom post type was registered with revision support enabled. When registering a custom post type, the developer must include 'revisions' in the supports array. If you are using a theme or plugin that registers custom post types and revisions are not available, contact the developer or add revision support via a small code snippet in your theme's functions.php file.
Managing content changes in WordPress becomes far less stressful once you master the revisions system — from viewing history and comparing diffs to restoring previous versions and tuning your revision settings for database efficiency. For those who want an even faster way to handle these kinds of WordPress tasks, WP AI Agent is an innovative tool that lets you manage, troubleshoot, and configure your WordPress site through simple natural-language AI chat, so you can handle revision settings, database cleanup, and much more without ever needing to dig through files or memorize commands.