Save more WordPress’ database disk space with a simple trick

If you use WordPress as blogging platform, and you have installed a recent version, you must have see that it has become more greedy in space.

This is particularly due to the registration of “revisions”.

What is “revisions”?
These are versions of posts that are recorded as you write. This is a very useful feature when writing a post several times, not to lose content that might have cleared.

However this feature is greedy and take a huge disk space on the database because each revision takes roughly as much space as the post finally published.

Personally I use the revisions until the final publication. But after this stage, I do not need them. I wanted to find a way to remove them to optimize my database.

mysql improve wordpress

This is very simple: a single line of SQL will make a nice cleaning. The “revisions” have a type associated in a field in the table posts.

DELETE FROM wp_posts
WHERE post_type = ‘revision’;

Just execute this directive in the administration interface of your database such as PHPMyAdmin. Doing so will reduce your database disk space.

If you do not want to clean up all, but only posts written before a certain date, you can use to that :

DELETE FROM wp_posts
WHERE post_type = “revision”
AND post_date < “20013-01-01“;

Change the date above to what suit your need.


You May Also Like

How WordCamp US 2026 Helps Freelancers and Agencies Grow

Most conferences sell you a badge and a keynote. WordCamp US sells…

How to Transfer From Blogger to WordPress In 6 Super Easy Steps

Blogger is a great tool for beginners, but once a blogger starts to realise the perks of having full control over their content, then WordPress becomes the next best option. There is a lot of information about how to migrate your blog or site. The hardest part about this move is trying to find and […]

Email Marketing Automation for WordPress Blogs: What’s Actually Worth Setting Up

I tested MailPoet, FluentCRM, and Uncanny Automator for a week to find out which WordPress email automation is actually worth setting up.

5 Common Mistakes Made by WordPress Beginners

  WordPress is a global platform for beginners to start their own website. It is a free platform without any barriers to entry that allows anyone to start a website with just basic knowledge regarding web development. Since it is an extremely easy to use content management system some beginners make very common mistakes when […]