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 Articles:


This article is published as: Adjust WordPress Autosave or Disable It Completely

«
»

62 Responses to “Adjust WordPress Autosave or Disable It Completely”

Read below or add a comment...

  1. Thank you! This is a great solution. Why create a plugin and not just add to the wp-config.php in the theme?
    .-= My last blog: Crab Bird – My 4 year old's idea =-.

    • RT Cunningham says:

      The plugin part doesn't work in the wp-config.php file. Only changing the time parameter works there. I don't know why the WP folks just didn't make this an option in admin.

  2. Gaggo says:

    Hi there, you look like someone that has a clue about the autosave feature. I would like to call some javascript if the autosave was successfull. Do you know how I would Do this?

    I would be very happy for help!

    • RT Cunningham says:

      I'm sorry, I don't know enough about the underlying code to give you an answer. I'm sure it's doable, but I don't know how to do it.

  3. Thank you for the quick fix. I cannot understand why the WP developers don't just include an on / off button on the Dashboard for this.

    Peace,

    Karl A. Krogmann
    Window Replacement, Lake Geneva, WI recently posted..A Few Words From Jack Fagu, SpokesdogMy Profile

  4. absolutely great and simple solution instead edit the core. Thanks a lot for really simple solutions.

    regards.
    Jobingco
    home design ideas recently posted..Chic Italian Bathtub Zucchetti’s Morphing BathtubMy Profile

  5. Les Warren says:

    I tried out the plugin on a site I am running in version 3.0.5 and I had a problem with it interfering with another plugin. I found a solution and I don't know if it works in all themes, but what I did was added your plugin code to the functions.php file in my theme and it all seems to be working fine.
    Les Warren recently posted..Avoiding Spending More Than Necessary on a Web SiteMy Profile

  6. 1300 Number says:

    awesome! thanks for sharing. this is exactly what i need

  7. We use wordpress as our only platform for developing our websites and have asked my business partner to read this posting and adjust our sites accordingly. Thanks for taking the time and showing the actual code – helped a lot.
    Ej@DIY Greenhouse recently posted..Greenhouse GlazingMy Profile

  8. Tosh says:

    Thank you for this tip. I have a plugin that I have just put in random bits of code in, instead of having multiple plugins for just little things. This worked perfectly.
    Tosh recently posted..Ron V. Boswell uploaded a new avatarMy Profile

  9. Leon David says:

    I rather to have the Autosave function rather than lose the blog post work. You posted for the versions 2.3 to 2.7
    Would it work the same code for wordpress version 3.1
    Leon David recently posted..How to Lose Weight without Exercise – Four Proven TacticsMy Profile



Names containing keywords only may be deleted during moderation. If multiple names are used for the same website URL, those may also be deleted during moderation. Those retained will likely be changed to "John Doe" or "Jane Doe" as the name.

If you wish to leave anchored links within the comments -- you're allowed to leave one anchored link if you don't let a CommentLuv link appear

Leave A Comment...

*

Enable CommentLuv?