How To Store Multiple Autosaves

How To Store Multiple Autosaves

How To Store Multiple AutosavesFor most people, the autosave feature introduced way back in WordPress 2.1 was a welcome addition.

By default, WordPress will autosave your post or page every 60 seconds. For the most part, it works perfectly, and provides peace of mind for anyone who has experienced a browser crash before (that’s everyone).

The autosave feature is entirely separate to any drafts that you save via the Save Draft button. Theoretically, you can save as many drafts as you like. However, each subsequent autosave overwrites the previous one.

If you are a cautious type of person and would like WordPress to store multiple autosaves, it only takes a quick addition to your wp-config.php file:

FREE EBOOK
Your step-by-step roadmap to a profitable web dev business. From landing more clients to scaling like crazy.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

define('WP_POST_REVISIONS', 5);

That’s all it takes! The above addition will instruct WordPress to store five autosaves.

If you want to adjust the time period between each save, that is easily done too:

define('AUTOSAVE_INTERVAL', 30 );

Just input your desired interval in seconds, and you’re done!

If you don’t like the autosave feature, there is also an easy way to prevent it altogether. Just add this to your wp-config.php file:

define('WP_POST_REVISIONS', false );

Creative Commons photo courtesy of 401K