What is Revisions and How to Restore in WordPress?
Revisions is the feature in WordPress that saves the copy of your post or page content automatically whenever you hit “Save Draft”, “Publish” or “Update” button. This is a WordPress core function comes by default and can’t be deactivated in the admin dashboard front end. WordPress tracks the changes in Title, Author, Content and Excerpt either by autosave function or a manual save/update/publish action and generates revisions for each modified version.
How to View WordPress Revisions?
In order to view revisions, first you need to select “Revisions” check box available under “Screen Options” in editor screen.
Revisions option will be visible only if the post / page has a saved revision associated with it.
You can view all your revisions in the editor below your content under “Revisions” section. Each revisions will show the details of author name, date and time of modification including the autosaved version. Revisions option is also available besides the content under “Publish” section which shows the count and “Browse” option to view all your revisions.
Autosave is a different core feature of WordPress that saves the post / page content as a backup. The difference between autosave and revisions is that autosave creates only one database entry with the latest copy whereas each revision is stored in a database with unique id. The copy of autosave is also stored as a revision and hence you will be seeing a line indicating that the revision is an autosaved one.
Click on any revision’s link or the “Browse” link under “Publish” section to view the revisions. You have two options here:
Compare Any Two Revisions
Click the check box to compare any two copy of revisions. Move the slider to view different versions or use “Previous” or “Next” navigation buttons. The changes are highlighted in red and green color where red indicates deletion and green indicates addition.
Restore Revision / Autosave
Click on this button to replace existing content with the selected version of revision. If the selected revision is an autosaved one then the button will change to “Restore this Autosave” or else it will be showing as “Restore this Revision”.
How Revisions are Stored in WordPress?
WordPress considers each revision as an individual post and save it as a child of the parent post. Revisions are also stored in the same table “wp_post” where posts are stored. The post name of the revision follows the below nomenclature:
Regular revisions: Parent Post ID-Revision Number
Autosave revision: Parent Post ID-Autosave
Revisions are assigned with the post status as inherited and post type as revision.
Learn WordPress: Check out 300+ free WordPress tutorials.
Revisions – Uses and Issues
Revisions feature is very useful in some of the following scenarios:
- When a same post is modified by multiple authors.
- Restoring to previous revisions when you wrongly modified the content.
- Lost server connectivity or system crash during content modification (this is an autosaved version of revision).
But in reality most of the general users do not need these revisions since they always have an offline content which they just copy/paste in the live site. Moreover revisions cause one of the below issue and make it necessary to disable or restrict.
- Revisions will increase the database size.
- Database backup issue due to increased size.
- Conflicting with Custom Fields created by plugins.
- Cause slow loading of post editor.
It is common to make some typo mistakes and when you come back to the post for updating a typo, you will see a new revision generated for that typo change.
Who Can View the Revisions?
Users can view revisions in WordPress post / page editor based on the role assignment as below:
|Author||Posts authored by them|
|Contributor||Can’t see any revisions|
Revisions are not shown in the search engines and only retrieved from your database when WordPress editor is opened.