Yogesh Chauhan's Blog

How to modify AutoSave Interval using code in WordPress?

in WordPress on December 30, 2021

You might like these posts:

How to invalidate all existing cookies using Security Keys in WordPress?

WordPress: How to create a folder if it doesn’t already exist?

How get_template_part helps write reusable code in WordPress?

If you pay attention while writing your blog post, you must have noticed that WordPress is saving the posts as you edit them – just like Google or MicroSoft Office products.

While Google and Microsoft have their own technics to check for the edits and save them, WordPress uses familiar AJAX to auto save the posts into separate revisions.

The default WordPress AutoSave Interval is 60 seconds.

If you think WordPress is creating way more revisions than you’d want it to create then you might want to change the intervals and delay the auto save to create a fewer revisions. It helps with your database as well since there will be a fewer revisions and less data to store.

Similarly if you want WordPress to constantly save changes, you could do that too so that you’ll never lose any changes made to your post.

This is how you can modify AutoSave Interval:


define( 'AUTOSAVE_INTERVAL', 200 ); // Seconds

You need to add the code above into wp-config.php file.


Most Read

#1 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #2 How to add Read More Read Less Button using JavaScript? #3 How to check if radio button is checked or not using JavaScript? #4 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #5 PHP Login System using PDO Part 1: Create User Registration Page #6 How to uninstall Cocoapods from the Mac OS?

Recently Posted

#Apr 8 JSON.stringify() in JavaScript #Apr 7 Middleware in NextJS #Jan 17 4 advanced ways to search Colleague #Jan 16 Colleague UI Basics: The Search Area #Jan 16 Colleague UI Basics: The Context Area #Jan 16 Colleague UI Basics: Accessing the user interface
You might also like these
Microservices vs Monolithic ArchitectureMiscellaneousLearn how to use Self JOIN in SQL and MySQLSQL/MySQLWhere is the PHP log file located on Mac OS?PHPCan Firewall and IDPS Stop DDoS Attack?MiscellaneousHow to Create a Copy of a Table in SQL and MySQL?SQL/MySQLclip and clip-path properties in CSSCSS