The last few weeks haven’t been the happiest time for my blog because of hosting issues, network problems, and server problems. But with them out of the way, I came across an interesting article on Lorelle on speeding up your WP installation. So I’m putting this in my ‘Sunday Projects’ category:
The 3 Easiest Ways to Speed Up WordPress
So, in the past 2 weeks I’ve had 3 articles hit the front page of Digg. Let me just tell you, the onslaught of traffic can bring a server to it’s knees. Over the last many months I’ve learned a thing or two about tweaking WordPress, and while this is not meant to be an exhaustive tutorial on how to survive a Digg, it will give you some tips that can definitely improve your blog’s performance for all of your visitors.
OK, what have I done? Let’s see, I’ve done five things to speed things along.
1. Unused Plugins: Or what do you do when you have more than 30 plugins?
On Lorelle’s advice, I moved ALL my unused plugins to a separate folder in my root folder, out of the way of the WordPress Software. If I need them, I can move them back. If not, why are they are there? She noted that they will slow down a WP installation.
2. Unused Themes: 49ers?
I also moved my 49 unused themes (some of them quite hideous) to the same location. I don’t know if it made any difference or not, but finding the theme should be much quicker when there is one in the theme presentation folder!
3. My Sidebar
I cut down, removed, and converted elements in my sidebar. I cut down on useless stuff such as Javascripts to online services (I only kept Payperpost, Google Adsense and Analytics, and Alexa). I trimmed my comments and recent posts to only five items each to see how that would fare. Also, I decided only to have twelve categories after all. I simply copied the text from the front page, pasted it into a new post, switched to code view, retrieved that new HTML code, and pasted it into an already used widget. You can’t tell, can you? I also did the same thing to the blogroll. Still can’t tell, can you?
4. Maximum number of posts per page
I trimmed the number of posts on each page to three. Most people have five or even ten, but I can’t at the moment. It slows the server down too much. So I opted for three. It’s not ideal, but…
5. Standard PHP Code
I am slowly thinking of following another of her suggestions: switching ‘static’ php code to its html equivalent to speed up things. For example, in this theme, a PHP call for the blog URL and title and so on would require three separate routines for the same information (ie. the same everytime it’s called). I’ve kind of already done it with the sidebar itself. I’m thinking of switching to HTML from PHP for some of the plugins that I use or use to have: such as using a real robots.txt file instead of a plugin, re-adding my signature as HTML with local hosted images, and so on. I already removed the footer PHP for that reason and the Archives page has become static HTML, too.
Anyway, we’ll see how it goes. In the meantime, I’d like to thank Jorge at Investing Adventures dot com for keeping an eye on things and giving me feedback when my blog is slow. It was taking 20 seconds or more for a page to load, right now as I type this pages are loading in under 10 seconds. But I’ll keep an eye on the load, speed and traffic over the next few days to make sure things are ‘normal’.