Tutorial on Turning Off or Limit WordPress Post Revisions

  • This a short tutorial on turning off or limit WordPress post revisions.
  • WordPress users sometimes believe that multiple post modifications slow down their website.
  • WordPress ignores alterations when building the front end, and its MySQL queries are not slowed down by revisions.
  • Yet, updating content expands the WordPress database.

There is a common misconception about WordPress that keeping many post revisions would cause your website to run more slowly. This is not the case at all.

WordPress is developed in such a way that it is able to disregard modifications while it is producing the front end, and its MySQL queries are written in such a way that they are not really slowed down by revisions.

But, the WordPress database will get larger as you make updates to posts. Because revisions are essentially entire copies of your posts, the number of revisions that are stored depends on the number of posts that you have.

Tutorial on Turning Off or Limit WordPress Post Revisions

Let’s begin our investigation with the first strategy to Limit WordPress Post Revisions. Image source: FastComet

If you have hundreds of posts, this means that you also have many hundreds of revisions stored.

If you need to reduce the size of the database that WordPress uses, deleting your post revisions is an excellent way to do it without affecting the actual content that is stored in the database.

How to Limit WordPress Post Revisions

To accomplish this, enter the wp-config.php file that is associated with WordPress and add the following configuration line to it so that it appears before the text that reads “/* That’s all, stop editing! Happy publishing. */” line:

define('WP_POST_REVISIONS', false );

If you choose to proceed in this manner, your WordPress application will simply get the instruction to stop storing new post modifications.

If you want to delete all of the existing ones, it is a good idea to utilize the free plugin known as Bulk Delete or another plugin with characteristics quite similar to those of Bulk Delete.

If you do not wish to completely deactivate the WordPress revisions capability, you have the option of imposing a cap on the total number of changes that will be kept.

To accomplish this, add the following line to the wp-config.php file, placing it directly before the line that reads “/* That’s all, stop editing! Happy publishing. */” line:

define('WP_POST_REVISIONS', 3 );

You can change the number 3 in the above sentence to reflect the maximum number of changes you desire for each post.

Share

Leave a Reply