Limit or disable WordPress revisions
Written by Jacob NicholsonLimit WordPress revisions
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. We'll be using the WP_POST_REVISIONS setting in our wp-config.php file to accomplish this.
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. In this case I simply started a new post with the title Test and then in the content of the post I simply entered in Test #1 and then previewed the page, then I entered Test #2 and previewed the page again up until I got to Test #7.
- Login to your cPanel.
- Access the cPanel File Manager Code Editor and navigate to your wp-config.php file.
- Enter in the following code towards the top of the wp-config.php file:
* @package WordPress
*/
define('WP_POST_REVISIONS', 3);
// ** MySQL settings - You can get this info from your web host ** //After that click on Save Changes at the top-right.
Below is a screen shot of the WordPress database showing the difference between the default WP_POST_REVISIONS settings, and the ones we just set.

Disable WordPress revisions
In the steps below I'll show you how to completly turn off WordPress revisions for your pages and posts. Again we'll be using the WP_POST_REVISIONS setting in your wp-config.php file to make these changes.
Also again I've done the same thing where I created a new post called Test, and then I put Test #1 as the content and previewed the page, then I changed the content to Test #2 and previewed it again. I repeated these steps till I got up to Test #7
- Login to your cPanel.
- Access the cPanel File Manager Code Editor and navigate to your wp-config.php file.
- Enter in the following code towards the top of the wp-config.php file:
* @package WordPress
*/
define('WP_POST_REVISIONS', 0);
// ** MySQL settings - You can get this info from your web host ** //After that click on Save Changes at the top-right.
Below is a screen shot of the WordPress database that no revisions are being stored, and only 1 row is being used for my post.

You should now understand how to limit or completly disable the WordPress revision functionality to help keep your WordPress database optimized. If you already have a large amount of pages and posts that have a lot of revisions we would recommend possibly trying out the Better Delete Revision WordPress plugin, while this plugin is old it still functions perfectly fine from the testing that we've done.
Latest Questions
Need more Help?
Search
Ask the Community!
Current Customers
| Chat: | Click to Chat Now | E-mail: | support@InMotionHosting.com |
|---|---|---|---|
| Call: | 888-321-HOST (4678) | Ticket: | Submit a Support Ticket |

