WordPress Optimisation: Control When Plugins Are Loaded
Although, I love the Extended Live Archives plugin and the Archives page it creates, it’s very resource hungry and even though my server is getting better by the day thanks to Matt, it’s still a big drain. I did a quick search on Google and I found this tip for reducing it’s impact on my page speeds, which should work with many other plugins.
One of the issues with WordPress is that it processes all of the code for all active plugins, even if that plugin isn’t used on a particular page. If a particular resource heavy plugin isn’t used on certain pages, then you can tell WordPress not to load it on those pages by wrapping an if statement around the content of each function to check what page is being loaded e.g. with the Extended Live Archives plugin I did the following to tell WordPress only to load the code if the Archives page is being viewed:
function af_ela_function_name() {
if (is_page(’archives’)) {
// function code here
}
}
This has made a huge difference to my page loading speeds, which means I don’t have to ditch a very cool plugin. I’ve applied the same trick to other plugins, including MyAvatars.
All I need now is a way to reduce the impact that using UTW has on my page loading times. Of the 0.8 -1 second quoted in my footer for how long it takes WordPress to do all its queries, 0.4-0.6 of this is down to UTW alone. Anyone got any ideas?
Bookmark & Share
Related Posts
- Optimise Your CSS File
- Ultimate Wordpress Site Speed - Install WP-Cache2 AND APC At The Same Time
- Wordpress Plugins NOT To Install
- What Do You Think Of The New WordPress Plugin Directory?
- AntiLeech WordPress Plugin: Stop RSS Splogs In Their Tracks
- Would You Use The WP-Backlinks WordPress Plugin?
- Guide To Optimizing WordPress Servers


Comment by Thilak on 26 January 2007:
That’s right. I noticed that Live Archive throws some style in the header.
Comment by Everton on 26 January 2007:
do you use Extended Live Archives as well? It’s pretty cool, but admittedly a big luxury
Comment by Thilak on 26 January 2007:
Nope.. I don’t use it now
Comment by Mosey on 23 March 2007:
Did anyone come up with a suggestion for optimising UTW? I can’t tell what percentage UTW takes up of the total load (how does one do that?) but I think its a fair bit.
Comment by Everton on 23 March 2007:
I did…I switched to Simple Tags!
Pingback by 38 ways to optimize and speed up your WordPress blog | WordPressGarage.com on 23 April 2008:
[...] Control when your WordPress plugins are loaded: WordPress processes all of the code for all active plugins, even if that plugin isn’t used on a particular page. If a particular resource heavy plugin isn’t used on certain pages, then you can tell WordPress not to load it on those pages by wrapping an if statement around the content of each function to check what page is being loaded. Learn more about how to do this here and here. [...]