Speed Up Your WordPress Blog

If you think that your blog is loading way too S-L-O-W  then you can check it by taking it  for  a website speed test or a more complete test at pingdom tools or compare your site at webslug

If you are looking for the reason why it might be slow then install the YSlow Firefox add on.    It will analyze your site based on what Yahoo’s rules for high performance sites.

So, why should you care if your site is loading slowly?   Simple.   There are two reasons:

If your site takes too  long to load up then visitors will leave and go elsewhere.   This means that you not only will get a high bounce rate in your google analytics account (which no doubt will also affect any pay per click quality score if you are buying traffic) but your traffic will leave.   Once visitors leave, it’s not likely that you will get them back as a returning visitor.  It’s a bit like the last time I ate out at a restaurant.   The food was okay but the service was SLOW so I’m not going back :)

The aim for your load time, according to people who have researched it, is about 4 seconds or less.     If you know anything about the demographics of your visitors (which you can check by looking at quantcast)  you should also take into account the different between genders.   If you are marketing to predominantly women for instance or seniors then you need to have a super fast site.   Men have slightly more patience according to research so if they are your predominant visitors you could probably get away with an extra second load time without causing too many tears.

The next reason is because of the big G.    Google have recently indicated that they take into account page load time when ranking sites.   So if you want your site to get ranked for certain keywords now is the time to start giving a bit of thought and taking steps to improve the speed.

I’m going to give you some simple solutions that you can apply to your site (and I’ll be doing some of them here as well!)

First things first

Your Web Host

We need to start at the beginning.   Your site is only as good as its foundation.    If your site is hosted on a shared hosting account with limited bandwidth and limited storage then it is limited in what it can do.      There are a number of  WordPress recommended web hosts that you can use for hosting.   If you have a highly trafficked blog you might also want to consider getting your own dedicated server or virtual dedicated hosting.  Another problem that you can face with shared hosting is receiving a lot of traffic to your site at once (might be a result of being dugg or slashdotted or a pay per click campaign) and then your host suspends your site.

Kill The Code

Each time a visitor lands on your page all of your plugins are called and query your database.     The more plugins you are using the more queries to your database which loads up your bandwidth and your server activity.   That’s one visitor for each page.  So, if you get 100 visitors a day ……

Here’s the quick and easy solution

  • Delete plugins that you do not need
  • If you don’t want to delete your rarely used plugins because you might need it “one day”  just temporarily deactivate them when they are not in use.
  • Assess the plugins you are using.  Do you really need them?    I am often fascinated by the plugins that people are using for things they could quite simply do by adding a bit of code to a theme or pressing a button.    I’ve written about this in the past here.
  • Check the plugin description, faq and read me.   Some plugins are actually designed only to load when required – so they can stay :)

Now if you are techie savvy you can just  limit the loading time for the plugin  to ensure that it only loads when required.   That’s beyond the scope of this article so we’ll save that for another day.

The Cost Of  Being Pretty

I love pretty things  :)   I also like my blog to be pretty as well which is why I decorate it with pretty graphics.    However, there is a cost to being pretty.     Graphics can slow down your blog in three  ways.

First of all there are the pretty graphics that form part of our WordPress theme.    If you take a look at my blog you will see that there is a pretty graphical header, background, sidebar, footer  and some miscellaneous graphics like icons, search boxes and the like.

In order to load up my theme to achieve it’s pretty look  we have to load up the header, footer, sidebar, background and the miscellaneous graphics .   For every visitor to your site these graphics get called to be loaded up.     According to WordPress if you had a minimum of 4 graphics on your WordPress theme for 100 visitors those images would be loaded 1200 times which is a huge increase on your server and bandwidth.

We also like to have pretty graphical images on our blog pages as well.    When you are writing a post or page it is always good to keep your visitors engaged and interested by adding a graphic.    These images take time to load up as well.

The final way that graphics can slow down your site is by mis-use.    This is when people think it’s fine and dandy to link to your image from their site.   What we call hotlinking.

The good news is that you can do something about all these image problems.

Your Theme

If you are techie you can clean up the code on your theme by removing unnecessary calls for images or php code.   I’m going to assume that you are not techie and suggest another option.

If you are not techie you can improve the load time of the images on your theme by loading the images to Amazon S3.   The advantage of this is that they are not being called from your server but the server nearest the visitor.   This makes the speed that the images are displayed for the visitor faster.    If you are concerned about pricing don’t worry.   My Amazon s3 account that has a host of downloads (including videos) and “stuff” in it costs me about $1.50 per month.  If your theme is using plain colored graphics you could also remove the graphics and just add the color to the css style sheet instead as a new style.

Images

There are a few options that you can choose from with images as well.   You can either just use images below the fold on your blog -giving it more time to load up when a visitor hits the page.    Alternatively, you can use the images wherever you please and optimize them.   If you are a photoshop user (or Gimp) you can compress your images when you are saving them.   If you aim for them to be compressed to less than 50 kb they should be fine.   Of course, you can also upload those images to your handy Amazon S3 account as well.

Now to prevent the hot linking we have two options.

The Easy Way – install the Hotlink Protection plugin.

The Harder Way – alter your ht access file.     You can find a detailed tutorial on how to do that here.

Content

Another way to speed up your blog is to show less content.   Yes, I know content is everything but it doesn’t all have to be displayed at once.   You can use excerpts – just like I use here rather than displaying the full post.     Using excerpts gives your blog more speed because only small amounts of content are being loaded up at a time.

Repair & Optimize

Another easy way to ensure that your blog is running full steam ahead is to ensure that the database is always clean and sparkling.     There are two things that we can do here.

First of all, you should be using the DB Backup plugin anyway to back up your database but if you are not install it now!    Now, the plugin has a handy little feature that allows you to repair your database and also optimize it.   This little clean up operation can often do wonders for the performance and speed up of your blog.

Now, while you are in cleaning mode it’s also time to clean out those tables with all your post revisions on it as well.   I always edit posts! Every time I edit the post a version is saved in the database table.   If you edit each of your posts a few times can you image what that table looks like???  Messy!!  Now, of course, you can clean out your database and tables by going to PHP My Admin on your server.   I’m going to assume that you don’t like to go to your server and that you want a quick and easy solution.   The quick and easy way is just to install a plugin like WP Optimize.   You can also clean out your database and get rid of orphaned options.   Simply put these are options that don’t have any “get” (in php geek speak) values attached to them.   You can use the Clean Options plugin for that.     Once you are done, you can just deactivate the plugins until you next need them.

Cache

You can speed up the cache time of your blog by installing a plugin like Super Cache.     What the plugin does is basically convert the php files to static  html files which  make them faster to load up.     Most visitors will in fact see a cached page – but this doesn’t interfere their site experience – only makes it faster :)

There are a number of cache plugins available in the wordpress repository if you find Super Cache unsuitable for your blog set up.

Speedy Gonzales
Well, not really … more like PHP Speedy.     There is a WordPress plugin that is an adaptation of the PHP Speedy script that states it will speed up the page load time.     You might need to check back to the site because it appears that the current plugin does not work with WordPress 2.8.   Now, don’t be disheartened that the plugin is not currently up to date because there is also a PHP Speedy script that works with WordPress sites.    You do need to upload the script to your server but there is a handy autoinstaller to save you time.

Keep Your Eye On This

There’s another WordPress plugin that promises to speed up your site including compressing java script files and css files which is called Web Optimizer.   Now, I haven’t tried the plugin myself but it would appear from the comments that it is currently not working as well as it should.    Hopefully, the developer will get the problems ironed out soon because the list of features  and functions is quite impressive.

Now, if you can’t get the plugin to work for your site you are in luck!  If you look up, you have just found another useful set of plugins that you can use instead.


Have fun with WP :)