Clean up your database

After using WordPress for a while, your database will have lots of information that you probably don’t need any more. For improved performance, you can optimize your database to get rid of all that unnecessary information.

This can be easily managed with the WP-Sweep plugin or WP-Optimize. It allows you to clean your WordPress database by deleting things like trashed posts, revisions, unused tags, etc. It will also optimize your database’s structure with just a click.

Post revisions take up space in your WordPress database. Some users believe that revisions can also affect some database queries run by plugins. If the plugin doesn’t specifically exclude post revisions, it might slow down your site by searching through them unnecessarily.

You can easily limit the number of revisions WordPress keeps for each article. Simply add this line of code to your wp-config.php file.

 define( ‘WP_POST_REVISIONS’, 5 ); 

This code will limit WordPress to only save your last 5 revisions of each post or page, and discard older revisions automatically.

The wp_options table is something to focus on too because if it grows out of control it can seriously slow down your site. Advanced Database Cleaner is the best plugin for doing this but it’s not perfect so remember to take a backup first! If you want to try cleaning up the database yourself see this post and for command-line fans see this post for cleaning your wp_options table.

Please take backup of your website before doing this step.