Keep Your WordPress Blog Running Smoothly and Reliably

This post is might sound over the head of your average WordPress blogger but trust me, if you can click a mouse, you can turn your sluggish and bloated WordPress into the lean and reliable blog you’ve always wanted.

If you have a WordPress blog with a few years on it, there is a good chance that you have a messy database. Every theme, plugin or tool you add to your WordPress installation can leave behind a unhealthy handful of orphan database entries.

Ironically, often times these orphan entries come from a plugin or theme you have removed in an effort to speed up your blog. Sadly, many themes and plugins don’t leave your blog as clean as they found it. Sometimes these orphan entries come from theme and plugin updates or even blog settings and customizations.
Database Edits

Just today I did a cleaning of my blog which resulted in my database shrinking by 11.3 megabytes, a decrease of over 50%. This removed 4,122 orphan entries in my database. To accomplish this I used two must have plugins.

First, you should never run a WordPress blog without the WP-DBManager plugin. “WP-DBManager manages your WordPress database. Allows you to optimize database, repair database, backup database, restore database, delete backup database, drop/empty tables and run selected queries. Supports automatic scheduling of backing up, optimizing and repairing of database.”

The next essential plugin is called Clean Options which finds orphaned options and allows for their removal from the wp_options table.

WP-DatabaseNow let’s put these plugins to use. First open WP-DBManager and backup your WordPress database. I wrote an article on how to do that, and how to schedule your backups, ages ago. Go ahead and read that post.

After your database has been backed up, do an “Optimize DB”. This is something you should do once a month. Think of it as cleaning off the dust in your WordPress database.

Once your optimize is completed, it’s time to do a “Repair DB”. After you did the optimization you should notice some “overhead” in your tables. See the animation above. Repairing the database will clean out this overhead. You might already notice your WordPress installation running a tiny bit smoother after finishing this step. But we’re not done yet.

Now we move to Clean Options. This guy is a bit tricky so it might be a good idea to run another backup of your database first. Clean Options is sort of a nuclear option at cleaning up your database of orphan entries. The first time I ran Clean Options it found over 25,000 orphaned database entries! When I ran it today it found 4,122.

Clean Options

It will take a while for Clean Options to finish finding your orphaned files. Get a cup of coffee and prepare to spend time going through each entry. If you find 25,000 entries like I did my first time around, you might feel compelled to just clean them all. I did. The only thing it broke was my blog navigation menu which I fixed in no time flat. It also removed my blog’s header image, another quick and easy fix. However, your mileage may vary so double-check each entry. Wordpress’s JetPack plugin is one that Clean Options picks up when it shouldn’t, just uncheck it when you’re doing your cleaning.

Once you’ve cleaned your database of all the orphan files, run WP-DBManager’s “Optimize” and “Repair” features one more time and you’re done! If you’ve broken your site, restore from backup. If you just have a few theme or setting issues, fix just those.

Before I leave you, one more tip. After you’ve set everything up back to how it should be, if you even needed to, do Clean Options one more time. You’re going to find a handful of entries again, and if you use Livefyre as your comment system, you might find a ton of entries. I can’t give you a good reason for this except some plugins area messier than others. After clearing out my 4,122 orphaned files, a second run found 84 new orphaned entries. Of those 84 entries, 74 were from Livefyre, two from Google, two from Yoast SEO and two from the WordPress JetPack plugin. A few other orphans are actually theme customizations and modifications.

Just remember these for your next cleaning and ignore them. If you clean the Livefyre orphans it’s no big deal. I actually recommend you do because if you ignore these 84 you might actually be ignoring thousands of their orphan files which accumulate over time.

Bonus!

Now that your database is all cleaned up of orphaned entries, what about other extraneous crud slowing your site down? If you have post revisions turned on for your blog you probably have dozens, maybe thousands, of duplicate posts. In addition to old post revisions you’ll also have unused categories, meta tags, SQL entries, post tags and unapproved or spam comments.

That’s why we have the fabulous WP-Cleanup plugin. It rids you of this mess with the click of a button. As with any major change, be sure to have a recent backup of your WordPress database, though I have never had anything go wrong with this plugin. It’s really a God-send.WP-Cleanup

Just like with Clean Options, do a database Optimization and Repair after running this plugin. The first time I ran it I saved, drum roll please, over 30 megabytes! That initial cleaning came after years of blogging and hacking around with dozens of themes and plugins. I managed to clean out over 30,000 database entries I didn’t need and saved just under 50 megabytes of space. This is huge. I also boosted my Google Page Speed score from 72 to 96!

Make this part of your spring cleaning routine and you can be sure you’re WordPress blog will run faster and more reliably for your readers. This speed boost can also have the happy side-effect of boosting your search engine optimization as Google takes page speed quite seriously when ranking search results. I wrote another blog post about that last year. Feel free to leave any questions in the comments below!

7 comments
justex07
justex07

@ahostingdotnet Thanks for sharing my post. Did you find it helpful?

justex07
justex07

@ahostingdotnet Thanks for sharing my post. Did you find it helpful?

richmackey
richmackey

@justex07 Mine is mostly about optimizing my images. :/ DB is pretty clean. But I will do your 3 steps (i do some cleanup now).

richmackey
richmackey

@justex07 Mine is mostly about optimizing my images. :/ DB is pretty clean. But I will do your 3 steps (i do some cleanup now).

justex07
justex07

@richmackey there are image optimizing plugins out there. I also use WP Retina 2X to make my blog (mostly) Retina-ready.

justex07
justex07

@richmackey there are image optimizing plugins out there. I also use WP Retina 2X to make my blog (mostly) Retina-ready.