post-page

Decreasing WP Auto Save Time

7
responses
by
 
on
January 18th, 2011
in
LinkyLoo

How many times has the auto save feature in WordPress saved your butt? By default, WordPress auto saves posts every 60 seconds. Paul Maloney of WPZine.com has a snippet of code that you can add to your WPConfig file to decrease that time to increase peace of mind. If you don’t want to use the auto save feature, think about increasing the time to a week instead of disabling it completely.

While reading about this tip by Paul, I started to wonder if Post Revisions were tied to auto saves because if they were, decreasing the auto save time would substantially increase the number of post revisions which in turn, would substantially increase the size of the database over time. After performing some simple tests, I discovered that auto saves are NOT tied to Post Revisions. Unlike Post Revisions, there is only one auto save that is continuously over written. Also, Post Revisions are only created after the user saves the post either as a draft or an edit to an existing post. Just some food for thought.

heading
7
Responses

 

Comments

  1. Vincent Parker (3 comments.) says:

    Woot! Just what I was looking for!

    Thanks for posting this, Jeff, and thanks go out to Paul for showing us how to shorten (or lengthen) the autosave time.

    Today I was writing a post and really got into the groove. When… the power flickered. Noooo!

    Of course this caused my power surge protector to shut off and even though 60 seconds doesn’t seem like a lot of time, when the words are flowing that can mean a good deal.

    Anyway, I was looking for a place to vent and ran across your post. So, maybe I’ll save my bellyaching for later and work on plugging this code in.

    Thanks again, both of you. :)

    Vincent Parker

  2. Ulysses (15 comments.) says:

    Good idea, although the auto save has probably has bailed me out once or twice before. Having the ability to set your own value is nice. The question is, what’s the appropriate time? 5 mins? That may be too long? 2 or 3 mins might be ok for most.

  3. Ben (6 comments.) says:

    I love it how just as often as you need 50 lines that takes hours to develop, test and tweak a simple one line constant definition does the same thing!

    Glad they are not tied together, I have limited the number of post revisions as well (if anyone is interested) in the same fashion:

    define(‘WP_POST_REVISIONS’, 4 );

    ensures that wordpress will never hold more than 4 revisions for a post.

  4. Destination Infinity (7 comments.) says:

    Once I was writing, and my computer automatically restarted! So, I wanted to check if auto save had saved my post. It had, but I didn’t know where to get it from! Can someone help me on this.

  5. garce (2 comments.) says:

    I’ve been doing this for awhile. I have WP autosave set to save every five minutes and keep three revisions. I admit it was incredibly annoying to have a huge list of revisions, and I was tempted to turn it off completely. Autosave HAS saved my bacon on a couple of occasions, though.

    Having too big of an interval renders it useless, but five minutes works pretty good for me.

  6. tom g (3 comments.) says:

    They should put a setting for time, off-on, and number to hold in the admin area. We could set there instead of going into code. I can do bothe ways but some might not like to do the code thing.



Obviously Powered by WordPress. © 2003-2013

page counter
css.php