Every time you save or update a post/page, WordPress will store a revision in the database (if changes were made to the content).


So, if you update a post 66 times, you’ll basically get 66 copies of it in your database, bloating it as hell.

wordpress revisions


In a previous post, I showed you how to completely disable WordPress revisions.

Now, in this tutorial, I’ll show you how to limit WordPress revisions, rather than disabling them.

How to limit WordPress revisions

I recommend backing up the file or the entire website before editing!


In order to limit WordPress revisions, you’ll need to access your WordPress files and edit the wp-config.php file, which is usually found in the root directory: /public_html/wp-config.php.

edit wp-config.php cpanel

Editing the file via cPanel

If you want to edit the file for an add-on domain, then the file should usually be found in: /public_html/YourDomain.com/wp-config.php.

Once you’ve opened the wp-config.php file, add the below code, right before the /* That's all, stop editing! Happy blogging. */.


define( 'WP_POST_REVISIONS', 2 );

limit wordpress revisions

This will limit WordPress revisions to two per post/page.

You can change that number, depending on how many revisions you want WordPress to keep.

If you still wish to use a plugin, instead of adding code, then check these revision control plugins.


How to delete existing WordPress revisions

Limiting WordPress revisions won’t delete the existing ones stored in your database.

Manually deleting them requires some SQL coding, so I won’t get into that because it’s more risky and complex.

Therefore, I’ll recommend a revision control plugin that you could use, called Companion Revision Manager – Revision Control.

Those of you that use WP Rocket, as I do, you’ll have an option to delete WordPress revisions, along with other database cleanup features.

You can find out more by reading my WP Rocket review.

Create a backup first!

Be sure to create a database backup or backup the entire website before deleting your WordPress revisions.

If you don’t have a backup plugin, I recommend Updraft Plus.

That’s a wrap

Hope you found the post comprehensive enough and you’ll successfully limit your WordPress revisions!

If you have any questions or thoughts, drop a comment, contact us or message us on Facebook.

You can also follow us on Twitter and subscribe to our YouTube channel.

If you want to start your own WordPress blog, or need a website for your business, our WordPress website setup services are at your disposal! We also provide WordPress support and maintenance!

You can also purchase a ready-made WordPress website with hosting and support included!