Reduce MySQL Database size by managing WordPress Post Revisions count (WordPress Tip for Optimum Performance)

The WordPress revisions system records each saved draft or published update. You can see what changes were made in each revision by dragging a slider (or using the Next/Previous buttons). The display indicates what changed in each revision—what was added, what remained unchanged, and what was removed. Lines added or removed are highlighted, and individual character changes are highlighted. Click the ‘Restore This Revision’ button to restore a revision.

Introduction to feature called revisions:
As stated above, ‘Revisions’ are posts stored drafts for future proofreading of blog posts. It creates multiple copies of the blog posts you are working on in your MySQL Database in plain English. So it naturally affects & increases the size of your WordPress’s MySQL Database size in megabytes.

So I would suggest using the following code to successfully control the WordPress Post Revision Count to ultimate ‘3’ to stop it from growing above & creating clutter in your WordPress Database.

Put the following code in your WordPress Installation’s wp-config.php file to limit the number of post-revision WordPress stores in the database. Old revisions are automatically deleted.

/* Limit the number of posts revisions that WordPress stores in the database */
define( 'WP_POST_REVISIONS', 3 );

Note: After pasting the above code in your installation’s wp-config.php file, navigate to your website’s MySQL Database’s phpMyAdmin portal, then select all your tables of your database chosen & select ‘Optimise’ in drop down below.

I have used this code in my websites to successfully reduce my WordPress’s Installation MySQL Database size by 50% to 60%, i.e. by almost 5 MB

Further Reading:

I hope this helps,

Thanks & Regards
Mandar Apte

Published by Mandar Apte

Mandar is a Mumbai-based multi-disciplinary designer with UX/UI, Logo, Symbol, and Brand Identity design expertise. He currently runs his Mudrkashar Linguistic Apple iPhone, iPad, and Mac app business in the heart of Mumbai city.

Leave a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.