New WordPress Theme – Slow Performance

New WordPress Theme – Slow Performance

Well I did it again. Not being happy with my last theme, I decided to start a new theme from scratch. The good news was that I was able to reuse some of the PHP code from the last theme, so I saved some typing. I’m happy with how this theme turned out, so I’ll keep it for a while.

Unlimited data backup with BackBlaze

One issue I did notice was that this theme became slow after I applied it to Technically Easy. I couldn’t understand why, as the amount of code is actually less than my previous theme. Upon further investigation, I was able to determine a problem, which was unrelated to my theme, and was able to find a solution.

Performance Check

Pingdom Logo

Whenever I want to test the performance of my blog, I quickly turn to Pingdom Tool’s Full Page Test. I once again used the tool to find the performance problem. I simply entered my blog’s URL into the edit box on the web page, and clicked the “Test now” button.

Within a matter a seconds I received my results. The tool shows how long each object takes to download from the web server. When I viewed the results of the test I noticed that there were a few Javascript files being loaded. One of the files (prototype.js) was over 120 KB in size, so it was a big chunk of my blog’s download size.

After doing a quick search within the WordPress forums, I found out that that the prototype.js files was only needed within the admin pages of WordPress. So why was it loading when I displayed a page on Technically Easy?

As I read further, references were made to that fact that plugins can also load those files when needed. I quickly went back to my list of plugins.

Disabling a Plugin to Increase Performance

Many plugins load various files when they are used. In my case, a large Javascript file was being loaded on each page request. This slowed down the viewing of my blog, since the browser waited to download the file from the server.

I knew of one plugin that required Javascript files to display larger views of my images to a visitor. This plugin was called Lightbox 2. While I did enjoy using the plugin, I wanted to find a solution that would allow me to control when to load the Javascript files instead of loading them all the time. I also found out how to do that as well.

I came across a post on Yoast called Quick WP tip #2: Conditional Thickbox loading that explained how to load Thickbox Javascript files only when needed. Thickbox does the same thing as Lightbox, so I decided to disable the Lightbox 2 plugin, and use Thickbox.

After modifying my posts to use Thickbox, I added the function from the Yoast post into my theme’s functions.php file. I then disabled the Lightbox 2 plugin and tested the posts.

Each post that used the Thickbox script to display the larger images loaded the correct Thickbox Javascript files. The pages that didn’t use Thickbox, didn’t load the Thickbox files. I also no longer had the prototype.js file loaded when viewing my blog. This has increased the load of my blog dramatically.

If the performance of your WordPress blog is not where you want it to be, I suggest you perform a test to find out which object is causing the slowdown. From there you can research a solution to the problem.

Get free email updates! Sign up for new post notifications.

6 Responses to “New WordPress Theme – Slow Performance”

  1. I am using now blogger, my site is It is a technology base blog. What should I do to get a good theme related to my blog?

  2. James Fisher says:

    I did like the old theme Paul, but this new one is nice too. I think your header could be slightly larger (higher), but otherwise the look is good.

    • Paul says:

      Thanks. I decided I wanted a smaller header to include more content above the fold since I don’t usually include much information in my header.

  3. Idrees says:

    The one thing I don’t see is a search box! Where is it?

    Otherwise, great work. Nice theme, better than the previous one. Intrigued that you opted for a fixed width layout and a smaller font. Can you give reasons? I’m very, very much envious that you coded your theme yourself — but then you are a technical guy and I’m not!


    • Paul says:

      Very perceptive. I noticed that once I had added the theme, I didn’t add the search box in the sidebar. I’ll put one in as it shouldn’t take too long to do, a few minutes at most.

      I decided to go back to the fixed width as I wanted to keep the coding simple this time. The smaller font is due to the fact that I now have a fixed width and wanted to resize the text to match. I can easily increase the size if needed, and also adjusting the text size in the web browser will also resize the text on the entire site as well.

Leave a Reply

Your email address will not be published. Required fields are marked *