WPEra

Best Place To Learn WordPress

  • About
  • Contact
  • My Toolkit
  • Discounts
  • Home
  • Tutorials
  • Plugins
  • Themes
  • Security
  • Errors
WPEra  »  WordPress Tutorials  »  How to Disable or Limit Post Revisions in WordPres...

How to Disable or Limit Post Revisions in WordPress to Reduce Database Size?

Updated on January 18, 2017 by Divakara Ganesh Leave a Comment

How to Disable or Limit Post Revisions in WordPress to Reduce Database Size

Hello Folks. Welcome to WPEra. In this article, I am going to show how you can disable post revisions and how you can limit the number of post revisions in WordPress.

What is Post Revision?

post-revisionsPost revision is a cool feature introduced in WordPress 2.6. This feature stores a copy of each saved draft and published update in the database. The revision system allows us to see what changes were made in each revision i.e. what was added, what was removed and what was unchanged. By using this handy feature you can restore your post to any of the saved revisions. But most WordPress users don’t use this feature.

How Much Space Do Post Revisions Occupy?

Before publishing a post, I will do a lot of minor modifications, corrections and edits to the post. Every time when I did a modification, I will save it as a draft. Sometimes for publishing a single article, I will save the post more than 20 times. That means I am saving 20 copies of the same post in my database.

Let’s say if your blog has 100 articles each has 20 Revisions.

That means your database contains 2000 copies (100*20). So post revisions occupies tons of space.

Do Post Revisions Impacts The Site Performance?

There is popular WordPress myth that storing multiple post revision impacts the site performance. This is just a myth.

WordPress post revisions don’t impact the speed of website because its MySQL queries are written in such a smart way that, while reading from the frontend the queries doesn’t retrieve revisions.

The revisions are retrieved only on the edit page of individual posts.

So it doesn’t impact the frontend speed of your site.

The only negative impact of post revision is that they consume a lot of database space.

If you want to save the database space, then you need to either disable the revisions or lower the number of revisions stored in the database.

In this section, I will show you how to disable post revisions and how to limit the number of post revisions stored in the database.

Disabling The Post Revisions in WordPress

To disable the WordPress post revisions, you need to modify the “wp-config.php” which is located in the root directory of your site. In order to do this, you need to download this file. You can do this through FTP software like FileZilla or File Manager in your hosting cPanel.

Then find the following line in ‘wp-confing.php’.

/* That's all, stop editing! Happy blogging. */

And just above that line add the following code and save it.

/* this will disable post revisions – WPERA.NET */
define('WP_POST_REVISIONS', false );

Now upload the saved ‘wp-config.php’ to your sites root directory.

Re-enabling The Post Revisions in WordPress.

If you want to enable post revisions in future you need to replace the above code with the following code.

/* this will enable post revisions – WPERA.NET */
define('WP_POST_REVISIONS', true );

Limit The Number Of Post Revisions To Store In WordPress Database

It is a good idea to limit the number of post revision stored in the database rather than completely disabling. To limit the post revisions to a certain number of times, you need to add the following code to “wp-config.php”.

/* this will Limit post revisions – WPERA.NET */
define('WP_POST_REVISIONS', 5 );

You can change the number to how many revision you want to store in your database.

Note: These methods doesn’t delete old revisions which are already stored in your WordPress database.

Some of the links in this post are Affiliate Links. This means if you click on the link and purchase the item, I will receive an affiliate commission.

About Divakara Ganesh

I am Divakara Ganesh, Heart and Soul of WPEra. I am a blogging addict, WordPress and Genesis Framework lover, web developer. Apart from blogging, I love to listen music and watch movies.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Featured Posts

Setup WordPress on VPS Server Using ServerAvatar

Find and Remove WordPress Version Number to Protect from Hackers

10 Best WordPress Themes for Web Hosting Company with WHMCS Integration

13 Best WordPress Themes for Actors and Actress 2017

How to Fix the 500 Internal Server Error on Your WordPress Website Without losing Data?

How To Lazy Load Comments In WordPress To Increase Page Speed

Drag and Drop WordPress Theme

Divi WordPress Theme

Landing Page Builder

About Divakara Ganesh

Hey, I am Divakara Ganesh, Founder of WPEra. I am a Blogger, Wordpress Lover, Web Developer, SEO Analyst. I love to do experiments on google.

Quick Links

  • About WPEra
  • Contact Me
  • Privacy Policy
  • Disclaimer
DMCA.com Protection Status

Copyright © 2016-2018 WPEra | Designed by Divakara Ganesh