How to Limit WordPress Revisions Without a Plugin

>How to Limit WordPress Revisions Without a Plugin
  • revision

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 save or update a post 40 times, you’ll basically get 40 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

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.

affiliate-disclosure-banner

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, like 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!

By |2018-08-31T01:44:17+00:00June 17th, 2018|Customization, WordPress|0 Comments

Leave A Comment