Wordpress can be really slow out the box, especially if (like me) you’re hosting a blog on a shared server. So, what can you do to speed things up?
1.) Keep Updated - install the latest version of Wordpress, no excuses!
2.) Monitor your Stats - by default, wordpress includes the ability to display the number of database calls made per page, and the page execution time. I haven’t seen it able to monitor server loads (how hard the server is working), so I put together a quick plugin to add this ability, along with the full monitoring display code. You can view my short article here. Remember, the smaller the numbers are, the less resources being used, the better your site will load!
3.) Wordpress Cache - now that you’ve got an easy way to monitor your server resources, you could well find that there are many calls to the database per page, along with a few spikes in server load. Wordpress comes with an inbuilt caching mechanism, to stop the datbase being hit so often. By itself, this may not benefit you too much, but I’d say enable it anyway by adding the line of code below to your wp-config.php file:
define(’ENABLE_CACHE’, true);
4.) Proper Caching - this is more advanced, but it works amazingly well. If you’ve ever had problems with slow loading times and stretched resources, you should try out this plugin. It may take some playing about with if you want to keep parts of your site dynamic (it includes the ability to do this), but if you’re comfortable with Wordpress, I’d say give it a try. You can view full instructions, and download the plugin, from the author’s site. Hint: if using this plugin, disable Wordpress’ inbuilt cache.
5.) Plugin Usage - the Wordpress plugin system is great, but it can start to slow your site down if you install too many that aren’t well put together. Slow database queries can really be a killer (although if you have wp-cache installed, not as noticeable), so only install the plugins that you really need!
6.) Theme Selection - some themes might look nice, but if they contain too many images (resulting in longer downloading times and more http requests) they might not be a good choice. There is a huge selection of wordpress themes out there, and plenty of nice themes that aren’t overly reliant on lots of images. The same goes for any images you add to your site in the form of badges or logos - do you really need them all?
7.) Content Compression - the less time it takes for users to download your blog pages, the better. Wordpress provides gzipping by default in the Options menu, but I always turn it off, since it can cause problems. In truth, any form of content compression can be a problem, depending on the browser used, but I’ve yet to have a problem using the htaccess file. Did you know that not only can you compress your html, but also your css and javascript files as well? If you use a lot of javascript on your site for example, this will make a big difference to many users:
(a) Open up your htaccess file in your wordpress root directory (or create one if your host allows). Below the line RewriteEngine On, add the following code:
## CSS Compression
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{THE_REQUEST} ^(.*).css
RewriteCond %{SCRIPT_FILENAME}.gz -f
RewriteRule ^(.*)\.css $1.css.gz [L]## JS Compression
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{THE_REQUEST} ^(.*).js
RewriteCond %{SCRIPT_FILENAME}.gz -f
RewriteRule ^(.*)\.js $1.js.gz [L]
(b) you can also compress the html by use of the following line at the top of your htaccess file. Remember that this *may* sometimes cause problems, although I have yet to have any myself. Also make sure that Wordpress gzipping is turned off in the Options menu:
php_flag zlib.output_compression On
(c) once your htaccess file is saved, you then need to zip up any javascript or css file you want to compress. If you don’t, the code in (a) will have no effect. I use this utility to zip up the files, and then upload them back into the web folder they came from. Important: make sure you keep the original files there too!
8.) Server Tuning - this won’t apply to a lot of users on shared servers, since there isn’t much you can do about it. However, having use of a php cache like eAccelerator can dramatically cut server load, and so help speed up your site even further. I have just had my account moved on servage.net to the latest server cluster, specifically because it uses eAccelerator caching, and I can already see the difference in resource usage. If it’s not installed, and you don’t have full access to the server, there is nothing you can do (except beg!).
On a related note, if you have access to the memcache php extension, someone has written some code to take advantage of it. Again, this really doesn’t apply to 99.9% of people (only benefits heavier traffic sites), but I thought I’d add it in at the end!
Well, that’s about all I can think of right now. Happy tuning!
The best domain host is not necessarily the web hosting service everyone is raving about. Sad but true, the web hosting review is not always right. A lot of free web hosting services often do not carry good reviews, but are good nonetheless. Some even offer colocation hosting. A service is considered good if it can hold up a number of website templates on a regular broadband connection.
Popularity: 7% [?]

Thanks Simon,
Enabled the WP cache and disabled the gzip option.
If the site is already fast would you bother installing the more advanced caching plugin?
Opti
I wouldn’t have thought so, maybe just put it in the plugins folder so that if the site does ever get slower, you can turn it on and speed it back up!
Hy,
I have “install” your instruction for css and java scripts, but that is not working for me.
Here is my htaccess:
http://www.veseli-andrija.com/wp-content/gallery/wordpress/htaccess1.JPG
Can you tell me what I did wrong, please?
P.S. Yes I make .gz files and upload it, and also I leve there original files.
Thanks…