Fix high CPU usage problem in WordPress
High CPU Usage Problem in WordPress is one of the well know problems faced by WordPress site owners. Yes, you are not alone in this realm. Every WordPress site especially the one with shared hosting face this problem with its growth. This is most of the time a problem which lies on hosting end but not always. In shared hosting the hosting provider puts a limit on CPU, RAM, Storage and other resources. You must consider changing your hosting plan if the number of visitors to your site increases with time and the server cannot handle them efficiently. This statistics is provided with each hosting plan and you can easily check your server statistics from your Cpanel.
Other Reasons of High CPU Usage Problem in WordPress
Besides hosting, there are also other things which contribute to high CPU usage. In the following lines, we will discuss them one by one along with the solution.
Plugins
If you are using excessive number of Plugins, you should think again whether you really need them or not. Every Plugin comes with its own CSS and JavaScript. These scripts loads along with normal pages of you site. Thus site performance decreases with increase in number of Plugins. So you will have a high load on your server. If the number of Plugins used is less in number then there might be a Plugin which will be dragging server resources. Once this high CPU usage problem happened to one of my sites, the problem over there was OneSignal notification which I was sending from my admin dashboard. As soon as I stopped sending notifications from WordPress dashboard, the server statistics became normal. I did not deactivate the Plugin at all; instead I used to send notification from OneSignal dashboard.
You can very easily identify which Plugin is utilizing high CPU resources. Just deactivate all Plugins and activate them one by one and keep noting the statistics of server. Here is how you will find out the culprit Plugin and fix the problem very easily. There is also a Plugin by the name of “WP Disable” which will identify the resource consuming Plugin.
Themes
Themes also contribute to high CPU usage. A theme with bundle of option included will surely slow down your site and maximize CPU usage. Also themes which do not get updated with times pose this problem. You should always buy a theme and avoid free themes. Most of the free themes do not update and it becomes non compatible with updates of WordPress core files updates.
Search Engine Crawl Rate
Search engine crawl rate is also one of the reasons of slow loading and high CPU usage. Google clearly states to limit the crawl rate if you don’t need it. For example a news or jobs website needs to be indexed as soon as the post is published. Therefore high crawl rate is required for such sites. But those sites which publish a new post per day or per week do not need a high crawl rate at all. And Google states that limiting crawl rate does not affect search engine ranking. So these bots where useful are also dangerous in such circumstances. You should consider limiting crawl rate if you do not need high crawl rate.
Databases
WordPress databases are also one of the reasons of high server resource usage. We should avoid unnecessary database calls. Also when we remove a Plugin, its corresponding database tables are not removed. There is always a risk involved with database table’s removal. Therefore Plugins developer does code for database tables deletion when we deactivate the Plugin. We will have to remove them manually or via a Plugin. This step is very risky and may lead to wesite down. So be careful with this step and take database backup before any change. You can figure out the database table which you don’t need at this time. This table will be having the Plugin name prefix. For example if you have deactivated w3 total cache, the table will be having w3 or total cache etc in table prefixes. But I will again recommend to avoid this step if you are not expert and have not taken database backup. The Plugin used for database cleanup is named as “WP Optimize”.
Non Optimized Images
If the images on your site are not optimized then the site will load slowly and CPU usage will be high. Use optimized images for better user experience. This will also help you achieve best SEO result as fast loading pages are ranked higher. There are many tools available for image optimization. You should compress and shrink your images before uploading it to your medical. JpegMini, Short Pixel, Smush etc are Plugins and tools available for WordPress users.
All the above steps will ensure fast loading of your website and also CPU usage will now be normal. Also these steps will help you good SEO results. As your users will be having good experience with your site and you will ultimately be ranked better. Google loves fast loading sites.