Home Blogging ResourcesWordPress Tutorials How to Change or Disable WordPress Autosave Interval

How to Change or Disable WordPress Autosave Interval

by Pradeep Mamgain
81 views
How to Change or Disable WordPress Autosave Interval

The WordPress autosave feature is a life saver because it gives you peace of mind while editing a post or creating a new post. Also, it is pretty annoying when you have a very slow internet connection and your browser hangs frequently when WordPress tries to save a draft – and you lose everything. If WordPress autosave function is not working, the first thing you should check is your internet connection.

This article walks you through the process of changing the WordPress autosave interval.

Is WordPress autosave not working on your WordPress website? Do you want to change the autosave interval or permanently disable the autosave feature? This article walks you through that process.Click to Tweet

How WordPress Autosave Feature Works

By default, WordPress saves a draft every 60 seconds. You can increase or decrease this interval as per the requirement. WordPress only stores the latest autosave. This is quite different when you press the Update button, where a new post revision is created each time.

Changing the WordPress Autosave Interval

To change the length of time that WordPress waits between automatically saving your drafts, follow these steps:

Step #1: Login into cPanel

Navigate to your cPanel page and then log in to your cPanel; the cPanel home screen will be displayed.

cpanel login

Step #2: Open File Manager

In the Files section of the cPanel home screen, click on File Manager to open it.

Step #3: Edit wp-config.php File

From the left pane of File Manager, navigate to your domain’s root folder. Typically, /public_html/example.com. However, if you installed WordPress in a subdirectory, navigate to that directory instead. In the right pane, select wp-config.php and then click Edit in the top toolbar.

wordpress autosave editing config php

On clicking Edit, the Edit dialog box will be displayed. This dialog box is prompting you to back up the original file before editing and I also recommend that you create a copy of the original file before editing. In case something goes wrong you can jump back to the original copy. To backup the file, click on the Download button from the top toolbar and save it on your computer.

This dialog box also lets you select character set encoding for your file. If you are working in English, you can safely disable this dialog box by clicking the Disable Encoding Check button. Now, click the Edit button to open the file.

Add the following line to the wp-config.php file. 

define( ‘AUTOSAVE_INTERVAL’, N );

The character N is the number of seconds you want WordPress to wait before saving drafts. For example, if you want to set interval to 2 minutes, change N to 120. If you want to set interval to 1 day, change N to 86400 (24*60*60).

Make sure this line comes before the following line:

require_once( ABSPATH . ‘wp-settings.php’ );

Now, click on the Save Changes button from the top of the window. 

Disable WordPress Autosave

If you want to permanently disable the autosave feature, follow these methods:

Method #1

  1. Login to cPanel.
  2. Navigate to functions.php in your themes folder. Open file for editing.
  3. Paste the following code into the functions.php:
    add_action( ‘admin_init’, ‘disable_autosave’ );
    function disable_autosave() {
    wp_deregister_script( ‘autosave’ );
    }
  4. Save the changes.

Method #2

  1. Navigate to wp-admin/post.php. Open file for editing.
  2. Search for the following code:
    wp_enqueue_script( ‘autosave’ );
  3. Now, add // in at the front of the code:
    //wp_enqueue_script( ‘autosave’ );
  4. Save the changes.
  5. Repeat the process for wp-admin/post-new.php.
How to Change or Disable WordPress Autosave Interval

Conclusion

It’s up to you whether you want to change the autosave interval or completely disable it. However, please re-think before disabling it on your WordPress site. As I said before, enabling it could be life-saving. I personally keep a copy of the post on my Google Drive and I first make changes to the Drive copy and then edit my live post.

Is WordPress autosave not working on your WordPress website? Do you want to change the autosave interval or permanently disable the autosave feature? This article walks you through that process.Click to Tweet

And, Drive’s auto-save feature is much better and you can also work offline.

I hope this article helped you easily tackle the autosave feature. If you liked this article, please subscribe to our newsletter. You can also connect with us on YouTube, Facebook, Twitter, and Pinterest. If you are a foodie, please check our recipe grid.

Do you have any questions or suggestions about how to disable the autosave feature or how to change the autosave interval? Ask away in the comments section below.

You may also like

Leave a Comment

shares