Adjust WordPress Autosave or Disable It Completely

These are methods that disable or delay the WordPress autosave functions. The disabling plugin works with versions 2.3 through 2.7 (confirmed with 2.7) while the delay configuration works with 2.5 and later.

To Disable

Copy this text to a text file, name it whatever you want (using the .php extension, of course) and upload it to your WordPress plugin directory. Activate it and it works immediately, but you need to clear your browser cache:

<?php
/*
Plugin Name: Disable Autosave
*/
function disable_autosave() {
wp_deregister_script('autosave');
}
add_action( 'wp_print_scripts', 'disable_autosave' );
?>

If the copy-n-paste routine is too much work, I found a similar plugin all zipped up at http://samm.dreamhosters.com/wordpress/plugins/ after I wrote the above. The only real difference, that I can see, is the addition of "<!– disable-autosave.php plugin_deregister_autosave() –>" in the source.

To Delay

Hidden away in the "wp-settings.php" file for version 2.5.1 (I don't know if it was in 2.5), is this little snippet:

/**
* It is possible to define this in wp-config.php
* @since 2.5.0
*/
if ( !defined( 'AUTOSAVE_INTERVAL' ) )
define( 'AUTOSAVE_INTERVAL', 60 );

All you have to do is add define('AUTOSAVE_INTERVAL', 60) (changing to the 60 seconds to whatever amount of seconds you want) to your existing wp-config.php file below all the rest of the define settings at the top of the file.

My Choice

My choice is to disable it completely. I don't like the autosave function kicking in when I'm halfway through writing the post title because then I have to edit the slug as well.

Update 2008-12-17

I upraded two blogs to version 2.7 and created a new blog with 2.7. This method worked for all of them. I have reports that it doesn't work for some people, but I can't find a reason why. I have better things to do with my time right now than looking for an answer, like finding top wordpress plugins.


Similar Posts:

52 Comments

  1. Kahuna says:

    Hi,

    I am having a problem related to word count in WP
    paste in 6239 words (tried Michaels suggestion, even reformatted the whole doucument.

    The word count in the editor reads 6239

    Then I hit publish, it goes down to 1836 (or similar)

    I might go in to the DB and see if I can manually adjust the character limit for the field.(tried that there is no conditionals in the DB)

    But has anyone come across a solve?

    Thanks

    Kahuna

  2. Those of you who aren't satisfied with it just upgrade. And personally, i don't think it's that all important.
    Jack from buy to let repayment mortgage


  3. I don't like the autosave function kicking in when I'm halfway through writing the post title because then I have to edit the slug as well.

    That is exactly why I sometimes hate autosaving^^ Thank you so much for this post, I never knew that it can be disabled completely,,

  4. great plugin, works good for me.

  5. [...] soluzione è utilizzare i plugin: "Revision Control" e "Disable Autosave" Io ho utilizzato questa strada, e il problema nel 99% dei casi è stato [...]