jaaadesign

Speed up WordPress (multi-) site!

If you like using plugins as much as I do, your (multisite) website can get slow very fast. I’d like to share with you a couple of ways to increase WordPress’ loading speed. (At the time this article was written we were still using shared hosting, nowadays were on a VPS which basically 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.

Why is my site slow?

The most common influences on loading speed:

  1. Hosting

    Easy fix:

    Shared (cheap) hosting: limited custom server configuration possible and you will share the server with 20-50 others which means that if there’s more visits on those websites yours will get slower as well.
    VPS or Private server: fast, faster, fastest! Custom configurations, almost no need for optimization

    Plugins: WP-DBManagerOptimize Database after Deleting Revisions

  2. Server/.htaccess

    Easy fix:

    To make use of Gzip compression, Deflate, Expires Header etc etc these should be activated on your server and often in your .htaccess or nginx.conf as well. Look closely at GTmetrix/ Webpagetest test results and talk to your provider. Start by pasting this code to your .htacess file A general fix-it-all .htaccess code snippet

  3. Coding

    Easy fix:

    Plugins and themes (and WordPress itself!) are created by many, many people: research and choose your plugins and themes well to keep all coding top notch. It often pays to pay for premium plugins and themes (and consequently support WordPress). Check out the Genesis Framework and WPMU DEV, that’s all I have to say.

  4. Database

    Easy fix:

    Databases can get cluttered: clean regularly by removing all data and tables that are not used and by optimizing the code

    Plugins: WP-DBManagerOptimize Database after Deleting Revisions

  5. Plugins

    Easy fix:

    We all love them but the more you activate the more weight they will put on loading time, so choose wisely! It pays off to keep an eye out for better options. Also by using plugin Organizer you are able to stop plugins from loading on pages where they are not used AND decide the order they load in! (tip: load plugins that use a lot of jquery last)

  6. Content

    Easy fix:

    Optimize your content optimized (serve same content but smaller in size: minified, gzip compressed etc.) and caching (serve content that has been stored grouped). Images are especially heavy to load: reduce the size of your images by compressing. Consider using a CDN to load your content from a faster server.

    Plugins: Better WordPress MinifyHyper Cache, WP Smush or WP SMUSH PROBJ Lazy Load, Use Google Libraries, Wordfence Pro (because of excellent Falcon Cache addition!), WP Super Cache, W3 Total Cache, any CDN: we have happily used the free version of Incapsula for a long time

Before we begin: to speed up wordpress the WP Super Cache (my personal favorite) and W3 Total Cache are excellent and extensive plugins for caching and from what I read the latter is now multisite compatible as well. They both have a bit of a learning curve if you don’t want to blindly activate functions and hope for the best. Once installed and configured you can add numbers 1, 2, 3 and 4 of this article to further optimize your set up. From this point on this article will focus on optimizing without the use of these plugins.

Speed up WordPress in 9 steps

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

  1. Optimize Database after Deleting Revisions
  2. A general fix-it-all .htaccess code snippet
  3. Better WordPress Minify
  4. BJ Lazy Load
  5. Plugin Organizer
  6. Use Google Libraries.
  7. Hyper Cache
  8. WP Smush.it
  9. Incapsula CDN, free version

NB. This article is an updated version of the original from 2013 and to keep the used plugins lined up with the test results I have not changed them or added new ones. The following plugins we have grown to love since:

 

7 Golden Tips on Speed Optimization

These will save you at least 2 weeks of frustration:

  1. Backup your database and files
  2. Turn cache off when your testing or editing anything (but the cache itself) or you’ll be served ‘old’ content
  3. Remember that browser cache can also serve ‘old’ content –> refresh or clear browser cache
  4. Cache plugins often leave /cache/ folders in FTP, remove these before testing other cache plugins
  5. Cache plugins can leave code in wp-config and .htaccess, remove these before testing other cache plugins
  6. Don’t forget to test if your contact form/payment options etc. still work with your cache solution
  7. Backup your database and files

Step 0- Back up your website!

One of my favorite plugins all time is the WP-DBManager plugin to backup, optimize and repair your database. Copy FTP if you are able and/or make database and files backups from your hosting environment. There is no such thing as too many backups folks!

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 is a great plugin, very easy to work, which allows you to remove this extra baggage: you will be surprised at the difference in performance after using it!

Step 2 – A general fix-it-all .htaccess code snippet

Sets Expires Headers, activated gzip compression and deflate (if active on server), sets etags, etc. etc. Just copy/paste it in your .htaccess file get it here. In almost all cases a gigantic win!

Step 3 – Install the Better WordPress Minify plugin

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

Step 4 – Install the BJ Lazy Load plugin

The BJ Lazy Load plugin 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: option to have images ‘fade in’ on load: SMOOTH!

Step 5 – Download Plugin Organizer

Another one of my preferred plugins to speed up WordPress 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 if it not used there (!), 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, for example by loading plugins that rely heavily on jquery which cause a webpage to load partly, then pause, and then load the rest of the page. 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 or jquery rich to load later. Seriously, how cool is that?

Step 6 – Use Google Librairies

Just drop Use Google Libraries 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.’  TIP: check regularly (or subscribe to RSS or Twitter feed) to keep this file updated, it happened to me that an outdated version started all sorts of havoc.

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.

Step 8 – WP Smush it

Compress your images (without loss of quality) using WP Smush.it on upload or manually, the Pro version rocks even harder!

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 (I refuse), 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. 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 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 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!

A WordPress wielding, cool rocking daddy in the lowlands. Web development & SEO, development and management of multisites.
Carpentry, Yoga & meditation.