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.