Speeding up WordPress
by Sapphire (March 1, 2007)
I finally got B-2 Bomber working right - turned out to be a bad plugin. It was a pagination script that turned those little “previous/next entries” tags at the bottom into nice little numbers. Unfortunately, I think it must have been doing a total page count every time a page loaded. That’s why the homepage was loading slowest of all - it had to count every single page in the blog. The categories loaded more quickly because they have fewer pages to them, and so on.
Now the site’s running just under lightspeed, despite having over 4,000 comments and 500 entries, plus a fair amount of images and so on. I streamlined the hell out of the theme. I compressed my CSS with this little gizmo, which finds duplicated stuff and whitespace and all that stuff and hoovers it right out for you. I turned on internal caching by following the instructions here under Enable Object Caching, but then I turned it back off because another site warns that Dreamhost and some other shared hosts will cache things to another remote server and you need to have your cache directory writable. I think that’s the case with mine. But as far as I can tell, you can’t break anything by trying it, so give it a shot and see if it makes a difference.
Lessons learned:
- The lightness or minimalism of your theme is directly proportionate to how fast the site runs. Slimmed themes = good.
- If your plugins are loading Javascript at the top of the page, make sure they’re worth it. Delete the ones that aren’t. Often, you can find other plugins that will do something similar enough without adding that stuff. Or at least not so much.
- Plugins can also load CSS into the head. Sometimes you can remove it from your plugin and stick it into the main CSS document - that doesn’t help on load time, but it does put less code between the top of the page and the content, as a bot sees it. And then if you compress your CSS after all, it will help load time.


May 29th, 2007 at 2:07 pm
You are missing 1 little piece though, you should encourage people to also implement a server-side caching scheme to send out the correct caching headers with static content such as images, javascript, css, pdfs, favicon.ico, etc..
Read about it: htaccess Caching
Great article! I subscribed to your feed
May 29th, 2007 at 6:34 pm
Thanks! You know, I read about that on your site (a while after I wrote the article). Unfortunately I didn’t have the technical knowledge to follow it.
Hopefully some of my readers can make use of your article, though!
August 1st, 2007 at 2:31 am
Actually other than enabling object caching, i also enabled the Gzip Compression (for page and css)
btw thanks for the link
August 1st, 2007 at 8:38 am
The only reason I didn’t mention that is that it didn’t work on my particular blog. I don’t know what it is about gzip, but I’ve had it work on some blogs and not others- maybe a host setting issue? In any case, it wasn’t working on any of mine, so since I couldn’t test it, I didn’t report on it. But I included the links so people would see your other suggestions, too.