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 How to check if radio button is checked or not using JavaScript? #2 How to add Read More Read Less Button using JavaScript? #3 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #4 How to uninstall Cocoapods from the Mac OS? #5 PHP Login System using PDO Part 1: Create User Registration Page #6 How to Use SQL MAX() Function with Dates?

Recently Posted

#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 #Jan 14 How to display a student’s individual transcript in Colleague? #Jan 11 How to install PuTTY on a MacOS?
You might also like these
Difference between :where and :is in CSSCSSWhat does useEffect do in React?ReactHow to update or disable WordPress Post Revisions?WordPressSQL Inner JoinSQL/MySQLUnderstanding the confusing and handy “This” keyword in JavaScriptJavaScriptHow to Draw a Circle in HTML5 Using Canvas Tag?HTML