5 Ways To Increase The Loading Speed Of A WordPress Blog

ADVERTISEMENTS

This is a guest post by Aseem from Online Tech Tips. If you are interested in writing a guest post too, let me know

WordPressRecently, an article of mine entitled “How to track the original location of an email address” was Dugg on Digg and got the most Diggs I’ve ever received on an article with over 1800! It was a great experience except for the fact that my web site kept crashing and displaying “YOU HAVE EXCEEDED YOUR CPU USAGE” to all of my visitors. This was not only embarrassing, but I’m sure it turned off a good number of visitors! In order to rectify the situation without switching hosting companies (that was really not the problem), I decided to try and optimize my WordPress blog as much as I could. After a few days of tweaking and fiddling, I got Dugg again and this time did not go down except for once for a minute. Not too bad for making some pretty simple changes. So here are a few tips you can use on your own blog to make it run faster than it is now!

  1. Deactivate plug-ins that are not necessary - The good and bad thing about WordPress is that you can install a crap load of plug-ins! These are great, but too many and your site is slow as molasses. I got rid of a bunch like MyAvatars, Recent Comments, Top Commentators, etc. For some blogs, it might be worth it, but for most I think that as long as your content is good, your visitors certainly will not leave you just because you don’t put little icons next to their names!
  2. Reduce HTTP requests - Most people forget that no matter how small an image may be, it’s still a request and that takes a certain amount of time. Reduce the number of images on your blog theme if you have the technical knowledge to do so. Or go with a simplistic theme. Also, get rid of any of those “badges” or “buttons” on the side that show everyone your ranking. No ones cares except you and it costs you multiple requests! I’ve seen some blogs with tons of them!
  3. Use WP-Cache plugin - This one everyone knows and probably already uses, but it’s still worthwhile to mention. Definitely install this plug-in as it greatly reduces the load on your servers.
  4. Enable GZip with WP-Cache - Most people know about #3, but what about gzip with WP-Cache. By default, you have to turn off gzip when you’re running WP-Cache. However, that doesn’t mean you can’t use it and you definitely should be since it reduces the size of all Javascript and CSS files.You can find out how to enable gzip with WP-Cache by reading more here.
  5. Remove unnecessary dynamic PHP calls - I saved the best for last. This single tip helped me increase the load speed of my blog by almost 25%. Have you ever looked at your header.php, footer.php and single.php files? There are filled with tons of PHP function calls to write out the same information each time over and over again.For example, the HTML that ends up being your blog name and title is written like this:

    <?php bloginfo(�name�); ?> <?php bloginfo(�description�);?>

    Simply replace the PHP calls with static HTML. I replaced well over 10 useless PHP calls on my blog, including the following:

    /favicon.jpg� />
    �/>
    � />

    To get this information, simply open one of your pages and click View - Source. Then find the outputted value and go into your Admin panel to Presentation and then Theme Editor and replace the PHP code with the static values. Go through all of your PHP files and see what you can replace that mostly remains static, i.e categories, etc.

There are many more optimizations you can make including SQL caching, Apache optimizing, etc, etc but those were all too technical for me. I could handle the stuff above and it saved me quite a bit on load time! Hope it helps you too!

banner

Search JohnTP.com or view a random post

To receive this blogs articles for FREE on your email inbox, just enter your email address below and click 'Go':

Enter your email address: or .

Find out what I am doing currently by .

25 responses so far, Leave a comment

  1. 1

    Rob Malon - Automating Websites

    October 24, 2007 at 10:53 pm

    To clarify your 4th tip. Enabling Gzip will actually increase your server load and CPU usage. Gzip compresses the page on the server side before it displays it to the user. Its main resulting function decreases the amount of bandwidth you need to serve to the user (and the amount they need to download). I’ve found that this only matters for dial up users which are few and far between these days. So the extra stress on your server isn’t necessary unless bandwidth is in short supply. Which in recent years has been no problem as it gets even cheaper.

  2. 2

    baghy

    October 24, 2007 at 10:59 pm

    hi John. I just want to say that I like a loot your blog and the way you write the posts. Everyone can understand.

  3. 3

    James Armstrong

    October 24, 2007 at 11:07 pm

    Good list, WP-Cache is a fantastic plug-in, even for small or new blogs.

  4. 4

    AR Web

    October 25, 2007 at 12:26 am

    Thank you for the list its great, I knew about wp-cache and the deactivating the plugins but the rest were quite helpfull.

  5. 5

    Dean @ Technical Itch

    October 25, 2007 at 2:35 am

    I’ve been meaning to do #5 for a while now but didn’t realise it would offer such an improvement. 25% is impressive.

  6. 6

    Madhur Kapoor

    October 25, 2007 at 3:57 am

    Nice tips , i didnt know many of these.

  7. 7

    Mike

    October 26, 2007 at 12:59 am

    Activating WP_cache only makes my blog load slower… And I’ve read that other people had the same problem too. So I’d recommend using it only in case of need, like a digg/slashdot/etc spike

  8. 8

    Ronald

    October 27, 2007 at 9:29 pm

    I thought the WP-cache is good for a blog that have more that 3000 visitor/day?

  9. 9

    Andrew

    October 27, 2007 at 11:28 pm

    These are all pretty tips John. Do you have any stats about the loading time and how much difference these things made?

  10. 10

    David Bradley

    October 29, 2007 at 5:29 pm

    wp-cache is the only essential one if you anticipate a CPU overload in the future. My host told me that running that plugin would suffice when one of my posts on Sciencetext got Stumbled heavily and had 45000 visits in an hour…

    db

  11. 11

    David Bradley

    October 29, 2007 at 8:16 pm

    Despite what I just said…I felt inspired by your post, which offers some good solid advice. I went through my plugins and disabled 3 that were really not doing very much for the site at all. I also took the advice in item 5 and hard-coded the calls to various files, such as CSS and feed. Finally, I double-checked that wp-cache is running and found, much to my chagrin, that it was not!

    My own spin on creating a site that is Digg resistant can be found here from June, in case you’re interested. Of course, I also wrote a tongue-in-cheek post some time ago about why bloggers should avoid social bookmarking sites in the first place (a post that got a lot of flack back in May.

    db

  12. 12

    CypherHackz

    November 10, 2007 at 10:17 am

    WP-Cache is very useful plugin though. It really incress the speed for my website to load up. Very cool plugin. Recommended!

  13. 13

    Stephen Cronin

    December 27, 2007 at 9:03 am

    Some useful tips here, but to expand on the first comment, there are really two different things we’re talking about here:

    1. server load (ie exceeding CPU usage)
    2. page load time for the reader

    Some of the tips will help issue 1, some will help issue 2. The title of post indicates this is about issue 2, but the intro is really about issue 2.

    So useful tips, but the purpose of the post is confusing…

  14. 14

    jen

    January 16, 2008 at 12:25 pm

    I just got my first CPU overload message (that I know of anyway) and it freaked me out because I never thought this would happen. Of course I’m trying to find out how to rectify and these tips will help. Thanks.

  15. 15

    david

    April 16, 2008 at 9:06 pm

    my site has been loading slowly for the past couple days ever since I’ve been working on the design. How do I go about doing step 5? what exactly are the static values for php?

  16. 16

    Vladimir Kosinets

    May 8, 2008 at 4:13 pm

    Using WP-Cache you’ll increase load speed because you’ll reduce page generation time. The HTML will be generated when the first user comes to your page. The it will be stored on the server. In the future when users request this page the HTML won’t be generated again. It will be taken from the cache directory.

    This means that no body except the first visitor will wait until the HTMl is generated. This means that there is no reason to (#5) remove necessary php includes from your templates. Also there is no reason to remove plugins like Recent Comments. The HTML generated by such plugins will be cached too.

    The main things you should care of are:
    - caching with WP-Cache
    - gzip / compress css and javascript
    - use server-side gzip encoding for HTML also
    - image combining

  17. 17

    MoiN

    May 24, 2008 at 11:31 pm

    Nice write, John :)

    Implemented a few since I needed these (After confronting the digg effect :S)

  18. 18

    Patrick

    June 2, 2008 at 1:35 am

    my tipps:
    - reduce the requests with css- and js - files
    - reduce images
    - optimize all images (reduce the size from the images, maybe reduce the compression)
    - use a php accelerator

    than is wordpress very quick :-)

  19. 19

    zplits

    June 16, 2008 at 7:39 am

    Hello John, good day!
    You really have a nice articles. Could you please clarify what should we change? I mean in this code:

    What should we change in there to make it static? and which .php files contains it.

    Thank you very much.

Have something to say?




Copyright ©2005-2008 JohnTP, All rights reserved.