How to Disable Auto-Saving in WordPress

WordPress offers auto-save functionality making it easy to ensure your work isn’t lost. However, post revisions can add up quickly. Here are some tips to disable the post revisions and auto-save functionality.

Disable Auto-saving

Add this to your functions.php file:

function disableAutoSave(){
    wp_deregister_script('autosave');
}
add_action( 'wp_print_scripts', 'disableAutoSave' );

**NOTE** if you disable autosave, it prevents the “preview” function from working as you would typically expect. You need to manually click “save draft” and then click “preview” for the preview to work as before. This happens because when clicking preview with autosave enabled, will automatically save a new draft.

Modify / Disable Saving Drafts

** CAUTION ** Be careful when editing your wp-config.php file.

You need to open up your wp-config.php file, which is in the root of your WordPress installation.

There are a few different settings you can change:

Adjust the interval for how often a post is auto-saved.

define('AUTOSAVE_INTERVAL', 160 );  // seconds

Adjust or disable post revisions entirely.

define('WP_POST_REVISIONS', 3);
define('WP_POST_REVISIONS', false ); // disable post revisions entirely

Any questions or suggestions to the above code, please let us know in the comments.

via WP Codex

Comments

Leave a Reply

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