How To Fix High CPU Usage In WordPress

How To Fix High CPU Usage In WordPress

This article will take you through some methods to fix common causes of high CPU usage in WordPress. 

Update WordPress 

This is the easiest fix, so it’s best to start here before getting into the more complicated ones. 

Missing a major WordPress update will cause your site to perform sub-optimally and, in turn, create a greater CPU load on the host server. 

Luckily, updating WordPress is as simple as a single click! Simply go to Dashboard>Updates. Here you can see if there’s a new version of WordPress available to be installed. Click “Update Now”, and you’re good to go!

Check your plugins

Plugins are one of the most common causes of performance issues in WordPress. There are several ways plugins drain your CPU resources:

  • Some plugins run constant background tasks
  • Some plugins might be out of date or not running a stable version 
  • Some plugins come with a load of features and settings you don’t use but that are still running in the background
  • Plugins can implement redirects that cause a redirect loop

You can use the WP Hive Chrome Extension to check the impact your plugins are having on site performance. Or you can do it the old-fashioned way by disabling plugins to see what impact that has.

Make sure your site is optimized

If your WordPress CPU usage is up to 90+%, then it’s most likely caused by hosting or traffic spikes, and you should address those areas first. However, it’s always a good idea to streamline your site and reduce the CPU load with some simple tips to speed up your WordPress site. These include:

Disable WP-CRON

Cron is a command line utility that schedules tasks to be performed automatically. These commands are known as “cron jobs”. In WordPress, cron jobs are handled by WP-CRON. However, WP-CRON is simply a function that WordPress uses to imitate the functionality of a real cron job. 

WP-CRON can cause performance issues because it fires every time a page is loaded instead of on a defined schedule. This means that with high traffic, WP-CRON is checking for scheduled events each time someone loads a page and putting extra strain on the server. On the other hand, if the site doesn’t have very much traffic, a scheduled event might be missed if nobody loads the page. 

For a lot of people, it’s better to simply disable WP-CRON and use a real cron job instead. 

How to disable WP-CRON

To disable WP-CRON, you’ll need to edit your wp-config.php file and add this command:

define('DISABLE_WP_CRON', true);

Put it just before the line that says “/*That’s all, stop editing! Happy publishing. */”.

How to make your own cron jobs

Disabling WP-CRON only stops it from executing automatically, but you can still set up real cron jobs that

[…]

 



This article was written by Luca Reale and originally published on WP Mayor.

Disclosure: Some of the links in this post are "affiliate links." This means if you click on the link and purchase the product, We may receive an affiliate commission.

Leave a Comment

Your email address will not be published. Required fields are marked *

Show Your ❤️ Love! Like Us
Scroll to Top