WordPress is the most renowned platform for professional blogging as well as server-related problems. If you were using WordPress on shared hosting for a while, I’m sure that you might have come across CPU-related errors. WordPress is so-called the most notorious CMS to handle CPU resources.
Here we’re dealing with tips to reduce CPU usage on WordPress blogs. This WordPress high CPU usage fix guide has been proven with my own experiments and I run high-traffic blogs in shared hosting without any excess CPU issues. I assume that you are on a shared server and learned the basics of WordPress and cPanel.
Table of Contents
WordPress High CPU Usage Fix: 7 Unbeatable Ways
1. Remove Unnecessary Plugins
This might be the first point you would ever see in WordPress CPU optimization. Plugins are the most resource-eating materials when it comes to WordPress. Hosting companies usually suggest a maximum of 3 or 4 plugins but in the live case, it isn’t possible unless we run a story narration blog.
Since we are solely depending on plugins to automate certain processes, it’s really hard to find the plugins which should be avoided.
In this scenario, we must compromise on visual effects and should focus on blog optimisation. ie., concentrate on necessary show-ups and avoid eye-catching sliders, related posts plugins, etc.
In order to find the most resource-consuming plugin, you can try P3 Profiler1 (Which is again a plugin :P). It accurately measures your server resource from head to toe from the plugin’s side and shows the results in the form of easily understandable charts.
Try to avoid the use of badly coded related post plugins. Related post plugins have many issues. Even good plugins in this category like ‘Yet Another Related Posts Plugin (YARPP)’ has many issues.
Many web hosts have banned its use in shared hosting plans. It resulted in a high load of CPU and increased query time. Think before using them. I suggest you use the nRelate Related Posts plugin instead of YARPP.
Uninstall this plugin after finding which plugin lags your blog. However, you can re-install this whenever you want to check the resource again.
2- Using Cache Plugins
W3 Total Cache (W3TC) and WP Super Cache are the most effective cache plugins I’ve ever come across. Though some people suggest WPSC, I should recommend you install W3TC as it’s loaded with advanced options like minification, database cache, page cache, cache purging, CDN optimization, CloudFlare integration, etc.
After installing either of these plugins (Preferably, W3TC), configure every option from its dashboard. It can also be used to flush your temporary DNS cache which is very helpful during wherein DNS propagation period.
3- Using CloudFlare
CloudFlare is a free blog optimization service that can also be considered a basic CDN service. Don’t expect too much from their CDN as it accelerates your blog without any bucks. However, you can significantly improve your page loading speed and CPU load.
It works as an intermediate between the blog and the server. Whenever a user requests a page, CloudFlare provides the page without letting the blog from accessing the server contact. It automatically catches your pages from the server side and stores in its own large data servers.
Let’s see an example. Suppose you are going to get some milk from a cow (Physically). How it would be if you get the milk from a milkmaid which has already been taken from the cow? Isn’t it easy? It literally reduces the load of “cow” (Server here) from frequent disturbance. It also provides faster access and you don’t have to walk longer.
In the same manner, CloudFlare grabs your pages from the server and stores in a place (Data centers) where they can be accessed quickly without pinging to the server. That’s all.
4 – By Optimizing Cron Jobs (wp-cron.php)
Cron Jobs are specially assigned programs to ping the server automatically when there arises a page request. By default, Cron Jobs ping servers in a certain interval of time which causes extra load on the server. Fortunately, it isn’t a must-do action at all. So you can regulate the time interval of pinging to a higher limit.
It noticeably reduces your server resource from the back end. Let’s have a look at wp-cron pinging effect.
If you are getting 50 visitors to your site every hour, and each of them reads 2-3 pages, then wp-cron.php is being called:
50 x 2.5 = 125 times per hour
125 x 24 = 3,000 times per day
3,000 x 30 = 90,000 times per month!
If you have added something on your PHP to load from an external source and the external site is down then your page will also load slowly.
How to Optimize wp-cron.php?
First, you need to stop wp-cron.php from running on every page view. Do this by opening the file wp-config.php (found in the folder where WordPress is installed) and adding the following line close to the top of the file:
What that does is tell the WordPress engine not to run the wp-cron.php script on every page view, essentially it disables it. Second, you need to create a way for the wp-cron.php file to run on a regular basis. Usually, the best way to do this is a normal cron job. Create a cron job in cPanel that runs every hour and have the cronjob run this command:
wget -O /dev/null http://www.example.com/wp-cron.php?doing_wp_cron
Replace www.example.com with your blog
4 – Using Light Loading Themes
Simple, elegant themes can invisibly reduce your database call by a great amount. There are plenty of WordPress themes that boast infinite add-on features like inbuilt sliders, ad boxes, related posts tweak, subscription pop up, etc.
Keep in mind that in accordance with the number of features you use, the chances of high server load are high. I personally suggest Genesis Framework as it’s running on thousands of authority blogs.
5. By Correctly Optimizing WP Database
Databases are something that is very important to every blog. It contains all your posts, comments, metadata, etc in tabular form. It is indeed a MySQL section.
A poorly optimized database table can annoyingly hamper your blog. It uses unnecessary space to store unwanted files which will certainly lag your blog.
WP-Optimize is a great free plugin to remove post revisions, spam comments, unapproved comments, tables, etc. You can save a hell lot of space by just running this cool plugin. Remember, a properly optimized database ensures the maximum possible speed apart from the server side.
6. By Compressing/Merging Existing Images in your Posts
There’s a saying ” A picture can speak a thousand words”. When it comes to blogging, images are the most important factor to grab the attention of the readers. On the other hand, it can also be used to gain entry search engine traffic by correctly rendering Alt tags.
But excessive insertion will not only slower your blog but also turns into a nuisance to your loyal readers. Whatever it may be, you may reduce the maximum number of picture additions in your blog. Alternatively, you can host your all images in a subdomain which won’t affect your page speed, hence faster response from the server.
Most hosting companies provide image optimization tools in cPanel. You can either depend on any of these free tools or use any 3rd party apps. Also if you are posting long articles which possess dozens of images, you can split the post to 2 or 3 pages with respect to the length of the article. This method can also be used in the comment section if you are getting hundreds of comments in each post.
7. Frequently updating files
Many plugins release newer versions in certain intervals of time. Some themes also update as well. Here, if you don’t update these functions properly, it will automatically surpass update requests whenever you load your blog. So update every plugin and theme (including WordPress) as fast as possible.
In short, Always update everything. If there is an update available, you should always go for it. Updates contain security improvements and bug fixes.
Here I’ve mentioned the top 7 tips to reduce CPU usage on WordPress blogs. There are so many tiny tips that will help you to build a shared hosting blog apart from this. Just implement it and get rid of server errors. I expect your valuable comments and feedback for this article. Also, take a while to share this post as well. Happy blogging.:D
- From 10/13/22 this plugin is no longer available. ↩︎