How To Change The WordPress Autosave Interval

WordPress is an open source Content Management System (CMS) that makes it easy for you to publish and maintain a website without a lot of technical skills.

It has all the options to change different aspects of your WordPress site. While you are writing a post, WordPress saves it automatically as a draft every 60 seconds. WordPress uses AJAX to autosave post revisions to your database as you edit the page/post.

This is a handy feature when you forget to save your posts while updating your site.

There are certain situations when you want to change the WordPress autosave interval. In this guide, you will learn to change the default WordPress Autosave Interval feature.

Prerequisites

  • A Domain Name (example.com)
  • WordPress Admin Credentials
  • cPanel Credentials
  • FTP client (Filezilla, Cyberduck)
  • Text Editor (Notepad, Sublime)

Step 1:

Login into your cPanel using your username and password

How To Change The WordPress Autosave Interval

Locate File Manager and Click on File Manager to access your website directory. You can also use an FTP Client to access it.

Inside you website directory, click on public_html from the left side menu and locate the wp-config.php file.

How To Change The WordPress Autosave Interval

How To Change The WordPress Autosave Interval

Step 2:

Right click on the wp-config.php file and Click Edit.
 A pop-up window will appear. Click Edit to open the editor. If you are using FTP client, you need to download that file and open it with your favorite text editor.

Step 3:

How To Change The WordPress Autosave IntervalHow To Change The WordPress Autosave Interval

Search for the following piece of code in your wp-config.php file
require_once(ABSPATH . 'wp-settings.php');

Now, add the following line of code before the above code.

define('WP_POST_REVISIONS', 4);define( 'AUTOSAVE_INTERVAL', 20 );

In the above line of code, 20 represents the autosave interval time in seconds. Change the interval time as required by adding the number of seconds you want to add. The first line tells WordPress to save only 4 post revisions of any article.

Now, Click on Save Changes from the top right corner. Before saving, make sure the above line of code is added before the first line of code. Note that you need to enter the duration in seconds and not minutes.

Step 4:

To check, if the interval time has been updated or not Login to your admin Dashboard.
Click on Posts and Click Add New. Start writing your post and observe the autosave interval.

Step 5:

You can also disable autosave feature if you want to save your changes manually.

Add the following lines of code to the functions.php
file to disable it. Go to your admin dashboard and click on Appearance on the left side menu.

Click on Editor to open the editor. From the right side in the Editor window, click on functions.php. Add the following lines of code to it.

functiondisable_autosave() {
wp_deregister_script('autosave');
}
add_action('wp_print_scripts','disable_autosave');

Click on Update File and see the changes while you are writing your posts.

Conclusion:

By following the above steps, you have learned how you can change the autosave interval time of your WordPress site and also disable it if you do not want that feature.

Check out these top 3 WordPress hosting services:

HostArmada
£1.98 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
IONOS
£0.79 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
Ultahost
£2.30 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8

How to customize the WordPress Admin Login Page

Who wouldn't want to customize their login page? In this guide, we will learn ho
1 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How To Increase Maximum File Size Upload In WordPress

Low file size limit in wordpress can stop you from uploading some plugins, theme
1 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert

How to Fix “Error Establishing Database Connection.” in WordPress

Error Establishing a Database Connection is one of those curses that could be ca
4 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How To Logout All Users In WordPress At Once

What will you do if your WordPress site has been hacked or want all the users to
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top