wordpress-performance-large

How to improve your WordPress site speed and performance

Trevan Hetzel's Layout avatar

You’ve spent months designing a stunning WordPress site and working with clients and collaborators to create something truly special. Now you’ve launched it to the public, and yay! You’re all done. But, wait…it’s kind of slow. You know that site speed is crucial to the success of your business (and that of your client’s). Time and time again, you’re hit over the head with scary statistics like “nearly half of web users expect a site to load in two seconds or less,” and “users tend to abandon a site that isn’t loaded within three seconds.”

It’s easy to feel frustrated at this point in the project, but don’t fret. Before you knock down the door of your web host or add a ton of sketchy plugins, follow these easy steps to make your WordPress site smooth, solid, and super speedy.

Step one: Test!

Before you get started, it’s important to take some measurements and run a few tests to get some benchmarks, so you’ll know if the changes you’re making are actually improving your site.

wordpress-performance-bench

To test the speed of your site, your best bet is a combination of WebPageTest and Google PageSpeed Insights. WebPageTest gives you a good idea of the actual time (in seconds) that a site takes to load, and these metrics will help you  know whether it’s the back-end or front-end causing a site to load slowly. Google PageSpeed Insights is best for looking at how your site is rendered by the browser and can help you identify what you can improve on the front-end.

Step two: Make sure you’ve got the best host

The price tag of shared hosting always makes it seem like a bargain, but it comes at a different cost: slow site speed, irregular performance, and frequent downtime. The stress isn’t worth it, especially when you have the ability to choose a managed WordPress host (like Flywheel!) that’ll take care of a huge chunk of your WordPress performance woes. When it comes to hosting, you don’t want to mess with last-minute migrations, hacked sites, sub-par servers, and unexpected downtime at the most important times.

With Flywheel, support is top-notch, the dashboard is beautiful and easy-to-use, your site will stay secure, and you’ll have a whole plethora of features at your disposal. Check it out!

Step three: Audit your plugins

The addition of plugins to a site can bring a lot of functionality and fun stuff that makes your site far beyond basic. Unfortunately, many bring a performance overhead with them. We’ve seen so many slow sites that are immediately cured just by deactivating a few plugins. The best way to avoid a migraine from managing plugins is to keep performance in mind as you are developing your site. “Don’t spend weeks relying on a plugin only for it to become the bane of your existence ” when you find out it makes your site extremely slow. Read reviews, test them regularly, and be sure you’re updating them to the latest version when it’s available.

wordpress-performance-logic

All this negative talk about plugins is only to make you aware of the potential risks involved when using bad ones. These are usually plugins that are developed by inexperienced programmers or those that make a ton of database queries and require intensive logic processing. However, there’s good news! There are thousands of worthwhile plugins that don’t make your users and readers frustrated when they crawl around your site. The magic trick is just to use those, and not the slow-performing ones.

You can track down which plugins might be causing performance losses on your site quite easily. We generally use a plugin called P3 Profiler that sifts through your whole site and reports back what percentage of total load time each plugin is responsible for using. If you’re serious about speed, you’ll run a P3 Profiler test each time you activate a new plugin, to ensure you’re not installing something that will sacrifice speed. Plus, by benchmarking your plugins right off the bat, you won’t waste time messing with a plugin if it’s not going to perform well in the long run.

If there are plugins that you just can’t live without but still make your site slow, there are ways to continue using them. Generally, if you determine that a plugin is loading slowly, the next step is to increase the memory on your server. Eliminating the need to do this is the best plan of action, but there probably are a handful of plugins that you might find yourself not willing to ditch (WooCommerce, for example).

With Flywheel, you can always upgrade your plan to get more memory and, thus, more speed. Learn more about our plans here.

Step four: Cache everything

Caching, both on the server side and client side, is an important part of WordPress site performance. Once a user loads your site for the first time, you can take advantage of browser capabilities to cache the contents of that site locally, so on the next visit the user already has them loaded.

Similarly, on the server side, having a caching layer works wonders for serving your site up very quickly. The most common way to cache server-side with WordPress is by using the W3 Total Cache plugin. This plugin (or one similar) is needed on almost all hosts. The exception to this rule is Flywheel; we handle server-side caching for you behind the scenes with Varnish. Using Varnish instead of a plugin can increase speeds dramatically because Varnish never has to talk to PHP. It serves up cached static copies of your site immediately (without even touching the PHP application layer), whereas plugins are still run by PHP.

On managed hosts like Flywheel, the server-side caching tells the browser how long to cache things by setting ‘expires headers.’ The browser won’t ask the server for more information if those headers tell it not to ask. You mainly have to start thinking about caching when you start installing plugins or third-party themes. Theme and plugin developers can set their own headers that can override your host’s default settings, aversely affecting the caching mechanisms.

WooCommerce, for example, disables server-side caching by setting cookies. It’s typically not very apparent when plugins or themes disable caching, so a good thing to do is reach out to your hosting provider and ask that they force cache your site. Be careful not to force caching on pages that truly need cookies to work, though, such as WooCommerce cart and checkout pages.

Step five: Use a CDN

A content delivery network (or CDN) is a network of servers that serves up your website and its assets from different locations based on the user’s location. For example, let’s say you’re not using a CDN and your site is hosted in San Francisco. When someone from, say, Barcelona visits your site, they have to retrieve all your assets from your server in San Francisco.

wordpress-performance-cdn

The long distance between the two locations clearly takes longer than if someone from San Francisco loads your site that’s hosted in San Francisco. A CDN serves your assets from a bunch of different servers based in New York, Seattle, Omaha, Paris, London, Beijing, AND San Francisco (and many more). The idea is that users will hit the server closest to them and not sacrifice load time since there’s a smaller distance between them and the server. With a CDN, that same person from Barcelona will now hit a datacenter in London or Paris, instead of San Francisco. Using a CDN will definitely increase the speed of your site for users throughout the world!

Some of the most popular CDNs include Amazon Web Services, CloudFlare, and MaxCDN. Most of them have free plans, but if you pull a lot of visitors and have lots of assets, you’ll most likely have to pay for a CDN. They’re typically easy to set up, but if you want a super easy setup solution, you should check out Flywheel’s MaxCDN add-on.

wordpress-performance-ebook

Site still slow? Download this ebook for three more advanced techniques, including how to properly downsize and load static assets and how to write efficient theme logic.

After you’ve gone through these performance-enhancing practices, if your site is still really slow, we’d recommend hiring a developer who can look into it and find the source of the problem and/or choosing a new WordPress host.

Comments ( 6 )

  1. Frank Welsch-Lehmann

    March 24, 2016

    How do you rate the possibilities of https://premium.wpmudev.org/project/wp-hummingbird/ to Prioritize Visible Content and to Remove Render Blocking Resources as far as performance is concerned? I know that their caching features will not be accepted @ flywheel but I would like to know about the effects of the other two features.
    Tx.

    • Trevan Hetzel

      March 24, 2016

      Hey Frank! I have not used Hummingbird, so I can't speak with certainty on its usefulness. But the fact that it minifies and concatenates CSS & JS resources is definitely good. If it inlined critical CSS, that would be pretty cool as well (couldn't tell from their site if they do or not). Beyond that, the GZIP features would be good if you're not on a host that provides that already (Flywheel does).

      To be honest, I've always been of the mindset that these things should be done by the theme developer, not a third-party plugin. I realize this gets more difficult when you're dealing with a theme that you didn't custom build, but it might be worth checking out the techniques I list in this article https://getflywheel.com/layout/wordpress-site-fast-front-end-performance/ that would address the two features you mentioned that Hummingbird does :)

  2. Tyler Golberg

    April 8, 2016

    I've played around with Hummingbird because I love the idea of being able to concatenate those scripts & stylesheets. It works very well with WPMU plugins. I reduced my calls by about half. However, it breaks the functionality of a lot of plugins not in their suite.

  3. Dan Knauss

    April 28, 2016

    Some performance optimizing plugins that work well at Flywheel, good for any site:

    Widget Output Cache -- cache your widgets.
    Better WP Minify -- seems unmaintained but continues to work.
    Cache Buddy -- caches much of the front end for logged in users.
    WordPress Instant Articles -- DNS prefetch and page pre-rendering.

  4. Marcus

    May 19, 2016

    Why not do some case studies? Get three website owners and run some tweaks and tests, with a bit of guidance. Not everyone is clued up on all this, and to be honest, it is along time since I delved into it. Is Varnish and a CDN enough for most ordinary sites, or do I need to tinker to the max?

  5. Luke Cavanagh

    September 8, 2016

    Cache Enabler
    WP Fastest Cache
    CDN Enabler
    Autoptimize
    Imagify
    ImageRecycle

    Are all solid options to look at for static caching, minification and image optimization.

  6. Gino Petitti

    April 12, 2017

    What about WP ROCKET?

Join the discussion