Many times you are writing a post and you realize that you have made a mistake, but you have already saved the changes, and you want to die. Can you undo changes in WordPress?
You start to speculate with time travel so that you can return to that minute in which you gave it to save. Well, time travel is not one of the features of WordPress, but it has an option that is the closest thing.
We’re talking about the revisions, a method to return to one of the changes you made on that fateful minute.
WordPress Post Revisions
WordPress has a built in feature that auto-saves posts as a review for each post or page you are writing. For each draft you are working on, WordPress automatically saves a temporary review. This type of review is called automatic saving.
This automatic save is done every 60 seconds. This works both for WordPress posts and pages.
The Post Revision functionality is perfect for editors of posts with multiple authors. It allows the editor to see exactly which author made which changes, when and where.
Steps to Undo Changes
You can access this functionality, by logging in to your backend, go to All publications and choose the publication for which you want to see the reviews.
Once in the post you want to review, you can find that on the right-hand side of your post editor screen. Clicking on the Revisions will take you to post revisions screen.
Changes made in each review will be highlighted in green and pink colors. There is a scroll at the top that you can use to display different revisions of the post. On the top, you can see the user who made these changes, time, and other information.
If you have more than 2 revisions, you can move the scrolling bar at the top of current review to see the changes made.
A red background indicates that something was deleted, while a green background indicates that something new was added.
You can use the next and previous buttons to move around revisions.
When you have found the version you want to use and have decided what changes in your WordPress publication you want to undo, you can click Restore this review or Restore this autosave. This will be your current publication version and you can save it as a draft.
How to limit and delete post revisions?
You may be concerned about the amount of space that post reviews could take up and that could slow down your site. Don’t worry because it doesn’t work this way. WordPress searches for revisions only when you are browsing and then skips them while making calls to the database in the front-end.
WordPress allows you to control how many revisions you want to keep for an article. To limit post revisions, simply add this code to your WordPress site’s wp-config.php file.
define( 'WP_POST_REVISIONS', n );
“n” will be the number of revisions you want.
Go to the plugins section and install and activate the “WP-Optimize” plugin. Once activated you need to go to WP-Optimize and then click on Database. Then check the box next to “Clean all post revisions” and click the “Run optimization” button. This will delete all the post revision from your website.