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)




![Temper those Fiery Particles [6]](http://exper.3drecursions.com/apo/temper_those_fiery_particles_6_tmb.jpg)
![Eight-fold Irradiation [Base]](http://exper.3drecursions.com/apo/eight-fold_irradiation__base_tmb.jpg)



11 October 2008 at 21:46
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 14:02
Very interesting, thank you.
29 October 2008 at 16:32
Thanks your message has very much helped me:)
22 November 2008 at 18:52
This is so cool! Thank you for all!
Can you explain how the plug-in works please?
29 November 2008 at 09:58
Hi Hoang,
sorry for the long delay.
It simply disables the WP’s AutoSave function.
Take a look here too: Disable Revisions and Autosave plugins
18 February 2009 at 08:33
爱茶网为福建茶商与全国茶商提供茶叶批发,茶叶销售的平台,本站为免费申请会员,免费发布茶叶信息,提供全面详细的茶资讯.
10 April 2009 at 21:42
Thanks for sharing…..
13 June 2009 at 18:33
The best information i have found exactly here. Keep going Thank you
23 July 2009 at 14:31
tks for the effort you put in here I appreciate it!
31 August 2009 at 01:42
Nice write up…usually I never reply to these thing but this time I will,Thanks for the great info.