Methods To Reduce WordPress CPU Usage

11The users of Zaman-IT.com frequently ask how to reduce your WordPress CPU load without upgrading your web hosting server? The last thing you’ll ever want is a slow server which might affect your Google ranking, a constant server crash (if you’re on dedicated server) or your web hosting company shutting off your blog without warning due to excessive usage. Here are the 7 method I used to reduce my WordPress CPU load and bandwidth without upgrading to a much more expensive server.

CPU Usage- What is it?
The usage that a system’s central processing unit incurs is referred to as CPU usage. A shared server is actually a dedicated or virtual machine, which is divided on the basis of bandwidth and disk space. When this shared server exceeds the CPU usage parameter, the web host will suspend that account temporarily. Hence, if you have a wordpress blog, ensure keeping CPU usage to its minimum.

How to lower CPU Usage?
CPU usage usually depends on the amount of request that your server receives. Besides, it may also depend on the number of people accessing your site/blog at the same time. Whatever the reason may be; your objective is to reduce CPU usage.

Step 1. Remove Unnecessary Plugins

This might be 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 maximum 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 Profiler (Which is again a plugin :P). It accurately measures your server resource from head to toe from plugins side and show the results in in the form of easily understandable charts.

Try to avoid 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 high load of CPU and increased query time. Think before using them. I suggest you to use nRelate Related Posts plugin instead of YARPP.

Step 2. Minimize the number of WP Crons:

The WordPress Cron job is a resource intensive task that runs every single time yourWordPress is accessed.The best way to optimize the efficiency of your WordPress cron jobs is to disable WP-cron and set up a normal cron job through cPanel which will run every 12 hour or once per day.

You can disable WP-cron by modifying the wp-config.php (located in the folder where WordPress is installed). Open the wp-config.php file, add a new line after Step 2 – Insert the following code

1
define(‘ENABLE_CACHE’, TRUE);
Step 3 – Create the cache directory

1
/wp-content/cache/
Step 4 – Change the ‘cache’ folder writable permission to 755 or 777
To set it’s expiration time you can add this line:

1
define(‘CACHE_EXPIRATION_TIME’, 900);
If you’re using Wp-SuperCache of W3 Total Cache, ignore the WordPress Object Cache feature. Last but not least, use a good WordPress theme, choose wisely, a well coded theme will greatly reduce the number of queries, have minimal W3C error and is Google friendly. Insert this quote to find out the number of queries for different themes:

1
<?php echo $wpdb->num_queries; ?>q, <?php timer_stop(1); ?>s

Step 8. Update Possible Functions.

Many plugins release newer versions in certain interval 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 plugins and themes (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.

The bottom line

With every passing day, the technology world is introducing new advancement. And with new advancements, your chances of getting new ideas to lower CPU usage increases too. So, keep yourself updated with the advancements and pave your way to a smoothing performing blog with high traffic surges.

About the Author