WordPress revisions is a core feature that stores every saved or updated versions of posts, pages, and other post types. The system lets you see the edits and changes made. It uses the comparison method as you’ll be viewing two versions of the same post.
You can also restore a revision if you ever need to. Read on to know how you can do so, as well as ways to limit your revisions and how you can delete or disable them.
How to Restore a WordPress Revision
If you’re using the block editor, you can find revisions at the editor sidebar.
While in the classic editor, it’s found at the top-right Publish widget.
To restore a previous revision, follow the guide below:
1. Click on the Revisions or Browse button.
2. Compare any two revisions of your post by dragging the slider located at the top bar.
3. Content that is highlighted in red means it was deleted, while green highlights indicate newly added content.
4. Press the Restore This Revision button once you’ve found the needed version.
How to Delete Older Revisions
Every time you save a WordPress post or page, a revision is kept in the database. That excludes the Autosave function that happens every two minutes.
If you have a large WordPress site with lots of lengthy content revisions, you might want or need to make the database lighter.
You can delete older revisions of published posts. Make sure that you’ve backed up your data just in case.
- From your WordPress dashboard, navigate to Plugins -> Add New.
- Search for the plugin of your choice, then press the Install button.
- Activate it.
You will see a Purge Revisions option at the bottom of your post editor or on the plugin’s Settings page.
It’s also possible to remove revisions manually by running an SQL query in phpMyAdmin. But, it can be very risky, especially for beginners, as it requires technical knowledge.
How to Limit the Number of Revisions
Storing revisions in your database will take up bandwidth, which is one of your web hosting recourses.
To avoid storing too many revisions in your database, you can also limit its number by editing the wp-config.php file.
You can access it in the root directory of your WordPress installation via your hosting’s file manager or an FTP Client.
In the wp-config.php file:
1. Add the following code snippet:
define( 'WP_POST_REVISIONS', 5 );
5 is the maximum number of revisions you want WordPress to store. You can edit it based on your needs.
2. Save the changes.
Configuring the number of revisions can also be done through the WP Revisions Control plugin.
How to Completely Disable Revisions in WordPress
Follow the same steps above if you want WordPress to stop storing revisions in your database. But, instead of a number, write false on the code snippet.
define( 'WP_POST_REVISIONS', false );
Post revisions is a useful WordPress core feature that lets you look back at the edits made to your posts or pages, and restore the version you need.
Though there are no direct solutions to limit, delete, or disable revisions, you can still configure them with no hassle by following the guides mentioned above.