WordPress revisions and autosave problem
24th July 2008
Edit 25 July 2008
I’ve prepared three plugins that can disable Revisions, Autosave or both of them at the same time.
Access here: Disable Revisions and Autosave plugins
I’ve recently updated my blog to the last WordPress 2.6 version.
The new version is very bold and I want generally suggest everyone to upgrade to it.
But I’ve also got to say that all the new version goods are mined by a major new introduced feature, a big problem to me and some other users out there: I’m talking about the Revisions and the new AutoSave function.
Revisions simply save the posts many times: WP will add a new row in the DB every time an user change a post; this could be good when the blog is maintained by different editors, cos they can track the various versions/revisions of every post, but it’s actually totally resources wasting to all the single editors ones.
AutoSave now create a second copy of the post that is stored and used to keep the post up-to-date when a subsequent AutoSave is executed on the same one. This is quite annoying too. I never liked much the AutoSave and the new implementation is even worser to me.
I’ve started roaming around the net looking for a solution.
I’ve found a couple of workarounds that can completely solve the problem when used at the same time.
STEP 1 - by me
I’ve found that clearing all the cookies relative to your Wp’s domain installation is always a good start when you make an update.
This is good too on 2.6 especially if you’re going to use the new SSL ones.
STEP 2 - Stop the Revisions scheme - Lester Chan article
To turn off the revisions edit the wp-config file adding this following code after the DB settings lines.
define(‘WP_POST_REVISIONS’, false);
You can also delete all post revisions by running this query in phpMyAdmin:
Be sure to backup your database first before performing any queries in phpMyAdmin.
DELETE FROM wp_posts WHERE post_type = ‘revision’;
STEP 3 - Stop the AutoSave - Untwisted Vortex article
Lester reports that AutoSave doesn’t create a revision.
This is not completely true cos some users (I’m on the same boat) have reported that one revision is created by AutoSave too; it’s actually not clear if this is a behavior resulting from a WP’s bug/problem or a particular provider’s systems configuration.
The solution is to create a plugin that stops the AutoSave function.
<?php
/*
Plugin Name: Disable Autosave
*/
function disable_autosave() {
wp_deregister_script('autosave');
}
add_action( 'wp_print_scripts', 'disable_autosave' );
?>
Select the above reported code, copy it and paste it into a new blank text document.
Save it as “disable-autosave.php”, upload it to the WP’s plugins directory and then activate the plugin.
I’ve also prepared the plugin version here: disable-autosave.zip (Right Click, Save As)








11 October 2008 at 9:46 pm
Hello.
“The birth took place at the couple’s home (just outside Oslo),” says the palace, adding mother and baby were both well.
Bye.
22 October 2008 at 2:02 pm
Very interesting, thank you.
29 October 2008 at 4:32 pm
Thanks your message has very much helped me:)