Family Encyclopedia >> Electronics

How to Disable Post Revisions in WordPress and Optimize Your Database Size

As a WordPress expert with years of experience optimizing sites for performance, I recommend disabling post revisions when database bloat becomes an issue. This built-in feature autosaves drafts, which is great for bloggers but unnecessary for CMS setups or sites with limited storage. Disabling it reduces database size and improves site speed.

Open your wp-config.php file in the WordPress root directory and add these lines:

define( 'AUTOSAVE_INTERVAL', 300 ); // 5 minutes
define( 'WP_POST_REVISIONS', false );

These settings stop future revisions from saving and extend autosave from 60 seconds to 300 seconds (5 minutes), minimizing unnecessary entries.

This won't remove existing revisions. For a full cleanup, access phpMyAdmin and run this SQL query (back up your database first):

DELETE FROM wp_posts WHERE post_type = 'revision';

Your site is now leaner with post revisions disabled and old ones deleted, leading to faster queries and smaller storage needs.

Disclaimer: Post revisions aid content recovery for many users. Use this only if database size is a concern—we're sharing proven optimization techniques from real-world deployments.