Simple DB maintenance for your wordpress blog without any plug-in

Hello everyone!

Sure it happened you more than once. Your lightweight wordpress blog database has turned with some time and a lot of articles in a heavy, big and unoptimized information core for your site.
But what happened? Could this get reversed? Fortunately yes. Your wordpress site can run smooth again.

If you are not up to install some plugins in order to get the optimizations that you need for a faster blog then you can run the following queries.

Please, before do anything else, backup your database.

The following query get rid off all the revision posts:

DELETE FROM `wp_posts` WHERE post_type = 'revision';

This one deletes the autodraft posts:

DELETE FROM `wp_posts` WHERE post_status = 'auto-draft';

And this sends them to the place to its only place to be:

DELETE FROM `wp_comments` WHERE comment_approved = 'spam';

Finally, this one deletes the unapproved comments:

DELETE FROM `wp_comments` WHERE comment_approved = '0';

Just to finish, comes this bonus that will delete some data from the wp_options table.

DELETE FROM `wp_options` WHERE `option_name` LIKE ('_transient_%');

If you do this optimizations with a regular basis, you’ll get an efficient wordpress site.

Published by

Alí Adame

I'm an enthusiastic of technology as a way to improve life quality and bring progress to every person and organizations. My actual interest are based on software and web development and project management. || Soy un entusiasta de la tecnología como medio para lograr una mejor calidad de vida y progreso en todas las personas y las organizaciones. Mis intereses personales se centran en desarrollo de software, desarrollo web y administración de proyectos.

Leave a Reply

Your email address will not be published. Required fields are marked *