9 Methods To Reduce WordPress CPU Usage Without Upgrading Web Hosting Plan

Updated: January 18, 2016 / Home » Web Hosting and Wordpress » Tutorials, Optimization, Hack and SEO

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.

Related ➤ 10 Dedicated WordPress Optimized Web Hosting Server For Speed and Performance

01 – Remove Jpeg and PNG Metadata

Remove the hidden metadata in all of your jpeg images in the ‘upload’ folder. Google doesn’t rely on these metadata on ranking or for keywords, I did a simple test by inserting a unique 10 digit number into a jpeg’s metadata, then I waited for a month and did a quick search for that 10 digit number on Google Images and the result was zero.

8 Methods To Reduce WordPress CPU Usage Without Upgrading Web Hosting

On average, each jpeg consist of 15 to 19KB of metadata. Assuming that average jpeg is roughly 60 to 80KB in size, this translates into a saving of 20 to 30% of bandwidth, not to mention the CPU load. If your WordPress Theme comes with lots of background images, by removing the metadata will greatly affect the overall performance.

I did an experiment on www.homeless.com.my by removing all of the jpeg’s metadata in the WordPress Theme and the bandwidth usage dropped by half, same goes for the CPU load, not to mention the time it takes to load is much more faster than it previously was.

As for PNG, here is a loss-less compression which I used. Not only was the software able to remove the metadata, it did a great job at compressing and optimizing the PNG. The file size is smaller with no visible loss of image quality.

  • PNG Gauntlet (free) – Loss-less compression for PNG and Gif, somewhat slow
  • Stripper (free) – Remove unnecessary metadata from JPG/JPEG/JFIF & PNG files, no loss of image quality

02 – Compress Jpeg

Jpeg itself is a compressed image/format; to further compress it is to reduce the quality of the image, subsequently the size. The average jpeg size in the ‘upload’ folder is about 80KB, by removing the metadata it comes to about 60KB, and by compressing it further with this software I was able to reduce the size to 45KB on average.

Based on my test result using Advanced Jpeg Compressor with 5830 jpeg images – 259MB (Before) vs 105MB (After). That means for every 100MB the server transferred, it was able to save 150MB. This will greatly reduce the server’s load and web hosting bandwidth.

Plugin that does the optimizing job inside WordPress:

03 – Optimize your CSS

By removing unnecessary codes and line breaks, you might have the opportunity to reduce the CSS file size by 50%. Again, this translates into massive bandwidth saving due to the fact that your style.css file is downloaded every time a unique visitor visits your blog. Here is one of my favorite online tool – Online CSS Optimizer or Clean CSS.

8 Methods To Reduce WordPress CPU Usage Without Upgrading Web Hosting

Don’t just stop there, remove and optimize all those unwanted codes from the two most requested pages – index.php and single.php, remove line breaks, empty spaces, comments, redundant codes and many more. This will probably shave off another 10KB. This can be done automatically on the fly with 2 cache plugins:

04 – Outsource All Images via CDN

You can dramatically reduce your CPU load by hosting your WordPress Theme’s images on another server, no plugin or special software required. You don’t even have to spend much on another web hosting plan – simply upload the images to a CDN.

Some argued on the additional DNS connection required, again, based on my test with tools.pingdom.com, my site is faster than before. The best solution going forward is to use a CDN, also known as Content Distribution Network. For small blogs, here are 2 of the more affordable CDN in the market:

Read our previous article on – 5 CDN Comparison MaxCDN, Amazon CloudFront, CloudFlare, CacheFly and EdgeCast. Why use a CDN? Check out the video:

05 – Clean WordPress Options

When you activate a plugin, it leaves a small footprint in the MySQL ‘wp_options’ database. It may be a good idea to clean the WordPress Options database. WordPress Clean Options plugin’s goal is to give users an easy and safe way to get a bloated wp_options table down to a manageable size, thus improving the performance of their blog. Remember to deactivate and delete unused plugins before performing the cleaning up process.

Note: This plugin is somewhat outdated, but it still works. Remember to backup your database before performing any cleaning or removing of data.

06 – Optimize your MySQL Database

Imagine entering a library where books are scattered everywhere without proper archiving. Just like Windows, your MySQL database gets fragmented as time goes by. By optimizing (defrag) your database, WordPress is now able find the bits and pieces faster, this translates into lesser time it requires for the CPU to search and compile the information, thus more time to serve newer queries or request. If logging into your MySQL database is too troublesome, the WP-Optimize plugin does the job right inside WordPress.

8 Methods To Reduce WordPress CPU Usage Without Upgrading Web Hosting

07 – GZip Compression

According to Webo, by enabling Gzip compression on your blog, it will significantly increase the CPU Load while reducing the bandwidth. If you have a fast CPU, by all means go ahead. GZip has its own strength and weakness, the good thing about GZip compression is pages tend to load faster due to the smaller size, on average the the files are 60 – 75% smaller.

8 Methods To Reduce WordPress CPU Usage Without Upgrading Web Hosting

Smaller file size means faster serving/downloading, meaning to say your CPU have more processing power for some other stuff. I guess this is a very subjective topic. Anyway, to enable GZip in WordPress, simply insert this code into header.php, it must be above everything else, not before any other code.

<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>

Alternatively, you can insert this simple Gzip code into your .htaccess file

SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/rss+xml \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/xhtml+xml \
application/xml \
font/opentype \
image/svg+xml \
image/x-icon \
text/css \
text/html \
text/plain \
text/x-component \

Here are three of my favorite GZip site verification tools. Each with its own uniqueness when it comes to the report, such as the speed it loads, method used and many more.

GZip compression are performed automatically by W3 Total Cache and WP Super Cache plugin.

08 – Lazy Load Plugin

Developed by Automattic, the guys behind WordPress. Lazy load images to improve page load times and server bandwidth. Images are loaded only when visible to the user. Very useful for those with lots of images.

09 – Enable the Default WordPress Object Cache

WordPress 2.0 and higher comes with a feature known as WordPress Object Cache, sadly it is not enabled by default, therefore making this feature somewhat of a mystery.

  • Step 1 – Open your wp-config.php file
  • Step 2 – Insert the following code
  • define('ENABLE_CACHE', TRUE);
  • Step 3 – Create the cache directory
  • /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:


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:

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

Test Your WordPress Speed

After optimizing, it is important to test the final outcome. There are 3 web application that does this for free. Google PageSpeed is my favorite.

Remember that speed is important but not the most important factor in ranking.

30 comments on “9 Methods To Reduce WordPress CPU Usage Without Upgrading Web Hosting Plan

  1. Gravatar

    Hey, very helpful post. I’m running 5 photoblogs and my server is crashing almost twice every week. I’m going to try all this on my server and will post my feedback.

    Thank you.


  2. Gravatar


    Thanks for this great article .

    I follow all the point but the cache step didn’t work !

    no files show up in the cache folder .

    do you have any idea why ?

    • Gravatar
      Tutorial [ Reply ]

      great tutorial on Optimize WordPress and Reduce CPU Usage

  3. Gravatar
    TheShadow [ Reply ]

    Thanks for these great tips

  4. Gravatar
    Lyrici [ Reply ]

    Thanks for the wonderful tips

  5. Gravatar

    Wonderful tips. Can’t agree more. Thanks!

    • Gravatar
      Muhammad [ Reply ]

      Other than these methods are there any other ways to reduce my crazy wordpress CPU usage?

  6. Gravatar
    Mark at Worcestershire.net [ Reply ]

    Thanks Geckoandfly.

    I particularly like your tip about outsourcing images.

    I’m finding WordPress consumes huge amounts of CPU and my hosting accounts has threatened to fall over more than once so I am very keen to try some of these tips.

    I’ve also signed up for CloudFlare which effectively hosts a static copy of your content on their servers, with your own servers as a fall back.

  7. Gravatar
    DB Web Development [ Reply ]

    Your images for the CSS and optimize the DB are in the wrong location. Please switch them.

    Great article btw. I have to go thru my option table and see what junk might be hiding there.

  8. Gravatar

    Thanks some tips really helpful for me…

  9. Gravatar
    Best of Android [ Reply ]

    Hey, Very useful information. Thank you so much :) I will follow the above techniques one by one for improving my wordpress blog performance.

  10. Gravatar
    Vishnu [ Reply ]

    Hi i am using the cache tip…but nothing seem to show up in the wp-content/cache folder after adding those lines

  11. Gravatar

    Great tips. Hope these 7 tips can reduce CPU. Thanks.

  12. Gravatar
    Vijesh [ Reply ]

    Hi Ngan,
    These tips are really useful not only for lowering the CPU Load but I think it also increases the loading of the page. So if we increase our page loading speed we can also get good ranking.
    Thanks for these simple yet effective tips…

    • Gravatar
      Geckoandfly [ Reply ]

      I believe speed is important but not to the exceed of influencing much. Quality contents are more important.

  13. Gravatar
    Imnepal [ Reply ]

    This article is very helpful for me. I am searching article like that. My blog is facing the same problem that you above described. Now I’ll follow the steps. Let’s see what happen. Hope better. Anyway Thanks A LOT. I’ll visit soon after following these suggestion.

  14. Gravatar

    Anyone can prove that removing the META data from images really don’t affect on SEO?
    As I’m thinking of removing them as well, firstly it reduce my workload of manually inserting them, second is my CPU usage is almost always at 80~100%, I really need to do something about it.

  15. Gravatar
    Ryan M. [ Reply ]

    Really really helpful article, now I have an idea why my site consume 100% of CPU usage. Thanks :)

  16. Gravatar

    I use YARPP and All In One SEO, and my blog hit maximum CPU Usage too often.
    People says I must remove it and change it with another.
    I’ll try it.

    • Gravatar
      Ngan Tengyuen [ Reply ]

      It depends on your web hosting too, if they use a cheap server or cramp too many customers onto a server, you will always experience overload problems. I don think YARPP is the problem.

  17. Gravatar

    Does this include keeping the entry processes being used up in the cpanel hosting?

  18. Gravatar
    Ivonne [ Reply ]

    I’m interested in adding WordPress Object Cache.
    Is it still possible in WordPress 4.* (The latest WordPress version) ?
    Thank you.

    • Gravatar
      Ngan Tengyuen [ Reply ]

      Object Cache via the W3 Total Cache WordPress Plugin? I am not too concern about the WordPress version. Based on my 10 years experience and managing 10+ WordPress sites on various hosting, Object Cache is a big no. Yes, you have speed, but I find the cache can sometimes cause problem with login and more.

      Don’t use Object Cache. Just basic cache will do.

  19. Gravatar
    Widya T Harjono [ Reply ]

    Thanks a lot of…. Its a great article to reduce wordpress cpu usage… i’ll try it….

  20. Gravatar
    Pandu Aji [ Reply ]

    Thanks for this tips! I will try to follow your step

  21. Gravatar

    thanks it helps me .

  22. Gravatar

    Hi, could you explain this part of your article:

    it must be above everything else, not before any other code.

    • Gravatar
      Ngan Tengyuen [ Reply ]

      The first line of your header.php, but the best method is via .htaccess. Almost all cache plugin comes with Gzip feature, this method works if you are not using WordPress, Drupal, Joomla or any other CMS.

  23. Gravatar

    Yes true. Now my Cpu load lower after i read your article.

  24. Gravatar

    How about disable wp-cron and using cron jobs instead?

    My cpu resource constant at 75-100%, after I disable wp-cron, my cpu constant at 0% and when cron jobs running it only hit 25%. I set cron jobs to run twice a day.

    Finally I can save my money because I don’t have to upgrade my hosting plan :)

Leave a Reply

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