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.



Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting


Custom Search

New Articles

Incoming Search Terms for the Article

wordpress disable autosave - autosave in wordpress 2.6 - content auto save using php - wordpress revisions limit - wordpress page revisions limit - interval auto save gmail - wordpress post numbers - wordpress copy a post in a page - how to delete auto save on iphone - wordpress delete autosave - wordpress auto saving draft entry ids - in wordpress where are the Posts stored - wordpress accidentally delete post - where does wordpress store posts - autosave revision wordpress - wordpress were are posts stored - wordpress count visit to each post - gmail autosave where store -