In a recent WordPress release, they have introduced a feature to 'auto-save' every post or page you are editing constantly (via ajax, a silent process executed in the background). This is a fantastic feature for website editors as if you make any mistakes, you don't have to start all over again. However, the main problem with the ajax auto-save configuration, is that it can be executed more than once per minute. If you just type 1 or 2 words and suddenly stop writing, it will automatically save the post as a Draft again. You can notice that at the left bottom corner of the text area:
We have seen WordPress applications that execute more than 2000 times in a couple of hours, which can cause a significant load on a server, especially where there may be several hundred websites using WordPress. To make matters worse, if you have a number of plugins installed, these may also interact or call the auto-safe function while you are writing or publishing a post, and they may make an even greater demand on the server.
How can we increase the interval between each autosave?
Fortunately, WordPress, in their documentation explains how to accomplish that:
- Locate the file wp-config.php
- Open the file with your favourite text editor
- Scroll to the line where it says: /* That's all, stop editing! Happy blogging. */
- Before that line add the following:
define('AUTOSAVE_INTERVAL', 1800 ); // in seconds (the default is 60)
define('WP_POST_REVISIONS', false ); // it disable post revisions
Note: If you don't want to disable post revisions, you can limit WordPress to a certain number of revisions:
define('WP_POST_REVISIONS', 5); // the number of post revisions we want to keep.
The above are our recommended values, however, you might want to adjust it as you wish. In case you want to completely disable the autosave, you can define the autosave_interval to 86400 seconds, which is the amount of seconds in a entire day.
We hope all this information helped you understand one of the most important issues with WordPress and also how we also learn something new on a daily basis while working with all of you.
As always if you have any suggestion or recommendation on how can we improve our service, don't hesitate to let us know. We love receiving your feedback!