How to limit or disable post revisions in WordPress?




WordPress has autosave feature which creates a post revision for every minute while you edit a post. So, if you take more time to write/edit a post, more post revisions will be created in the database which may slow down your site speed. Website speed is an important factor for Google ranking, optimizing post revisions can add an advantage in improving your site loading speed.

Post revisions are good in case if you lost the connection to a post and want to reedit the post later. WordPress allows you to disable/limit or change autosave interval of post revisions to optimize your site’s database.

You can disable or limit post revisions using WP_POST_REVISIONS parameter in wp-config.php file.

Disable post revisions in WordPress

  1. Add below line to wp-config.php file

define (‘WP_POST_REVISIONS’, false); // disable post revisions

Limit post revisions on WordPress

  1. Add below line to wp-config.php file

define (‘WP_POST_REVISIONS’, 3); // limit number of revisions to 3

Change WordPress AutoSave time interval

If you want to change the autosave time interval, then add below line. Below line is for autosave time interval of 200 seconds. Edit it as per your need.

define (‘AUTOSAVE_INTERVAL’, 200); // in seconds

Note:

Add above lines BEFORE /* That’s all, stop editing! Happy blogging. */ in wp-config.php file.

About the Author

SRINI S

A passionate blogger. Love to share solutions and best practices on wordpress hosting, issues and fixes, excel VBA macros and other apps