Sometimes WordPress blogs — especially ones with large databases or a lot of plugins — can put too much of a burden on a host’s server’s CPU. That can be especially true if that WordPress blog is on a shared hosting account. And when these blogs become too resource-intensive, hosts often suspend or throttle the accounts, even though the site otherwise is still far too small to truly require VPS or dedicated hosting options. These limitations are often in place because Web hosts overload servers with many accounts under promises of unlimited hosting (unlimited space and bandwidth, but not unlimited when it comes to other resources like CPU).
I’ve had problems with multiple hosts over the last several months due to CPU usage issues with one blog in particular. And while I’ve decided to move that site to dedicated hosting in a few months’ time, I did discover some tips and tricks for decreasing CPU usage in the meantime. Today I’d like to share some of those tips with you, in case you also find your hosting account throttled or suspended and you need quick solutions.
5 tips for Decreasing CPU Usage for WordPress Blogs
Here are five things that might help you decrease the CPU usage of your WordPress blogs. Please note that they won’t all work for all blogs — it will depend on what problem is causing the high CPU usage to begin with, and that will vary from one blog to another.
- Repair / Optimize your database — I’ve heard that others have had success taking a few minutes to head into PHPMyAdmin and run repair and optimization on their WordPress databases. It didn’t have much of an effect for me personally, but if there are problems with your database it could certainly be affecting your resource usage. It’s a simple fix, so give this is a try first. Just remember to back up your database before you do any work on it in case you run into trouble.
- disable the automatically saved drafts that WordPress keeps by default (don’t forget to delete the past revisions too). Every draft saved counts as a new post in the database, and they can really add up. Disabling this cut my database size by 60%. Just remember to optimize your database after making any changes like this. And again, create a database backup before playing with the database in any way. Decrease your database size. — Sometimes when you delete plugins, their database tables aren’t automatically removed. Deleting these can help you decrease your overall database size to help you optimize database issues that could be causing high CPU usage. You can also
- Check your plugins. — Only two things I tried had any effect on decreasing my own CPU usage. Disabling a plugin was one of them. If you have plugins that need to search all of your posts (like a related post plugin), it could be the culprit. Disable it and then check your throttling again. If you can’t check your CPU usage yourself, call your host and ask them if there’s been a difference since making the change. Not that plugin? Disable them all one by one then to see if any are causing issues. When you find the offender, remove it completely or find an alternative plugin that won’t make your site quite so resource-intensive.
- Look for unusual bot / spider activity. — If your site is large and being crawled frequently by spiders and bots, that could be contributing to your high CPU usage. You can slow down their crawl speed (in the case of spiders like Yahoo’s), or you can block problem bots.
- Install a cache plugin. — Install a caching plugin like WP Super Cache or W3 Total Cache. These allow your pages and posts to be saved as static HTML files, reducing your blog’s CPU usage. I’ve seen some minor improvements using W3 Total Cache. Just remember, you can’t activate the plugin and expect to see immediate results. You need to configure them to fully optimize them. You can find instructions for using both of these plugins at the links above.
Unfortunately there’s no magic bullet for heavy CPU usage from your WordPress blog. But there are quite a few solutions you can try. Because WordPress users often pull from different third party sources like plugin creators, you’ll need to look at your individual stats and test your individual plugins to find out what’s causing the biggest issues for your blog. Good luck. Here’s to no more throttling!