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:
-
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 optimizationPlugins: WP-DBManager, Optimize Database after Deleting Revisions
-
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
-
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.
-
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-DBManager, Optimize Database after Deleting Revisions
-
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)
-
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 Minify, Hyper Cache, WP Smush or WP SMUSH PRO, BJ 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:
- Optimize Database after Deleting Revisions
- A general fix-it-all .htaccess code snippet
- Better WordPress Minify
- BJ Lazy Load
- Plugin Organizer
- Use Google Libraries.
- Hyper Cache
- WP Smush.it
- 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:
- Minit – ‘Plugin to combine CSS and Javascript files’
- Minqueque – ‘Minify & Concatenate Enqueued Scripts & Styles’
NOTE: easy plugin with great speed optimization gains but unfortunately not very SEO friendly: prevents Google to access parts of content - Wordfence Security – ‘Protecting your website from hacks and malware’
NOTE: one of our favorites and because of the Falcon cache option (Pro only) not just for air tight security!
7 Golden Tips on Speed Optimization
These will save you at least 2 weeks of frustration:
- Backup your database and files
- Turn cache off when your testing or editing anything (but the cache itself) or you’ll be served ‘old’ content
- Remember that browser cache can also serve ‘old’ content –> refresh or clear browser cache
- Cache plugins often leave /cache/ folders in FTP, remove these before testing other cache plugins
- Cache plugins can leave code in wp-config and .htaccess, remove these before testing other cache plugins
- Don’t forget to test if your contact form/payment options etc. still work with your cache solution
- 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!
Gabe Livan says
Plugin Organizer is a very useful plugin (a must I would say for improving WordPress speed), but not enough. Sometimes you need to load a plugin on a page/post, but that plugin loads, for instance, 4 JavaScript files and 2 CSS ones. You only need half of those in that page to load. To reduce the number of HTTP requests, you can use you can use “WP Asset Clean Up” (https://wordpress.org/plugins/wp-asset-clean-up/) to prevent specific scripts (.JS) & styles (.CSS) from loading on pages/posts and home page. Combined with Plugin Organizer and a caching plugin, it will make a huge difference in loading time.
Ashutosh Jha says
Hey Nick,
This was quite a wonderful tips to decrease speed. I agree to you on the points of using less plugins and minimizing internal Javascript codes.
Thanks for sharing
Dennis says
Thanks for this article. It helps me to understand how to speed up my homepage :) I think everyone should edit his .htaccess. because it´s really useful.
says
Glad to hear it Dennis! In case you use @font-face self hosted fonts: I’ve updated the file with Expiration Dates for @font-face, it really cut some time off the loading speed of my AMP articles!
Michele Holley says
I need a little more help with this process as I am not a techy type…do I network activate all of these plugins? Once they are installed and activated is there anything else I need to do?
Peter says
Hello. There are many optimization techniques to speed up a WordPress site, but I think that the most essential is to host the site on an SSD VPS hosting. I noticed great improvement immediately after the switch. Thanks
Mike says
Very nice tutorial – I am using almost everything mentioned but I didnt know about the plugin organiser – I think it could be big games changer when I will instal this and try – bcs on some of my big webpages I am using a lot of important plugins. Thank you for recomendation.
says
You’re welcome Mike! (and I agree, I use it standard on all my larger sites)