WordPress provides revision control on any pages or posts that you create which allow you to go back and see previous edits that you’ve written over in the database. While this can seem like a great thing to have, over toime it can lead to a lot of unessary overhead in your WordPress database.
In this article, we’re going to talk about WordPress revisions and how to disable or limit WordPress post revisions.
Whenever you save a page or post in WordPress it creates a revision. This occurs in both drafts and already published posts that are updated. Revisions can be helpful in case you need to revert back to a previous version of your content. However, they can also hurt the performance of your WordPress site. On large site this can add up very quickly to thousands of rows in your database which are not necessarily needed. And the more rows you have the larger your database in size, which takes up storage space. Follow the steps below on how to delete, limit and disable WordPress revisions for faster performance.
Disable WordPress Revisions
In the steps below, we’ll show you how to completly turn off WordPress revisions for your pages and posts. We’ll be using the WP_POST_REVISIONS setting in your wp-config.php file to accomplish this.
1. Open your wp-config.php file. You will need to add some code. This is typically located in the root of your WordPress site directory and you can access it via FTP.
2. Enter in the following code towards the top of the wp-config.php file:
Note: The code above needs to be inserted above the “ABSPATH” otherwise it won’t work.
It should look something like the following.
Limit WordPress Revision
Using the steps below I’ll show you how you can limit the number of revisions that WordPress will store per page or post. By default there is no limit on the amount of revisions so any limit you impose is going to help keep your WordPress database more efficient. Again we’ll be using the WP_POST_REVISIONS setting in your wp-config.php file to make these changes.
In this example we’re going to set our max amount of revisions per page or post to 3. So in total there will be 4 entries in the database per page or post, 1 for the original itself, and then the 3 latest revisions.
1. The steps are the same as disable revisions above. Open your wp-config.php file.
2. The code below needs to be inserted above the “ABSPATH” otherwise it won’t work.
Hopefully now your WordPress revision won’t be bloating your database.