WordPress is a great platform. One weakness that it suffers from, however, is it can be quite slow.

Without taking the right precautions, you could end up with a sluggish site.

Thatís not only a hassle for repeat visitors but will cause you to lose subscribers and customers.

In this quick post, Iíll cover all of the best ways that Iíve found to consistently speed up WordPress.

Why WordPress Site Speed Matters
When a person lands on your site for the first time, you only have a few seconds to capture their attention to convince them to hang around.

Optimize images (automatically)
Yahoo! has an image optimizer called Smush.it that will drastically reduce the file size of an image, while not reducing quality.
However, if you are like me, doing this to every image would be beyond a pain, and incredibly time consuming.

Fortunately, there is an amazing, free plugin called WP-SmushIt which will do this process to all of your images automatically, as you are uploading them. No reason not to install this one.

Optimize your homepage to load quickly
This isnít one thing but really a few easy things that you can do to ensure that your homepage loads quickly, which probably is the most important part of your site because people will be landing there the most often.
Things that you can do include:

Show excerpts instead of full posts
Reduce the number of posts on the page (I like showing between 5-7)
Remove unnecessary sharing widgets from the home page (include them only in posts)
Remove inactive plugins and widgets that you donít need
Keep in minimal! Readers are here for content, not 8,000 widgets on the homepage
Overall, a clean and focused homepage design will help your page not only look good, but load quicker as well.

Optimize your WordPress database
Iím certainly getting a lot of use out of the word ďoptimizeĒ in this post!
This can be done the very tedious, extremly boring manual fashion, orÖ

You can simply use the WP-Optimize plugin, which I run on all of my sites.

This plugin lets you do just one simple task: optimize the your database (spam, post revisions, drafts, tables, etc.) to reduce their overhead.

I would also recommend the WP-DB Manager plugin, which can schedule dates for database optimization.

Disable hotlinking and leeching of your content
Hotlinking is a form of bandwidth ďtheft.Ē It occurs when other sites direct link to the images on your site from their articles making your server load increasingly high.
This can add up as more and more people ďscrapeĒ your posts or your site (and especially images) become more popular, as must do if you create custom images for your site on a regular basis.

Place this code in your root .htaccess file:

disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER} !$
RewriteCond %{HTTP_REFERER} !http(s)?://(www.)?sparringmind.com [NC]
RewriteCond %{HTTP_REFERER} !http(s)?://(www.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !http(s)?://(www.)?feeds2.feedburner.com/sparringmind [NC]
RewriteRule .(jpg|jpeg|png|gif)$ Ė [NC,F,L]

Youíll notice I included my feed (from FeedBurner), youíll need to replace it with your feedís name, otherwise your images wonít appear correctly there.

Add an expires header to static resources
An Expires header is a way to specify a time far enough in the future so that the clients (browsers) donít have to re-fetch any static content (such as css file, javascript, images etc).
This way can cut your load time significantly for your regular users.

You need to copy and paste the following code in your root .htaccess file:

ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000

The above numbers are set for a month (in seconds), you can change them as you wish.

Adjust Gravatar images
Youíll notice on this site that the default Gravatar image is set toÖ well, nothing.
This is not an aesthetic choice, I did it because it improves page loads by simply having nothing where there would normally be a goofy looking Gravatar logo or some other nonsense.

Some blogs go as far to disable them throughout the site, and for everyone.

You can do either, just know that it will at least benefit your site speed if you set the default image (found in ďDiscussionĒ, under the settings tab in the WordPress dashboard) to a blank space rather than a default image.

Add LazyLoad to your images
LazyLoad is the process of having only only the images above the fold load (i.e. only the images visible in the visitorís browser window), then, when reader scrolls down, the other images begin to load, just before they come into view.
This will not only speed you page loads, it can also save bandwidth by loading less data for users who donít scroll all the way down on your pages.

To do this automatically, install the jQuery Image Lazy Load plugin.

Control the amount of post revisions stored
I saved this post to draft about 8 times.
WordPress, left to its own devices, would store every single one of these drafts, indefinitely.

Now, when this post is done and published, why would I need all of those drafts stored?

Thatís why I use the Revision Control plugin to make sure I keep post revisions to a minimum, set it to 2 or 3 so you have something to fall back on in case you make a mistake, but not too high that you clutter your backend with unnecessary amounts of drafted posts.

Turn off pingbacks and trackbacks
By default, WordPress interacts with other blogs that are equipped with pingbacks and trackbacks.
Every time another blog mentions you, it notifies your site, which in turn updates data on the post. Turning this off will not destroy the backlinks to your site, just the setting that generates a lot of work for your site.

For more detail, read this explanation of WordPress Pingbacks, Trackbacks and Linkbacks.

Replace PHP with static HTML, when necessary
This one is a little bit advanced, but can drastically cut down your load time if you are desperate to include page load speeds, so I included it.
Iíd be doing this great post injustice if I didnít link to it for this topic, as it taught me how to easily do this myself, in a few minutes.

So go there and check it out, it wrote it out in plainer terms than I ever could!

Use CloudFlare
This is similar to the section above on using CDNís, but Iíve become so fond of CloudFlare since I discussed it in my best web analytics post that Iíve decided to include it separately here.
To put it bluntly, CloudFlare, along with the W3 Total Cache plugin discussed above, are a really potent combination (they integrate with each other) that will greatly improve not only the speed, but the security of your site.Litespeed Will reduce server load.