DigitCodes

Coding Notes


Follow @afsalrahim
  • PHP Codes
  • Web Design
    • CSS Tricks
  • WordPress
    • WordPress Tips
    • WordPress Themes
    • WordPress Plugins
  • Blogging
You are here: Home / Wordpress / Wordpress Codes / Disable WordPress Autosave and Revisions

Disable WordPress Autosave and Revisions

November 28, 2012 by Afsal Rahim Leave a Comment

Disable WordPress Autosave and Revisions

[adslot]

In this post we will discuss about,
How to disable the WordPress default Autosave and revisions functions and optimize your website website to run smoothly and have a clean and organized database ?

If you are using WordPress for writing your posts then you would have probably noticed that if you leave the posting screen and come back later to edit the post, you might see a notice on the top of your screen informing you that there is an Autosave that is newer than the saved copy. This is an useful, at the same time not so appreciated function of WordPress Autosave.

By default when you install WordPress, the Autosave functons are set for saving a copy of the post you are writing very 60 seconds. This means you could end up with a lot of copies of your posts. The longer it takes you to write the post in WordPress, the more copies you will have stored in the database. So inorder keep the database clean and organized for the smooth runnig of your website, we need to disable this option. To do that, go to your wordpress installation base folder and find the file ‘default-constants.php‘ located at ‘wp-includes/default-constants.php‘.

Search for the code:

define( 'AUTOSAVE_INTERVAL', 60 );

and change it to

define( 'AUTOSAVE_INTERVAL', 9999999 );

By changing that we are actually increasing the autosave interval to a very large value and thereby disabling the Autosave.
Similarly Revisions posts also consumes the database. To Disable Revisions, find the following code:

define('WP_POST_REVISIONS', true);

and change it to

define('WP_POST_REVISIONS', false);

That’s it now you can keep the post editing window open as long as you want and without the fear of ending up with autosave posts.

Filed Under: Wordpress Codes Tagged With: WordPress Tips & Tricks

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Sponsered

FREE Email Updates

Subscribe to our newsletter to get all the latest updates to your inbox..!



TRENDING

How you can make a stylish Facebook Like Box with simple CSS tricks

The Easy Way to Show Placeholder images or Dummy images

How to create a self hosted WordPress Blog or website for free?

Show user information like IP address, useragent with PHP codes

Return to top of page

Copyright © 2016 · digitcodes.com · Privacy Policy · Contact Us