Online Casino In Usa For Mac Las Vegas Online Casino With No Download Instant Play Casino Slots No Download Best Slots Around The World No Download Slot Machines Games Flash Casinos Usa Players Online Casinos No Downloads Best Top Usa Casinos Online New Casino Sign Up Bonuses Casino Sign Up Bonus Us Players Us Blackjack Bonus Code American Online Slots Promotion Codes For Online Casinos Brand New Online Casino Video Bonus Slots European Roulette Online In The Us Play Real Money Slots List Top 20 Casinos For Us Players Top American Casinos Casinos Accepting Us Deposits New Bonus Slots Online Best Blackjack Bonus All No Download Slots Internet Casino Gambling Online Online Gambling Blackjack Mac Ewallet Express Instant Play Online Casino Online 5 Reel Bonus Slots Best Casino Downloads Casino Bonus 2010 Best Payout Slot Machines Us No Download Casino Online Casino Accepting Us Credit Card Deposits Best Flash Online Casinos Casino Instant Play Top Online Craps Casinos Slots Bonus Usa Accepted Deposit Amex Casino Online For Mac With Instant Play 2010 Best Online Casinos Video Slots No Download Blackjack United States Best Online Craps Casino Usa Online Casino Bonuses Online Flash Usa Casinos Casino Download New Bonus Codes For Casinos Gambling Site In Us 3 Reel Slots No Download Casinos That Play For Real Money Mac Casinos Casino Online Us Player Accepted Casinos For Usa Players Internet Casino Card Games Casino Usa Legal America Casino Bonus Online Casinos With Slots Tournaments For Usa Players Bonus Slot Machines Roulette Casino Games Web Casinos Accept Credit Card Sign Up Bonus Online Casino Best Deposit Casino List Casino Online Games For Mac Best Us Online Casino With Slots Slot Machines With Bonus Games All Online Casinos List Top Casino Bonus For Us Players Best 2010 Casino Games New Casinos Online For Usa Players Internet Casino Rating Igt Online Slots Us Play 5 Reel Slots Online Casinos That Accept Us Mastercard Real Money Online Casinos For Americans Top 10 Rated Casino Games Slots Tournaments Online Top American Online Casinos Play Casino With American Express Any Online Casinos Take Amex Slots Online Blackjack Real Money Us Accepted New Rtg Casino Bonus Instant Play Slot Machine At Casino List Of All Casinos In Us All New Slots Casino Play Usa Ewalletxpress Online Gambling Online Slots Play Now New Online Casino Usa New Online Slot Games Best Payout Casino Slots Video Slot Vegas Casino Video Slots Bonus Bonus Slots For Us Players Deposit Bonus Blackjack Casino Online For Us Player Online Slot Casinos For Us Players Usa Online Credit Card Casino Online Slots Best Odds Craps Online For Us Players Best Pay Out Casinos Usa Rtg Casinos Instadebit Real Casino Video Slots Online 400 Bonus Slots Internet Casino Rankings Online Roulette For Us Players Best Casino Promotion Forum Play Real Casino Video Slots Safe Online Usa Casinos Casinos In The United States Casinos Directory Virtual Casino Blackjack Casino Video Slots On Line Online Craps Blackjack Rtg Casino Coupons 2010 Casino New Bonus Codes Online Casinos Excepting All Us Players Flash Online Casinos Play Online Casino For Mac Casino Bonus Promotion Code Play European Roulette Us Accepted Flash Casinos Online Casino Mac Mac Gambling On Line Newest Slots 2010 Online Us Casinos With Moneybookers Online Gambling For Us Players Online Slots Best Bonuses Casino Sites For American Players Internet Casino Sign Up Bonuses Instant Play Casinos Usa Friendly Best Online Casino Allow Us Amex And Online Casino Casino Games Craps All Casino Bonuses And Codes Us Players Play Casino At Home Real Money Play Craps Online Now Flash Play Casino Usa Welcome Usa Roulette Casino Bonuses The Internet Casino Portal Real Money Slots Bonus Us Casinos With Fast Payouts American Online Casino Games New Online Casino Us Player Best Blackjack In Vegas Casino Usa List Best Slots On The Net Online Casinos For Usa Players Flash Sign Up Bonus Us Players Online Slot For Real Money American Online Usa Casino Slot Payout Online American Casino Games Play Slots Online No Download Required Bonus Slots No Download Play Casino Games For Money In Usa Play Us Casinos Credit Cards Gambling Flash Casino Sites Play Real Money On Wheel Of Fortune Slots Online Gambling Us Ok Internet Deposit Casinos 3 Reel Slots Usa Players Casino Games For Mac In Us Online Usa Slots Easy Online Casino Play Casinos Us Players Bonus Slots Machine Play Slots Online With Bonus Casino Slots Best Odds Play Online Slots For Money Casino Bonus For Roulette All Casinos Online List Real Money Online Craps Best Mac Online Casino On Line Casino Slots Usa Mastercard Online Casinos Casinos Play For Real Cash On Line Casinos Accepting American Express Online Slots That Take Mastercard Best Casino Start Bonus Best Gambling Casinos Us Players Top Casino In America 5 Reel Bonus Slots Best Internet Casino Sites Video Slot Tournaments Best Slots Casinos Online Play Online Slots United States Flash Casino Us Amex Ewallet Xpress Casino Sites Real Video Slots Online Rtg Casino Untied States Play Gamble Online For United States Players Best Online Slots No Downloads Rtg Slots Bonus Online Casino That Accept Us Players Online Casinos United States Can Play American No Download Casino New Casino Slot Machines Casino Games Online That Accept Mastercard Brand New Casinos Online Best Online Flash Casino Bonuses Casino Online Us Blackjack Casino Online Best Mastercard Play Online Casino Who Accept Master Card No Download Casinos For Us Best Promotions For Online Gaming For All Us Players 2010 New Online Casinos Best Moneybookers Casino Online Roulette No Download Bonus Casino For Mac Instant Play Online Casino Games Lastest Rtg Casino Coupon Codes Roulette Slot Machine Online Slot Tournaments Usa Players 3 Reel Slot Machine Downloads Rtg Casinos For Usa Players 99 Slot Machine Signup Bonus Best Bonus Casinos For Us Players Blackjack Gamble Real Money Internet Casino Video Poker Real Vegas Flash Casino Play Slots No Download Real Money Usa Casino Sites Online Slots No Download Brand New Casino Us Players Casino Game No Downloads 2010 Newest Online Casinos Casino Usa Real Money 2010 New Casinos Online Moneybookers At Casinos Online Casinos That Accept Mastercard Deposits Casinos Rtg New Codes Online Casinos That Accept Mastercard American Online Flash Casinos Usa Casinos That Take Mastercard Us Real Money Casinos Casino Usa Slots Gamble Online Real Money Play Casino For Real Money Codes For Rtg Casinos Internet Casino Keno Best Rated Casinos Online Casino Us Amex Best Internet Casino Sign Up Bonus Online Slots Casino Slot Machine List Online Usa Sign Up Bonus Casino No Download Mac Slots Games Best Usa Casino High Roller Casino Gamblers Play Online Craps For Money Usa Best Online Casino Casino Play Real Money Gamble Online Websites Casino Welcome Bonus Money Newest Casino Bonus Codes Online Slots Usa No Download Amex Casino Accept American Express At Online Casinos Rtg Casinos Using Ewallet Express Online Slots Usa Players Best Slots Deposit Bonus Online Blackjack Real Money Us Accepted Blackjack Gambling For Mac Gamble Online Australia Best Online Casinos Usa American Casino Slot Machine Top Pay Online Casino United States Slots Usa Accepted Craps Online Video Games Internet Casinos Directory Vegas Casino Payouts Instant Online Blackjack Online Casino Mac Roulette Casinos In America On Line Gamble Online For Cash No Download Casinos Online Usa Brand New Online Casinos 2010 Internet Casino Guide List Of All Us Legal Online Casinos Online Casino That Accept Us Players With Bonus No Download Slot Machines Online Casino Blackjack Mac Bingo Sign Up Bonus Online Slot Machine Real Money American Express Casinos Casino Online For All Us Players New Casino Bonus Code Top 10 Online Casino Internet Casino Site Reviews Casino Listing Play Real Money Slots With Bonus Casino Games For Mac Best Online Casino Payouts Mac Online Casino Roulette Online Slot Play Money Best Online Us Casino Legal Online Usa Casinos Top 50 Online Casino Casino Slots Bonus Usa Brand New Casino Slots Game No Download Blackjack Real Money Playing Slot Machines At Casino Latest Rtg Casino Codes Play Slots Online Usa No Download Slots With Bonus Echeck Casinos Play No Download Instant Casinos Craps Online Mac Best Internet Casino Sites Credit Cards Accepted At Casino Slots With Bonus Download Instant Signup Bonus Casino Roulette Sign Up Bonus Play Online Casino In The United States Roulette Deposit Bonus Casinos Online Using Amex Top Casino 2010 Top 10 Casinos Best Slot Machine Bonus Rtg Casinos Deposit Bonus Instant Play Casino For Us Players Complete List Of Rtg Casinos Mac Casino Online Top Paying Casino Games Instant Play Rtg Casino Casino Bonuses Blackjack Play For Real Money Casinos New Slots Games For Mac Casino Bonus Game Slots Online Gambling Websites For Usa Real Casino Download Rtg Casino Bonus List Slot Casino For Us Players Online Casino Mac Us Player New Internet Casinos Instant Casino Bonuses All Flash Casinos No Download Ewallet Express Slot Tournaments Best Online Slots Usa No Download Casinos For Us Players Online Casino That Allows Us Players Casino New Bonus United States Online Casinos With No Download Welcome Bonus Casino Rtg Casinos That Accept Visa Top Usa Casino Bonus Online Casino Us Players Slots Online Slots Us Players 2010 Online Casino Codes Onlin Casinos For Real Money Best Odds Online Casinos Casino Online Real Money Casinos For Us Players Instant Casino Bonus Codes List Of Slot Machine Names Online Casino That Accepts Ewalletxpress Play Casino Style Video Slots Online Real Money Online Casino No Downloads Bonus Slots Play Online Casinos In Usa For Real Money Gamble For Money In Online Casinos Las Vegas Casino Usa Online Internet Casino Sites Flash Casino For Usa United States Casino Payouts All Us Players Online Casinos Bonus Codes Casino Video Poker

Consolidate WordPress Plugins to Speed up Your Site

If you manage a website, the load time of your site should be of your utmost concern. While many of us are living in the broadband fast lanes (that’s what the kids call them, right?) this isn’t the case for everyone, and this is especially not the case for anyone trying to browse your site using a mobile device.

Around here we use WordPress, and just as many problems can pop up with WordPress as any other system out there today. There is one building block to our sites that is somewhat unique: Plugins. Other content management systems have their own names for what WordPress Plugins do: some call them modules, others extensions. You get the idea. Plugins give us the ability to add further functionality to our sites. They also can add some nasty speed bumps and (dare I say the word) bloat to our pages that can slow down the load time.

Fortunately there are ways we can take care of this problem ourselves. There are a few methods I’ve found helpful for reducing some of the extra heft that some Plugins generate, and they might be helpful for you, especially if you are running a popular site and are concerned with things like this.

Note: I’m not trying to single out berate any bad development habits or any particular Plugin developers (though there is probably some of that to go around). Even the best Plugins out there can be improved upon, to some extent, with a little user know-how. Most of these tips can’t be taken care of by the Plugin developers themselves, they need to be done by the site owner.

Combine their CSS into yours

This one is probably the easiest. Not all Plugins will require any sort of user-side CSS, though every now and then one will. I’m thinking of contact form Plugins, for instance. When these Plugins load their own CSS styles into your page, odds are they will be causing an extra HTTP request in the header, calling for their own CSS file to be loaded in after yours. This will slow down your page’s load time.

A bit of an explanation may help.

An HTTP request is a way to refer to what happens each time the browser has to go get something from the server where your site is hosted. When your site needs the styles for your page, it gets them. When your site needs the Javascript for a certain piece of functionality on your site, it gets that too. Best practice dictates that these calls, these requests, all happen in the header. If you have a curious eye you can peruse any site’s source and pretty quickly find these references toward the top of the HTML.

While individual calls may not be much on their own, if you have a lot of separate requests going as the page loads, this will definitely put a strain on your user’s browser that (here’s the punch line) is avoidable. By consolidating your Plugins’ CSS into your own, you are limiting the number of requests for CSS files down to one. That’s a nice number, right?

So this is where we actually get to the point of this tip. Each Plugin is different, so it’s a bit tricky to try and offer up an explicit walkthrough that will work for each use case. In general, here’s what you’re going to want to do:

  1. Determine what Plugins are calling their own CSS files. Open your rendered page’s source (important that it’s the live version, as Plugin calls won’t display in your templates before being rendered) and look for any calls in the head that you didn’t put there. Mark which Plugins these are from, which shouldn’t be hard to do since most Plugin authors will add comments to what they add to your theme. Good guys, them.
  2. Locate the Plugin CSS files, either via the Plugin editor in the Dashboard or, preferably, using an FTP program. The Plugin editor should give you access to everything you need, but if you’re an FTP guy like me (or girl, though then not like me) you will want to use a program. (And honestly, if we’re interested in speeding things up, why wouldn’t we want to speed up WordPress development with an FTP program?)
  3. Copy the CSS and add it to your theme’s style.css. I would also suggest you add a comment with a few bits of information: the Plugin belonging to the code you are adding, the date, and your name. Depending on what the site is being used for, your contact information may be pertinent as well.
  4. Determine where the Plugin adds the CSS to your site and stop it. This is probably the most difficult of these tips, and will require you spend some time looking over what your Plugin’s PHP file is actually doing (gasp!) and finding where the call to the CSS file is made. You’ll want to kill this request, most likely by deleting a line or two. Wouldn’t hurt to back up the files before you fiddle around in this step.

This is the most effective, and really only, way I know of consolidating Plugin CSS into one place.

Add your Javascript the smart way

Everyone loves using Javascript, but not everyone uses it the right way. To avoid loading Javascript two times (kind of like in the above CSS tip) you can adjust how you link your own Javascript into themes.

When you add Javsacript to a website, odds are that you do it like this:

<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript">

That’s fine with most sites, but in the case of WordPress you can add a call for the popular Javascript frameworks (jQuery, Mootools, and Scriptaculous) using a PHP tag:

<?php wp_enqueue_script('jquery'); ?>

I chose jQuery because it’s my personal favorite.

Why do it this way? Well, the most pertinent reason is because when Plugins are activated they will check with WordPress to see if the framework that it wants to use is already loaded on the page. If you are using this PHP instead of the standard <script> tag, then the Plugin will know and not load it again. Instant win.

Hat tip to WPThoughts for reminding me of just before posting this today.

Clean out your Plugin closet

While we’re on the topic, every now and then it’s good to do a run through of your current Plugin list. In fact, why don’t you do it right now? You have time, you’re reading a blog for goodness sake!

Check each of these points:

  • Of the Plugins you have installed, how many are you actively using? This is most important, because if you aren’t using a Plugin but you have it installed, it may be unnecessarily loading up resources that aren’t helpful for your site anymore. It’s nothing against the Plugin, it was clearly useful at one point. But think of it like the coat you have kept around in your closet, even though you haven’t worn it in ages. Just donate it to Goodwill already, it’s wasting space. Except, just deactivate the Plugin. Yeah, don’t try to donate your Plugins.
  • Of the Plugins you have installed, and are using, how many do you really need? Let’s jump back to the oh-so-awesome clothes analogy. How many pairs of shoes do you really need? Over on that shelf, all of those hats, do you really wear those? And honestly, the scarves? Okay, this is getting out of hand quickly, but I think you get the idea. What don’t you really need, or what could be handled better with something simple within your theme?
  • Of the Plugins you don’t have installed, just delete them. These Plugins don’t really contribute to your site’s download time at all, but why keep them around? Since we’re on the topic of Plugin cleanup, just delete the Plugins from your site completely.

A word or two for Plugin developers

I know this issue is on the forefront of Plugin developers’ minds as well, but just as a reminder: make it easy for users to speed up their sites using these tips. Include information in your readme files about where your CSS files are located, and how to deactivate them. If it’s appropriate, consider having an option on your settings page for completely turning off your Plugin’s CSS. And, of course, check for the user’s Javascript before loading your own.


Did you enjoy this post? Then it might be worth your time to subscribe via RSS using your Feedreader or, if you prefer, via email.

About the Author: Ryan Imel

My name is Ryan Imel, and I’m a full time freelance web developer. I work a lot with WordPress, but am comfortable with other systems too.

3 comments so far

  1. Bill Masson said:

    Hi Ryan,
    Thanks for the tips although I am a total novice and i reckon if i started messing around with my plugin files I would probably kill my blog, lol. The thing is, i tend to be one of those chaps who over does it with the plugins.
    I have 46 active plugins at the moment and i know that i should do a clean out. My blog’s loading time is cumbersome at best, there are many culprits including css and JavaScript along with various widgets. I find that tracking scripts can be pretty bad, the likes of double click, Technorati, share this and many others.

    So i will endeavor to clear out some of the dross.
    Thanks

  2. Jack Kennard said:

    Nice article, My css page must be over 1000 lines written by a developer for easy tweaking. I think I can cut the weight of the file in 1/2 just my optimizing the code, using 1 line for all the properties. What do you think cutting the file size to save weight and down load time.

  3. Adam L said:

    Ryan –

    Perfect…this is exactly the advice I was looking for. My blog is taking a good 13-20 seconds to load it’s so bogged down and I have a good feeling now it’s the CSS and Javascript calls causing it.

    Thanks for the tips,
    ~Adam

Add to this discussion

Required: We need to know who you are.

Required: Your email will not be published. This will also give your comment a gravatar. (What is a gravatar?)

Optional: This will make your name clickable.

Required: Kind of the point of this whole form, don’t you think?