Speed up your WordPress (multi-) site!

8 Flares 8 Flares ×

jaaadesign

If you like using plugins as much as I do, your (multisite) website can get pretty slow very fast. I’d like to share with you my way to increase WordPress speed. (At the time this article was written we were still using shared hosting, nowadays were on a VPS, which basicly means that we get AAA ratings without the use of plugins.) The overall configurations mentioned in this article could use some fine-tuning depending on the plugins you’re using AND the direct user experience (after all these are just colored letters) but in any case these ratings are certainly not a bad place to start.

Before we begin I’d like to add that for a regular WordPress website installing W3 Total Cache would probably be the first thing to do but since this great plugin is not yet fully multisite compatible we will have to work around it for now. If you intend to apply this article on a single site installation the steps are pretty much the same, but starting with W3 Total Cache. Note: I have had no experience with the combination W3tC and Hyper cache.

Info on the climate of this performance upgrade, I’m using:

- Shared hosting (These days we use a VPS and none of the below is relevant anymore)
- A multisite network with about 10 very different websites on it
- About 35 plugins (told you I like plugins!)
- All tests are run on the Jaaa!Design homepage which features about 10 images, a blog feed, a recent article widget, a recent comment widget, a rotating last tweet widget, an authorsure rendering and a quotes widget.

So you see that circumstances are less than favorable here…

Featured plugin: In Post Ads

Yes this is an ad but doesn’t it look great? Let’s get Inception on this mother and promote it

Premium plugin
Find out more

WordPress performance boost in 9 steps

We’ll be using 7 plugins, 2 snippets of code and the free Incapsula CDN service, in this order so they will line up with the test result images:

  1. Optimize Database after Deleting Revisions by Rolf van Gelder.
  2. A snippet of code generated by the W3 Total Cache plugin
  3. Better WordPress Minify by Khang Minh.
  4. BJ Lazy Load by Bjørn Johansen.
  5. Plugin Organizer by Jeff Sterup.
  6. Use Google Libraries by Jason Penney.
  7. Hyper Cache by Stefano Lissa
  8. WP Smush.it by Dialect.
  9. The free Incapsula CDN service
  10. Activate deflate

To keep this article manageable we will not go into specific details on how these plugins work, just global information and configuration.

Step 0- Back up your website!

I have had very good experience with the WP-DBManager plugin develloped by Lester ‘GaMerZ’ Chan. Note: Since there’s a lot of good feedback on the ‘Snapshot’ plugin I probably will be checking that one out pretty soon!

Step 1- Deleting revisions

Old posts and pages (and a post/page is ‘old’ after a single change) are stored on your database and will slow down your website, especially that much valued First Byte Time. The Optimize Database after Deleting Revisions by Rolf van Gelder is a great plugin which allows you to remove this extra baggage, you will be surprised at the difference in performance after using it!

Step 2- W3 Total Cache generated code

As mentioned before the W3 Total Cache plugin by Frederick Townes is an absolute must for a single site installation but unfortunately to this day not fully multisite compatible. Believe you me: I’ve tried! The plugin can not be network activated and when activated site-by-site the configurations get mixed and turns out generally unstable. After configuring one site properly it did however produce a piece of code in the .htaccess file that I was very happy to use.

Just copy/paste it in your .htaccess file, you can find it here.

Step 3- Install the Better WordPress Minify plugin

There a several good minify plugins around, I prefer the Better WordPress Minify by Khang Minh because of performance and compatibility with other plugins.

Featured plugin: WP-DB Manager

Plugin which allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up, optimizing and repairing of database.

Free plugin
Find out more

Step 4- Install the BJ Lazy Load plugin

The BJ Lazy Load plugin by Bjørn Johansen is one of my favs, it allows you to choose which element of your content under the fold will be loaded immediately or on scroll. This will load the initial view much quicker and will save bandwidth at the same time. Last but not least: loaded images will smoothly ‘fade in’ which adds grealy (I think) to the user experience.

Step 5- Download Plugin Organizer

Another one of my preferred plugins to excellerate WordPress performance is Plugin Organizer by Jeff Sterup. It has quite a few nifty tricks but the ‘selective Plugin Loading’ and the ‘Plugin Load Order’ options I like best. Basically it means that you can now tell WordPress not to load plugins that are not used on a specific post or page (!), which will reduce HTTP requests and thus loading time. This option is also a great tool to bypass conflicting plugins and still use them on your website.

The ability to change the loading order will allow you to tweak your performance even further, just look at our webpagetest result  and you will see that the Authorsure plugin is first called in the waterfall; now you can actually put it first in the list of plugins to load! Another aspect of this function -that might not bring your grades up but is essential for the users’ experience- is tweaking the time that it takes to visually render a certain plugin, let’s say the Facebook Twitter share plugin under the post title. Personally I really dislike having to wait for it to display until the rest of the page is loaded, it is messy and suggests that the website is slow in general. Now you can find the best position for it to load and time-push a plugin that is active under the fold to load later. Seriously, how cool is that?

Step 6- Use Google Librairies

Just drop Use Google Libraries by Jason Penney in the mu-plugins folder and you’re able to  ’use the content distribution network side of Google’s AJAX Library API, rather than serving these files from your WordPress install directly.’ 

Step 7- Hyper Cache

It turned out to be nearly impossible to find a compatible cache plugin for my networks, imagine my relief when I stumbled into the Hyper Cache plugin by Stefano Lissa! It performs very well (just make sure you make the required adjustments mentioned on the website) and also reduces your bandwidth a lot. I mean what, 90% or so? Yep.

NB. I would not recommend to use this plugin on networks where anyone can register, since this plugin needs to be deactivated before every update.

Featured plugin: Ultimate Branding

Ultimate Branding allows you to easily white-label the entire WordPress admin area, from the admin bar, to the dashboard and a whole lot more besides.

Premium plugin
Find out more

Step 8- WP Smush it

Compress your images (without loss of quality) using WP Smush.it by Dialect, which everyone seems to like a lot. Somehow using this plugin doesn’t always works so smoothly, automatic Smushing hardly ever works (with me anyway) and the experimental feature ‘Bulk smush’ often return with a time out. Nevertheless, manually smushing hardly ever produces problems. Except on Ipad. And when it rains.

UPDATE: Wp-Smushit is now under care of WPMU DEV and since I’ve found no more glitches to complain about.

Step 9- Incapsula (free) CDN service

I have tried to hook up with several free CDN services and before Incapsula I never got it working. Either it was too complicated, or a credit card number was required (don’t have one), or it just didn’t work at all. I’m glad that I kept trying though, this CDN service really brings the speed of the website to excellent levels, as you can see on the final webpagetest image.

Incapsula has a beautiful website and signing up is easy, plus and the support is great even for free accounts. They will improve performance, save you a great deal of bandwidth, and add security. You’ll have to make an account, sign up a website (as much as you want) and make the required DNS changes. Incapsula will send an email when this is done correctly, easypeasy. (Note that after you have made some changes in your DNS settings you have to give it a couple of days before you test your website!) Caching will improve over the next weeks.

I wrote a short article with detailed information on how to set up Incapsula here.

Step 10- Activate deflate

Deflate has to be a allowed on the server so contact your webhosting about this. Then add this snippet to your .htaccess file,  I found it on the net (Antonio Madonna) and it proved very useful, get it here.

Final results

By using these recommendations the tested homepage now:

- Loads in 2.3 seconds instead of 4.5
- The Repeat View (referring to the site’s ability to cache) went from 1.8 seconds to 0.6
- Instead of 37 requests now only has 28
- Loads 158KB compared to 400KB
- First Time Byte went from 0.78 to 0.24

I hope you have enjoyed this article and that it was of use to you, if you have any questions, additions or remarks please do not hesitate to leave me a comment below. Sharing this article is appreciated!

 

I am currently designing a new theme for jaaadesign and you would help me greatly if you’d give me your opinion about this website! Please use the comments erea if you have something to add to your answers.

  • Which of the following statements would you say apply?

    View Results


 

8 Flares Facebook 1 Twitter 3 Email -- Google+ 2 LinkedIn 2 8 Flares ×
Over

A Wordpress wielding cool rocking daddy in the lowlands. WPMU DEV member, carpenter, Yoga and meditation.

Getagd met , ,
Geplaatst in How to...
17 reacties op “Speed up your WordPress (multi-) site!
  1. John zegt:

    For speed up your site you need choose right social button plugin,
    social share button will slow down your site.. Many people didn’t know
    about this. social button are big time effecting your site speed. Mostly webmaster uses the facebook and twitter social buttons in site.I found nice article about this.

    http://wordpressapi.com/2013/06/05/social-button-slow-wordpress-site/

  2. Johan Horak zegt:

    Hi Thanks for this. I will now also try Incapsula. I tried Google Libraries but it did not work with Jetpack galleries.

  3. Mark zegt:

    Hello,
    Thank you for the article. Have you tried using WP Super Cache?
    I’m also trying to figure out a nice cache and speedup system for a multisite but can’t get a hang of it.

    • zegt:

      Hi Mark I haven’t used Wp super cache with shared hosting but recently had great experience using it on VPS, on a multi network installation even. I think it would be save to assume that it will work very well on a single multisite. Found it very easy to install and configure (used the directions given on WordPress.org), but because the plugin needs to be network activated there was no way to disale it on a single website which got confusing (changes would be delayed because of caching) when I did some work. Good luck!

      • Mark zegt:

        Thank you for the answer.

        I have installed it but haven’t noted a noticeable speed increase. I might just be that I’ve build a badly optimized website.
        I’ll keep trying.
        Have a good day

        • zegt:

          Just in case: make sure you do testing via 3rd party like webpagetest or log out to check caching, OR make sure to uncheck the ‘cache only for logged out users’ box.
          On a less obvious note: always make sure you have deleted all folders of the previous caching plugin! Use FTP to check the wp-content and uploads folder. Just recently I made the mistake not to check this and it really messed with my head!

  4. Bart zegt:

    Een heel goed artikel, Jaan. Blij om te constateren dat ik met uitzondering van Smush it en de Hyper Cache plugin, al deze plugins al gebruik. Voor het cachen gebruikte ik de W3Total cache plugin, maar de Quick Cache plugin is veel gebruiksvriendelijker en werkt zeker even goed…

  5. zegt:

    Hoi Bart bedankt voor je reactie, ik heb ook veel goede dingen gehoord over Quick cache maar denk dat één van mijn standaard netwerk geactiveerde plugins een conflict veroorzaakte want heb hem nooit goed kunnen laten werken. Wat betreft Wp smushit ben ik wat hard geweest inmiddels werk hij naar behoren en kan ik er zonder ergernissen van gebruik maken!

  6. Just want to say thanks for your recommendations to speeding up a WP Multisite. I had a client site that was incredibly slow. Once I set up, with a CDN and now the site is now super fast.

    • zegt:

      Hi James I’m happy to hear that! I see you’re from Brighton? Next year I’m moving there! It’s good to know I’ve already made contact with a fellow ‘Pressie!

  7. Robert zegt:

    Hey Nick,

    op de pagina van hyper cache raden ze lite cache aan, ervaring hiermee?

    Tevens, kunnen al deze plugins geinstalleerd worden en werken ze dan automatisch met alle multisites (ook bij het gebruik van domain mapping?) ivm CDN etc (ik gebruikt CDN77)

    Heb je tevens nog handige tips ivm roundrobin and backups voor multisites?

    Bedankt voor het article :)

  8. zegt:

    Hoi Robert, bedankt voor je reactie. Ik heb geen ervaring met Lite Cache maar als Stefano Lissa dit aanraadt zou ik er zeker vanuit gaan dat het de moeite waard is. Ik heb wel uitgebreide ervaring met Hyper Cache die je per site moet activeren, en is dus niet voor elke site automatisch geactiveerd. Nadeel is dat met elke update deze plugin eerst gedectiveerd moet worden en is dus minder geschikt voor websites met leden.
     
    De andere plugins in dit artikel kunnen -bij mijn weten- allemaal netwerk geactiveerd worden waarna de meeste hiervan per site ingesteld moeten worden. Het is echter ‘good practise’ om een plugin waar mogelijk per site te activeren zodat alleen Google Libraries (mu-plugins) en Wp Smush.it (uitzondering op de regel omdat die werkelijk op ELKE website toegevoegde waarde heeft) overblijven. Dit heeft geen invloed op je domain mapping.
     
    Ik heb helaas geen ervaring met Round Robin i.v.m. backups.. Succes!

  9. Fabrício zegt:

    you got to use cloudflare before Incapsula? if so, the results were very different?

  10. Chris zegt:

    I am a wp mu developer also but am currently running under shared hosting on hostgator and it’s a DOG to be honest. Page speed tests worldwide are good although not brilliant.

    I too am thinking of moving to a VPS but am wondering if you have any recommendations on that?

    Thanks for your article… bookmarked for later reading in case I don’t move to a vps.

    Cheers
    Chris

    • zegt:

      Hi Chris thanks for your reply. Yeah a post about VPS hosting has been in the making for a while now! I’ll give you the short version:
       

      I have been with the same hosting company since the start of my WordPress journey and was lucky to have picked an excellent one: Yourhosting. This dutch company is not the cheapest but I wouldn’t call it expensive either. Thing is they have an amazing helpdesk which really took care of me in times when I didn’t even know what a hex color was. I mean: there are some relentless bastards over there going above and beyond to help a customer out, and believe me I really pushed the envellope :-)
       

      When it was time for me to grow and switch to VPS I really did some investigating and found some great options (seelater in this post) but eventually I stayed with these guys, because of trust and also out of loyalty. They have not let me down! VPS is fast (so fast it’s not even tweakable, all effort (plugins) just ends up slowing it down!) and the service is still marvelous.
       

      Downsides: no Cpanel (although the native panel is great), not the cheapest
       

      In my search for VPS hosting I eventually stayed with Yourhosting but it was a very close call with Aecnu WPMU hosting, which provides affordable VPS hosting using servers specificly tweaked to WordPress! I have had extensive email contact with the owner Joe Anderson who (besides being a stand up guy) really knows his business. Although I have not had direct experience I would not hesitate to vouch for this company. I will probably be doing business with Aecnu at some time in the future.
       

      Last but not least: I love WPMU DEV. Besides all of their plugins, themes and professional help they also have excellent articles on everything WordPress, and that includes an in-depth investigation on hosting. See link below.
       

      Chris, I love to hear how VPS will work out for you! Greetings, Nick
       

      Yourhosting (aff) link
      Aecnu WPMU hosting
      WPMU DEV article
       

1 Pings/Trackbacks op "Speed up your WordPress (multi-) site!"

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Verplichte velden zijn gemarkeerd met *

*

De volgende HTML tags en attributen zijn toegestaan: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>