How To Store Every Post Revisions on Each Auto-Save in WordPress with Limit on Versions Count
AutoSave feature has been added into WordPress core since version 2.1 to protect user from accidental lose of writing or draft when web browser crashes or tab been accidentally closed. AutoSave will auto save a copy of edited post or page every 60 seconds provided there is a change on the content in the editor.
However, there is only ever a maximum of one AutoSave version for any given post. New AutoSaves created will overwrite old AutoSaves. Beside, AutoSaves are stored as a special type of revision so that the auto saved with a more recent version of data does not overwrite actual published content, and is used to restore unsaved work only when necessary.
For webmaster who wants to take a post revision history tracking based on each and every AutoSave copy been made, there is an option that force WordPress to save each auto saved copy of post content also as a post revision, a feature introduced in WordPress 2.6.
To save and store a post or page as a revision version whenever AutoSave is triggered, add in the following line of code to wp-config.php configuration file:
define(’WP_POST_REVISIONS’, int);
where int is an integer bigger than 0 (0 represents false which disable post revisions storage). The integer number set will represent the limit of number of post revisions WordPress going to save and store per post or per page in database. Each AutoSave session will increase the revision count by 1 too. If the number of revisions already exceed the limit, oldest revisions are automatically deleted. Note that AutoSave will always have its own saved copy to reflect the most current changes.
Share and contribute or get technical support and help at My Digital Life Forums.
Related Articles
- Disable and Turn Off Post Revisions Tracking in WordPress 2.6 or Above
- How to Delete Existing WordPress Post Revisions Stored/Saved
- How to Change the Frequency or Interval WordPress Auto Saves An Editing Post or Page
- Retrieve and Get WordPress Post ID Outside the Loop as PHP Variable
- WordPress 2.6 with Change Revision Tracking Feature Available for Free Download
- Paginating or Split WordPress Post or Page with NextPage in WordPress Not Working
- Adding Extra More Fields to WordPress Write/Edit Post/Page Right Column
- Disable Auto Go To (Jump) To Read More Tag
- WordPress MySQL SQL Query Error in WPDB Class
- WordPress 2.3 Final Free Download
































