June 29, 2011 : IN Tips & Tricks

Disable Autosave in WordPress

I’ve always come up against problems with the autosave feature in WordPress especially when working on more complex builds where content has in the past had a tendency to just disappear.

Rather than trying to debug these issues myself and throwing myself into a blackhole of autosave hell, I’ve just started to (in effect) disable the autosave feature completely. My rationale being that the update button is more than sufficient when wanting to save something that we know we’ve updated.

Below is a quick step by step on how to disable autosave for WordPress version 3 and above. I could be wrong on this but I’m pretty sure that the definition for these settings were held in other files previous to version 3 of WordPress.

Here’s how to do it:

1. Open up ‘wp-includes/default-constants.php’ in your local WordPress file copy.
2. Looks for the following line of code:

if ( !defined( 'AUTOSAVE_INTERVAL' ) )
		define( 'AUTOSAVE_INTERVAL', 60 );

It should be around line 255.
3. Change the 60 following the AUTOSAVE_INTERVAL to a much larger number. The 60 represents 60 seconds. There are 3600 seconds in an hour. So if you changed this to 36000 for example it would only attempt the autosave every 10 hours.
4. Save the file and upload.

Grab our RSS feed for more of the same ...

No Comments Yet, Care to leave one?

Add your comment