Summary

This article offers advice on diagnosing and fixing problems with high CPU loads, or 100% CPU spikes in your WordPress blog/site.

Managed WordPress Hosting

Our tips on fixing high-CPU loads in WordPress apply to websites built on the self-hosted WordPress.org. Whilst many of the below tips are suitable for all WordPress hosting, we also offer WordPress performance tips specific to our Managed WordPress Hosting service.

How to fix CPU problems in WordPress

Update WordPress
If you’re not using the latest version of WordPress update now. Make sure you backup your site first!

Update your WordPress Plugins
Updating your WordPress plugins to the latest versions can often reduce high CPU usage. If you’re running an old version take a moment to update now.

Only use stable versions of plugins
Whilst it’s cool to be at the cutting-edge, only use stable versions of WordPress plugins. Sometimes early release versions (also known as alpha or beta) can have bugs in the code which can cause CPU spikes.

Install a caching plugin
Caching plugins such as W3 Total Cache and WP Super Cache can dramatically reduce CPU load by caching static copies of your pages on your web space. Static files use less CPU and memory. Keeping you within your shared-hosting limits.

If you’re already running a caching plugin, but still experience high CPU loads check your caching plugin is using the optimal settings. See our own recommended settings for WordPress WP Super Cache and W3 Total Cache.

Only use plugins you really need
Do you really need that plugin that constantly checks for broken links? – The more WordPress plugins you have installed, the longer your site will take to load. Deactivate and delete any plugin that you don’t need. Aim for just a handful of plugins. This will speed up your site and keep your visitors happy.

If you’ve disabled plugins you don’t need, and still have high CPU usage you’ll need to try debugging each plugin to see if it’s the cause of the CPU spike. First make sure you’ve taken a backup of your entire WordPress site (files and database). Now try disabling each plugin one by one until the CPU load has been resolved. Once you’ve found the faulty plugin you should hopefully be able to reenable the others without seeing the CPU problems.

Avoid using resource-hungry plugins
The more complex WordPress Plugins such as WP eCommerce and NextGen Gallery need lots of CPU and memory and are best suited to VPS, or dedicated servers. If you try running CPU intensive WordPress plugins on a shared-hosting package you risk your site being suspended due to high-CPU loads. If you wish to use these plugins we recommend one of our VPS or dedicated servers. Email sales@ecenica.com for more details.

Check your WordPress Theme
A badly written WordPress Theme or one written with demanding features such as server-side image resizing can be CPU intensive. To rule out problems with your WordPress theme try the following:

  • Check error logs for problems. Login to cPanel and check the Error logs for errors.
  • Contact the theme developer and ask if there’s any known issues.
  • Disable any dynamic features built into the theme such as thumbnail resizing. Some WordPress themes have their own image resizing modules which can cause high CPU usage. If possible we recommend disabling them in favour of using the more efficient image resizing built into the WordPress core.

Ask the WordPress Community for help
Try searching WordPress Forums for answers. If there’s a known problem with a plugin there’s a good chance someone will have provided a solution. For example searching yarrp cpu has lot’s of hits.

Disable WP-Cron
WP-Cron manages all the scheduled events in your WordPress site. WP-Cron is a very common cause of high CPU loads as it is called every time someone visits your website. Disabling WP-Cron and replacing with a real cron job can drastically reduce CPU-load and prevent the chances your account is suspended due to exceeding your resources.

You can disable WP-Cron by editing your wp-config.php and adding the following line;

define('DISABLE_WP_CRON', true);

If your site is hosted on Ecenica web hosting you can create a cron job and run wp-cron.php every hour using the following command:

wget https://www.yourwebsite.com/wp-cron.php > /dev/null 2>&1

Replace www.yourwebsite.com with your web address

The cron job will ensure your WordPress site’s scheduled tasks get completed, such as scheduled posts, WP super cache garbage collection, etc.

Avoid plugins that cause high-CPU load
Over the years Ecenica customers have reported high-CPU load problems with the WordPress Plugins below.

(Alternative plugin shown in brackets)

If you’re using any of the plugins above we recommend checking you’re using the latest version of the plugin. If an update isn’t available we recommend disabling the problem plugin, switching to an alternative plugin or try using the built-in WordPress features. For example, WordPress has incredibly good SEO features built-in so you may not need an extra SEO plugin.

Increase PHP Memory Limit
Occasionally increasing the amount of memory available to your WordPress website can help fix high CPU errors in WordPress. We recommend increasing your PHP memory to at least 64MB, and recommend 256MB. Check your web hosting package for your current PHP quota.

Enable Ecenica CDN
Ecenica CDN (Content Delivery Network) powered by CloudFlare® can improve the performance and security of your WordPress website by automatically caching your websites static files across a global network of custom-built, super-modern data centres. If your site is hosted our cPanel Hosting service or Managed VPS services with cPanel your can enable Ecenica CDN through your cPanel control panel. If you’re hosted on Windows, please open a new support ticket and we’ll setup Ecenica CDN on your site for you.

Upgrade your Web Hosting

If you’ve tried all the above and your WordPress is still slow it’s probably time to upgrade your web hosting. Upgrading to a new web hosting plan with more PHP memory, faster MySQL and better CPU can speed up your WordPress site considerably.

Our WordPress Hosting are fully optimised to run the latest WordPress and go beyond WordPress minimum requirements.

For more power and performance see our Business Web Hosting packages with SSD’s which offer 20x performance over standard web hosting. They also come with Nginx which WordPress recommend over our standard WordPress Hosting.

Tip! Bookmark this page to keep track of the latest WordPress high-CPU fixes and WordPress Plugins.