How to Control Post Revisions in WordPress

July 3, 2013

WordPress saves posts to draft and create a revision each time when you save a post as draft in the database. However, there is not any limit to these revisions at all. The more you create posts, the more post revisions will be there in the database. In order to control post revisions in WordPress,WordPress gives us a neat and tidy way to do it.

Limit the number of posts revisions that WordPress stores in the database. Open up your wp-config.php which is located in the root directory of your WordPress installation and add up the following line of code in that file.

define( 'WP_POST_REVISIONS', 3 );

In the above snippet the number 3 is the number of post revisions. After defining the above code in the specified file, the WordPress will limit the post revisions to 3 rather than unlimited.

Or You can also use a WordPress plugin to do the same job. And the WP-Optimize is great plugin for it.

Muhammad Dilawar
Muhammad Dilawar
Muhammad Dilawar is a WordPress developer and technical SEO specialist with over 12 years of experience building, optimizing, and maintaining websites. He specializes in WordPress, WooCommerce, server optimization, DNS, Cloudflare, website security, and performance improvements. Through Softstribe, he shares practical guides, tutorials, and industry insights based on real-world experience helping businesses grow their online presence.
More from Muhammad Dilawar