Site icon Site Hosting Club

Fix High CPU usage in WordPress

Problems with CPU usage are common with WordPress websites. When you use shared resources or a hosting package with few resources, they become more common. A good hosting plan can still have CPU use, though. Your website will become significantly slower as a result because there won’t be any resources available to serve content to it.

How to Fix WordPress High CPU Usage Problem in 2023

By reading this article, you will learn to solve the problem of having high CPU usage in WordPress on your own. Besides, you can check out our Hosting services for more information. There are several ways that we recommend you to use:

Update WordPress

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

Update 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.

Avoid beta 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 or WP Rocket (recommended) can dramatically reduce CPU load by caching static copies of your pages on your webspace. Static files use less CPU and memory. Keeping you within your shared hosting limits.

Caching Plugins like WP Rocket also tends to cause High CPU Problems due to their cache preloading features and minification/combining features. Refer to this article to fix high CPU Usage problems caused by caching plugins like WP Rocket.

Disable WP-Cron

WP-Cron manages all the scheduled events on 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 it 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;

1 define('DISABLE_WP_CRON', true);

You can create a cron job and run wp-cron.php every hour using the following command:

1 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.

 

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 resource-hungry plugins

If using WooCommerce, or similar resource-hungry plugins, make sure your web hosting has sufficient resources.

If you’re running CPU and Memory intensive plugins on a standard shared-hosting, or budget VPS hosting you may find your site performs badly due to insufficient server resources. Symptoms include slow loading pages, database errors, and increased visitor abandonment.

With many web hosts, if you try running CPU-intensive WordPress plugins on a shared-hosting package you risk your site being suspended due to high-CPU loads.

Avoid buggy WordPress Themes

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:

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.

 

Use the latest PHP

Switching to PHP 8.2 can dramatically speed up your WordPress website, reducing loading time and freeing up CPU and memory. We recommend testing a staging version of your website with PHP 8.2 before changing the production version.

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 256MB, and recommend 512MB.

Conclusion

You can reduce CPU use with the help of these suggestions. However, shifting to a good host may be the best fix you can think of. You also need to ensure that you are not infected and hence taking Security Precautions is a must.

 


 

Liked it? you’ll love our services too. We Provide both Unmanaged Shared WordPress Hosting and Managed WordPress Hosting at affordable rates. Feel free to contact us for more info.

Exit mobile version