

- #Wordpress revisions how to#
- #Wordpress revisions code#
- #Wordpress revisions Offline#
- #Wordpress revisions free#
Users can view revisions in WordPress post / page editor based on the role assignment as below: Role

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. Conflicting with Custom Fields created by plugins.Database backup issue due to increased size.Revisions will increase the database size.Moreover revisions cause one of the below issue and make it necessary to disable or restrict.
#Wordpress revisions Offline#
#Wordpress revisions free#
Learn WordPress: Check out 500+ free WordPress tutorials. Revisions are assigned with the post status as inherited and post type as revision. Regular revisions: Parent Post ID-Revision NumberĪutosave revision: Parent Post ID-Autosave The post name of the revision follows the below nomenclature: Revisions are also stored in the same table “wp_post” where posts are stored. WordPress considers each revision as an individual post and save it as a child of the parent post. Related: Comparison of WordPress autosave and revisions. 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”. Let me know if you face any issue running this code.WordPress Revisions Options Restore Revision / AutosaveĬlick on this button to replace existing content with the selected version of revision. I hope this will help you optimize and customize your WordPress site further.
#Wordpress revisions code#
Add below code to wp-config.php file.ĭefine( 'EMPTY_TRASH_DAYS', 1 ) // Empty trash after 1 day Empty trash automatically after 1 day.🙂 function crunchify_delete_all_revisions () There are few more optimization you could do. This codebase will make sure that you have your DB cleanup right way. Please don’t execute query in MySQL editor as it may not delete related term metadata. This query will delete all revisions from your Database table. One option is to use Plugin which deletes revisions but I would just do the same task with simple code below. There are multiple ways to delete Post and Page revisions from your WordPress Database tables.
#Wordpress revisions how to#
} How to Delete WordPress Post Revisions? Remove_post_type_support('page', 'revisions') Remove_post_type_support('post', 'revisions') add_action('admin_init', 'crunchify_disable_revisions') This will disable revisions completely for post and pages. Just add below code to your theme’s functions.php file. Change WordPress post revisions to 3 only.ĭefine( 'WP_POST_REVISIONS', 3) // only allow 3 post revisionsĭefine( 'AUTOSAVE_INTERVAL', 120 ) // set default save interval to 2 mins How to Disable WordPress Post Revisions using functions.php change?.Open your site’s wp-config.php file and add below line at the very bottom of the file. How to disable autosave using wp-config.php change? At least try to optimize (fine tune) or completely disable it. Is it wise to delete post revisions and autosaves from database? On the right side, under Page/ Post Settings, look for Revisions. Click on the title of the post or page to edit the one you want to view revisions for. In later case, having revision of posts are simply not usable. To restore an earlier version of a page or post: In your Dashboard, go to Pages or Posts. We do have Crunchify Premium site and I would like to keep all revisions for tracking purpose but on main blog site, I think having so many revisions are not that helpful. Even though WordPress revisions are very useful, having it auto enabled without any fine tuning may store thousands of revisions in Database and may slow down your Database performance and eventually your Site/Blog. WordPress revision was introduced in WordPress 3.6 and it was a great addition. It will be retrieved from Database later on.

This is very useful in case you have unexpected system failure, power outage or more and want to retrieve your work later. Every time, when you save your draft either by autosave or manual, WordPress stores complete snapshot of your post or page data in Database. In WordPress revisions are records of each stored draft and published post data.
