High CPU usage can wreck your site’s performance in Google search.
Slow site= high bounce rate, low dwell time, and insane pogo-sticking.
All of these crucial UX metrics combined result in a site that’s not performing in search and that is sliding ever lower down the SERPS.
If you’ve been suffering from high CPU usage for the WordPress site then my guide can help you reduce the problem or even eliminate it completely.
What is the Main Cause of High CPU Usage in WordPress Sites?
It’s bad hosting, pure and simple.
More specifically, 90% + of all high CPU usage problems arise from sites being hosted on cheap and terrible shared hosting.
Cheap shared hosts have strict CPU limits (though they often neglect to tell you that) and if your site crosses the mark you get a slow and unresponsive site, or it simply goes down and refuses to load.
The solution is to migrate to a faster host (we’re on Cloudways cloud hosting) and this will solve most of your problems.
However, hosting isn’t everything and there are more ways to reduce CPU usage for WordPress sites, yes, even on shared hosting.
23 Ways to Reduce CPU Usage in WordPress Starting Today!
Note: if you can’t afford to switch hosting, then at least do as many of these steps as you can.
It’ll help you speed up your site considerably.
#1- Check Your Website’s CPU Usage
The first thing you need to do is check your site’s current CPU usage.
After all, you can’t improve something before you measure it and know exactly where you stand.
All hosts show you your current CPU usage, usually inside the cPanel.
Here’s what it looks like on HostArmada.
Of course, since we’re not hosted on HostArmada, the usage is 0%.
And here’s what it looks like on Cloudways, our current host.
#2- Remove and Replace Resource-Intensive Plugins
Plugins are what make WordPress great. However, they’re also what makes it super slow if you go overboard.
Your job as a webmaster who wants to speed up their site is to find resource-draining plugins and then remove and/or replace them.
Some of the common culprits (plugins) of high CPU usage in WordPress are:
- Social sharing;
- and Page builder plugins.
Also included are plugins that constantly run online scans of your site, good examples being Broken Link Checker and security plugins like WordFence, MalCare, iThemes Security Pro, etc.
To find the exact culprits on your site use the Query Monitor plugin.
Note: Simply install the Query Monitor plugin and no need to set it up. It works out of the box.
To see the plugins that put the most pressure on your hosting server go to “queries by component”.
Next, you need to remove the offending plugins and either run your blog without those functionalities or find more lightweight replacements.
#3- Remove Page Builders – or Replace if You Must Have Them
Hey, I get it.
Page builder plugins are awesome. They give you the ability to create a unique site without having to pay a costly pro designer. And you don’t need to know even a sliver of code to create a great-looking website.
So much so that they can single-handedly significantly slow down your site and cause high CPU usage in WordPress.
What’s the solution, then?
The best thing to do when it comes to speed is to remove all the bloated page builders and rely on your premium theme or light-frontend-footprinted page builders like Oxygen page builder to give you a beautiful site.
However, if that is not an option for you, then consider using Oxygen which is the fastest of all page builders
#4- Cleanup Your WordPress Database
Another WordPress high CPU usage fix is to clean up and optimize your database.
- Trashed content;
This is all junk that’s clogging your WordPress site and blowing up your CPU usage.
Fortunately, the solution is simple. if you’re using WP Rocket (you should) go to Settings > Database and select it all to be cleaned up.
Afterward, schedule for the plugin to clean up the junk every 2-4 weeks.
Pro-tip #1- it might be worth keeping post revisions in case you ever want to revert some posts to their previous versions.
Or at least take a backup whenever you’re doing a major revisions purge.
Pro-tip #2- if you don’t have WP Rocket then use WP-Optimize, a free plugin that does the same thing. We have a detailed WordPress Database Optimization guide for you.
#5- Upgrade to PHP 7.4 or later
Newer PHP versions are always faster and more secure than the previous ones.
The problem is that cheap hosts skimp on upgrading PHP for as long as they can (it’s expensive for them) and this puts your entire site at risk.
Hackers love breaking into sites running on outdated PHP versions. and in fact, a common sign of a hacked site is extremely high CPU usage.
You have 2 options here.
Either ask your hosts to upgrade PHP for you, or transfer your site to a host that lets you manually update PHP to any version you want.
For example, we at technumero.com are on Cloudways and run the PHP 7.4 version.
They recently introduced PHP 8.0 and 8.1 but we’re waiting to see if some compatibility problems surface with other users.
No need to hurry as PHP 7.4 is both super fast and super safe.
#6 Offload as Much as You Can To Your CDN
Please tell me you’re using a CDN.
I certainly hope you are.
Because CDNs can take the bulk of the pressure off your server and significantly lower CPU usage in WordPress sites.
In other words, using a high-quality CDN will make even-slow shared hosting reasonably fast.
As for which CDN to go with… here’s a list of Premium CDNs to check out.
If you’re in a hurry, we are hosted on BunnyCDN and recommend it to anyone who is looking for the best CDN service.
Super value for money, pay-as-you-go, and really does speed up a website considerably, regardless of the host you’re on. Bunny.net is lightning fast and costs only $1 per month.
Take a look at how one of our heaviest pages performs in GTMetrix.
Note: if you’re using WP Rocket it’s very easy to hook it up with Bunny CDN so that they work in conjunction at speeding up your website.
Here’s an official tutorial from CDNBunny that can help you.
#7- Disable WordPress Heartbeat
The WordPress Heartbeat API shows you in real-time when other users are editing posts + important plugin notifications.
This is a feature most webmasters don’t need so they can safely either reduce heartbeat or downright turn it off.
It’s an easy way to save up on server resources and lower the amount of CPU used in a WordPress site.
How to turn off WordPress heartbeat?
There are 2 ways.
First (free)- use the Heartbeat control plugin (developed by WP Rocket) to turn it off.
Second, use the WP rocket itself. It has the feature built-in so no need to add one more plugin to clog up your dashboard.
#8- Disable Usage Tracking
Some plugins want to collect user data that they can use to improve their products.
This helps them run their business more efficiently, but it doesn’t help you in any way. In fact, it puts a tiny bit of extra pressure on your CPU and server.
So make sure not to allow any statistics to be gathered from your WordPress site.
For example, here’s how the WP Rocket plugin politely asks to give it access to gather anonymous data.
Say no to those requests.
#9- Disable Unused Plugin Functionalities
If you have a Swiss army knife of a plugin installed, make sure you’re actually using it to the fullest. If not, then disable the features you don’t need.
For example, common features-heavy plugins are Elementor, JetPack, and Yoast…
Here, we use RankMath Pro on this site and as you can see from the image below, most of the features we don’t need, and hence are turned off.
This saves quite a bit of server resources.
#10- Disable Resource Intensive WooCommerce Features
Note: because of the nature of WooCommerce sites, they require more firepower right off the bat.
That’s why cloud hosting is the best type of hosting even for a new Woocommerce site without a lot of traffic.
Normal blogs can live on shared hosting for a while before they start getting significant traffic and need to upgrade.
eCommerce sites don’t have that luxury.
They need to be put on the fastest WordPress hosting right away.
How to Optimize WooCommerce Site for Speed?
First, use Perfmatters, a premium plugin but totally worth it.
With it you can:
- Disable WooCommerce widgets;
- Disable WooCommerce cart fragments;
- Disable WooCommerce status metabox;
- Disable WooCommerce scripts and styles;
- Disable automatic product feed plugins.
Pro tip: if you’ve made the mistake of starting a WooCommerce store on shared WordPress hosting, then these 2 plugins can help a lot.
#11- Check to See if Your Caching Plugin is Causing High CPU Usage
Sometimes, the cure hurts more than it helps.
Caching plugins like WP Rocket or W3 Total Cache are meant to boost the speed of your WordPress installation.
But on rare occasions, they end up causing more trouble and high CPU usage.
Here’s what WP Rocket has to say about it
“Occasionally some of the options on the File Optimization tab, such as Remove Query Strings, or Minify/Combine can cause high CPU usage in cases where your site has a lot of CSS or JS files. Try disabling these options and then monitor your CPU usage.”
Note: to know for sure whether your caching plugin is causing higher CPU usage, measure the site with and without the plugin. Follow #2- for how to test the resource usage.
You might need to check over a period of a week to know for sure as CPU usage naturally tends to fluctuate quite a bit.
#12- Add a Firewall
Website firewall boosts security and reduces high CPU usage by preventing hacking and DDoS attacks.
Firewalls come attached to all premium security plugins and you definitely should have one installed as ~ 30 000 WP sites get hacked per day.
Don’t let your site become a statistic.
#13- Increase Connection Limits
The connection limit is the threshold on how many new IPs can interact with your host’s server in 1 second.
More is better as it relaxes the server and lowers CPU usage.
Most cloud hosting providers let you manually change connection limits, while with shared hosting you have to demand the change.
Here’s what it looks like in Cloudways.
#14- Block Bad Bots
52% of the web traffic is bot traffic.
And had you checked your log files (I’m sure you haven’t, as who does that? Only nerdy SEOs!) you would’ve seen a bunch of bots hitting your pages from all sides.
Some of those are good bots like Googlebot, Microsoftbot, Ahrefsbot …
But others are bad bots that are there to scrape your site’s content, find a weakness and exploit it, implant malware, try and log in to your site…
These bad bots need to be defeated.
The easiest way to counter this problem is to use Cloudways hosting as they have inbuilt bot protection services.
The second way to block bad bots is to use a premium security plugin like iTheme Security Pro. Apart from blocking bots the plugin also offers many premium features such as Stops automated attacks, monitoring of suspicious activity, scanning for vulnerable plugins and themes, and much more.
If you are looking for a free alternative then the easiest way is to use the Blackhole for Bad Bots WP plugin.
This plugin sets a simple trap for bots (via a nofollow link in the footer of the page) and when they fall into it, they’re permanently banned from accessing your site.
It works, but it’s not ideal because you can’t predict how some good bots will behave. If one of those falls into this trap then it’ll be permanently banned from your site and you’ll miss out on the benefits of having it crawl your site.
For example, if Google-bot gets banned, you could drop out of the index because Google suddenly can’t index your site.
#15- Replace Cron Job
wp-cron usually loads on each page load and schedules automated tasks like:
- sending email notifications;
- checking for theme and plugin updates,
- publishing scheduled posts;
This puts a lot of unneeded stress on your server.
Instead, you can schedule it to run every 90 minutes or so.
To Disable WP-Cron simply add the code you’ll see below to your wp-config.php, right before where it says “That’s all, stop editing! Happy blogging.”
However, your website still needs those functionalities so you need to replace wp-cron with a real cron job.
So, you can set it to run every 90 minutes, or maybe even higher if you don’t have a lot of scheduled tasks.
Every host has their own tutorial, but here’s a guide from Cloudways that can help you.
#16- Protect Your WP Admin
Bots that try to log in to your site nearly always target your admin login page which is yourdomain.com/wp-admin.php
Moving your login page removes lots of pressure from the server and will give you another layer of protection from getting hacked.
#17- Minimize Third Party Requests
- Google Fonts,
- Facebook pixel,
- Embedded YouTube videos, etc.
All of these third-party scripts slow down your site and increase CPU usage.
And your site needs those in order to be usable and also to help you become a successful blogger.
Luckily, they can be optimized.
The very basic thing you need to have is WP Rocket which can lazy load Gravatars and YouTube videos for you.
#18- Optimize Images
Images are a known site speed killer.
Luckily there are plenty of ways to optimize them for speed, performance, and optimal CPU usage.
Here are some of the things you can do:
- Lazy load images;
- Resize large images to be smaller;
- Specify a width/height in the HTML for images;
- Losslessly compress images (I recommend ShortPixel);
- Use Next-gen formats – WebP is better and faster than JPEG/PNGs;
- Use hotlink protection- available with Cloudflare free account and WP Rocket. Prevent people from “borrowing your images” and sucking away your bandwidth.
- Use a CDN- CDN removes lots of strain on your host’s server leading to faster load times.
Do all of these to see maximum gains, and using a CDN and resizing images is probably the most impactful.
Read the following guides for more image optimization –
- How to Defer Offscreen Images in WordPress by Lazy Loading Images
- How to Optimize Images in WordPress
- 7 Best Tools to Resize Images in Windows 10 – Batch Resize Images
#19- Block comment spam
Having lots of spam comments clogs up your comment section, looks demoralizing, AND affects your CPU usage negatively.
Fortunately, it’s easy to combat it.
#20- Choose Lightweight Themes Over the More Bloated Ones
Some themes are built for speed, effectiveness, and efficiency, while others take the approach that more=better and comes with every bell and whistle you can and can’t imagine.
Pick the former for a much faster site and lower CPU usage.
Check out this list of the best WordPress themes for a spark of inspiration.
#21- Delete Unused Plugins and Themes
Both unused themes and plugins store preconfigured settings. These can cause problems and slow down your site and should be deleted.
Pro tip: Always have one backup theme ready. It’s because if your main theme fails for some reason (for example faulty update), WordPress will automatically activate the backup theme so that your site at least has something to show for the visitors.
#22- Disable xmlrpc.php with/without a Plugin
XML-RPC is a specification facilitating communications between WordPress and other tools. This communications standard used HTTP as a transport method and XML as an encoding technique.
The main reason you have to deactivate xmlrpc.php on your WP site is that it increases security risks, which can be exploited by hackers.
How to Disable xmlrpc.php in WordPress
You can disable xmlrpc.php on your WordPress using the plugin called Disable XML-RPC.
If you do not want to use the plugin use the following code to
Disable xmlrpc.php in WordPress via .htaccess or
<Files xmlrpc.php> Order Allow,Deny Deny from all </Files>
Disable xmlrpc.php using a PHP filer
add_filter( 'xmlrpc_enabled', '__return_false' );
#23- Host Download Files on Dropbox or Google Drive.
Dropbox and Google Drive have unlimited bandwidth and storage, while your hosting account does not.
If you offer large files to visitors to download, make sure you place them in Dropbox and Google Drive.
You can also use plugins like WP Offload Media to store your large media files on Amazon S3, DigitalOcean Spaces ($100 Free Credit), and Google Cloud Storage services.
This will relax your server quite a bit and lower CPU usage.
And it’ll be a better user experience for the users, as speed is everything.
The best way to reduce high CPU usage in WordPress sites is to switch to a better and faster WordPress host.
Simple as that.
However, if you can’t afford it, the second-best way is to do everything mentioned in this guide.
Don’t do just one or two things, do everything and you will lower your site’s CPU usage.
Let me know what you think in the comment section below.
Happy to help you out.
Reducing CPU Usage in WordPress Sites FAQ
Where can I See My Current CPU Usage?
All reputable hosts show you your current usage of CPU, and bandwidth disk space. This info is usually found in cPanel for shared hosting or in custom hosting interfaces for premium hosts like Cloudways.
Do I Need to Turn off XML-RPC?
XML-RPC is an outdated technology and a part of your WordPress installation you definitely do not need. Read more details in the guide on how to disable XML-RPC with or without plugins.
Does Elementor Cause High CPU Usage?
Almost all page builders are resource-intensive plugins and Elementor is no exception. Using Elementor will cause your site to consume more CPU than if it were not using it.
How do You Monitor Which Plugins Cause High CPU Usage?
Use a plugin called Query Monitor. It’ll show you the slowest plugins and then it’s just a matter of replacing them with faster variants. Note: ironically, Query Monitor is by itself a resource-draining plugin. Make sure you disable it after you’ve used it to discover the slowest plugins on your site.
Does Divi Cause High CPU Usage?
Most page builders are highly CPU-intensive, and DIVI is no exception. DIVI will utilize a great deal of your CPU. We recommend you use a block-based plugin instead of a page builder.