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…

Why WORDPRESS is better?

You might have started your own online business. Well, to make it work, you need to own a site. However, if you do not know much about programming languages, then it would benefit you a lot to make use of the simple and easy ones. In this matter, it would be a very good idea […]

Use the RSS feed for a specific category

If you want to encourage your readers to subscribe to some of the updates of your site, it may be interesting to set up RSS feeds by category. The feed url to track updates on a category is obtained very simply by getting the URL of your category and add this /feed after the link they […]

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.