Disable WordPress AutoSave and Revisions

Disable WordPress AutoSave and Revisions

 

Since version 2.6, WordPress has many features useful and very impressive. Especially from version 2.7, WordPress became a very powerful blog platform.  But along with the advantages, it’s accompanied by 2 features that many bloggers do not satisfy: Autosave and Revisions.

Revisions simply save the posts many times: WP will add a new row in the DB every time an user changes a post; this could be good when the blog is maintained by different editors, because 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 worse to me.

So what is the solution to solve the problem?

 

1. Stop the Revisions scheme

To turn off Revisions, edit the wp-config.php file and adding 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’;

2. Stop the AutoSave

Some users said that AutoSave doesn’t create a revision but some others have report 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.

It’s simple to solve the problem by a plugin.

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

Just copy above code and paste it in to a blank document and save it as disable-autosave.php. Then upload it to WordPress plugins directory on your web host and active it. I will automatically disable the Autosave function of WordPress.

 

ad1 Disable WordPress AutoSave and Revisions

Related Posts

  •  Disable WordPress AutoSave and Revisions

    A picture is worth a thousand words. Whether you are designing or customizing a premium wordpress theme, or looking for inspiration, your first impression is created ...

  •  Disable WordPress AutoSave and Revisions

    Hostgator is having a great discount for new web hosting clients on Cyber Monday, after having an 80% discount on hosting plans this Black Friday. The Hostgator Coupon ...

  •  Disable WordPress AutoSave and Revisions

    Google Analytics allows you to export any of your reports into PDF, comma separated values (CSV), tab separated values (TSV), or Extensible Markup Language (XML). You ca ...


Category : -

Leave a Reply