Skip to content

August 7, 2009

15

How To Speed Up Your WordPress Blog

How To Speed Up Your WordPress Blog

A WordPress blog is an easy way to establish a dynamic online presence however it’s also very easy to get trigger happy with plugins and themes that ultimately slow down your websites loading time. Here’s a quick little checklist to help improve your blogs performance.

1) Test your blogs speed first and get it primed

Use tools like iWebTool’s Speed Test and Pingdom’s Full Page test to visually see your blogs weaknesses and identify any key areas to focus on.

You should also be sure that your HTML adheres to W3C guidelines by validating your website and fixing any problems.

2) Make sure you have reliable hosting

Choose a reliable host that has the most recent versions of PHP and MYsql installed as well as enough space/bandwidth to handle large loads. WordPress has it’s own list of recommended hosts.

Here are a few others worth checking out:

3) Handle your images properly

Images can put a huge strain on your server’s load time if not managed properly. Your images don’t need to be any higher than 72 DPI and should be resized before being inserted into your post. Resizing images with HTML can distort the image and increase it’s loading time.

It also might be a good idea to disable hotlinking so no one outside of your website is using up your resources. All you have to do is navigate to your .htaccess file and insert the following code. (Note: If you are unfamiliar with how htaccess works, you may want to skip this step or contact a web developer for help)

  1. RewriteEngine on
  2. RewriteCond %{HTTP_REFERER} !^$
  3. RewriteCond %{HTTP_REFERER} !^http://(www\.)?example\.com/.*$ [NC]
  4. RewriteRule .*\.(gif|jpg|png|ico)$ – [F,L]

It also wouldn’t hurt to cache your commenter’s gravatar images if you are currently displaying them on your site.

4) Easy with the javscript calls

Calls to 3rd party javascripts seem to be the main culprit in slowing down WordPress blogs. Between all the analytics packages available and social media enhancements you can make, their are tons of ways to slow down your blog. It really comes down to just choosing wisely. Do you really need that nifty little MyBlogLog widget? Is Google friend connect that important to your blogs strategy?

Two easy ways to cut down on the amount of time is takes to load whatever scripts you deem are necessary is to:

  • Move javascript to an external file so browsers can cache the scripts.
  • Move any remaining scripts to your WordPress’s footer.php

5) Don’t load too many videos at once

Too many flash videos on one page is a sure way to use up all of someones memory trying to load your page. I worked around this problem by assigning all video posts to the same category and not displaying any posts from that category on the home page. I just placed the following code above my “WordPress loop”:

  1. query_posts('cat=-3');

Another easy fix would be to use the <!–more–> tag above your code that embeds the video in your post. This would only prevent the video itself from displaying on your home page.

6) Control your plugins

Only make calls to plugins when you need them by only calling them on the pages they will be used on.

  1. if (is_page('archives')) {
  2. // function code here
  3. }

This code only displays “function code here” when you are viewing the “archives” page. A full list of all the conditional tags can be found here.

Also be careful not to install too many plugins in general and disable and remove any plugins that are not being used.

7) Cache Your Pages

The WP Super Cache plugin is probably the easiest way to seemingly increase your blogs loading time. It saves a copy of your website to a file on your server so WordPress only need to call that file rather than all the SQL and PHP it normally has to run. It comes in very useful when you have traffic spikes from certain social media sites.

8) Reduce SQL queries and PHP calls

Yoast has a great post that can help significantly reduce the number of calls your blog makes to your database. It also wouldn’t hurt to clean up your database either manually or with a plugin like WP DB Manager.

Another thing you can do that might speed up your database is to disable post revisions.

-

I hope someone finds this useful. Are there anymore tips you would recommend for speeding up a WordPress blog’s loading time?

- Photo by kevindean

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
15 Comments Post a comment
  1. Aug 7 2009

    Thanks for all the tips but I have a question. What size and loading time is good? or what size and time you shouldn’t go over?

    Thanks,
    Blaine

    Reply
    • Aug 7 2009

      Thanks for the comment @blaineblogger … I think anything that takes longer than a few seconds could potentially lose someones interest. I would say under 5 seconds is safe, under 3 seconds is safer :)

  2. Aug 7 2009

    These are great tips, Jon! I haven’t used those speed tool tests yet, so I’m going to check them out. Very useful :)

    Reply
    • Aug 7 2009

      Hope they help. Thanks for commenting.

  3. Oct 16 2009

    Hi John, thanks for the great guidance. I have also posted another tutorial about server side javascript and css files compression to speed up WordPress. It has extreme effects on page load times (up to 8 times faster). Some of your readers or even you might interested in and apply it to Rock with your blog :)

    Reply
  4. Feb 23 2010

    Hi Jon, maybe I’m a bit late with this comment but I wanted to ask you, since you are using Thesis and recommending WP Super Cache. Is there something in particular you need to do when activating the plugin on Thesis? I see an alert to change the permissions on wp-content because it is writable but I’m not sure…

    Thanks for the help man.

    Reply
    • Feb 23 2010

      Sometimes you need to change the write settings of the wp-content folder so it can save the cached files.

      “There are two ways that you can fix this problem. The first option is to chmod using a command. This is what the plugin suggests that you do. If you have SSH access to your server, ssh in and run the command: chmod 777 WP_DIRECTORY/wp-content where WP_DIRECTORY is the directory that your WordPress blog is installed in. You can also find the exact command that you need to run on that WP Super Cache error page that you see.

      You will see something similar to this when chmoding with FTP. Make sure that all boxes are checked.

      The other option is to chmod using an FTP client. This is probably easier for anyone that hasn’t used terminal before. Connect to your FTP server and find your /wp-content/ folder. It’s in the folder where you installed your blog. Now you have to find the option to chmod. In most FTP programs, you have to right click on the folder and then select Chmod. It really depends on your FTP program. On the chmod box that pops up, make sure that it is either set to 777 or that all of the boxes are checked. If there are any special boxes, like there are on the right, just leave those empty.” – From http://gulati.info/2009/01/using-wp-super-cache/

    • Feb 24 2010

      Hey, thanks Jon, for taking the time and for the advice.

Trackbacks & Pingbacks

  1. How To Speed Up Your WordPress Blog | Google Friend Connect Blog
  2. Vill du bli en WordPress expert? | ZtrixQ.se
  3. 5 Tips To Consider When Designing Your First Blog | blaineblogger.com
  4. Blog – Velagapati - 300+ Resources to Help You Become a WordPress Expert
  5. WordPress 300+ Collection of Amazing Resources | Amazing and Inspiring Design
  6. 300+ Resources to Help You Become a WordPress Expert « eBSPAD
  7. WordPress Expert Resources, Wordpress Plugins, Wordpress Tutorials

Share your thoughts, post a comment.

(required)
(required)

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments