WordPress Tutorials
How to Disable or Limit WordPress Post Revisions Tutorial

How to Disable or Limit WordPress Post Revisions Tutorial

It’s a popular WordPress myth that storing multiple post revisions slows down your website. This is not true. WordPress is written smart enough to ignore revisions while rendering the front end and its MySQL queries are written well enough so revisions don’t slow them down.

However, post revisions take up space in your WordPress database. Revisions are practically full copies of your posts, so if you have hundreds of posts this means you have a few hundred revisions stored too.

How to Disable or Limit WordPress Post Revisions?

If you need to decrease the size of your WordPress database, removing your post revisions is a great way to do it without sacrificing any actual content. To do this open the WordPress wp-config.php file and add the following configuration line to it above the “/* That’s all, stop editing! Happy publishing. */” line:

define('WP_POST_REVISIONS', false );

Doing this, however, will only tell your WordPress application to stop storing new post revisions. If you want to delete all the existing ones, it’s a good idea to use the Bulk Delete free plugin or a different one with similar functionalities.

If you do not want to disable the WordPress revisions functionality entirely, you can set a limit on how many revisions should be saved. This is done by adding the following line in the wp-config.php file above the “/* That’s all, stop editing! Happy publishing. */” line:

define('WP_POST_REVISIONS', 3 );

In the above, you can substitute 3 with the limit of revisions you want to have for each post.

Pros and Cons of Limiting Revisions

Limiting or disabling post revisions in WordPress can significantly declutter your database, leading to improved website performance and faster loading times. It simplifies the editing process, particularly for sites with multiple authors, by keeping only the most relevant versions of content.

However, the downside is the potential loss of important historical data. Reducing revisions means fewer backup points, which can be critical in restoring previous versions after accidental content changes or updates.

How Revisions Impact Performance?

WordPress post revisions can significantly bloat the database size, especially for sites with frequent content updates. Each revision is stored as a separate entry, which can lead to a large number of redundant data entries. Over time, this can slow down database queries and, consequently, your website’s performance.

By limiting revisions, you reduce the database’s load, ensuring quicker response times and a more efficient site.

Common Mistakes

Modifying the wp-config.php file for revision control can be tricky. Common issues include syntax errors that can disrupt your site’s functionality. Always ensure proper code format and placement when editing wp-config.php.

  1. Syntax Errors in wp-config.php: One of the most frequent issues is making syntax errors while editing the wp-config.php file. These errors can cause your site to break or behave unexpectedly. To avoid this, always:
    • Use a plain text editor for modifications.
    • Carefully follow the proper PHP syntax.
    • Insert the revision limit code above the line that says, “/* That’s all, stop editing! Happy blogging. */”.
  2. Incorrect Placement of Code: Placing the revision control code in the wrong section of the wp-config.php file can lead to it not functioning as intended. Ensure the code is inserted within the PHP opening and closing tags.
  3. Conflicts with Plugins: Some plugins may conflict with manual revision settings in the wp-config.php file. To mitigate this:
    • Check plugin compatibility with your WordPress version.
    • Read plugin documentation to understand how it interacts with WordPress revisions.
  4. Overlooking Backup: Failing to backup your site before making changes to the wp-config.php file can be risky. Always perform a full site backup before any modifications.
  5. Setting Revisions Too Low: While limiting revisions can improve performance, setting the number too low might lead to insufficient backup versions of your content. Find a balance that suits your editing frequency and content management needs.
  6. Neglecting to Test Changes: After modifying the wp-config.php file or configuring a plugin, some users forget to test their site. Always check your site’s functionality post-modification to ensure everything is working as expected.
  7. Ignoring Database Cleanup: If your site already has a large number of revisions, merely changing the revision settings won’t reduce the existing bloat. Use a database optimization plugin to clean up old revisions.

Tutorial Menu

Share This Article