The Ultimate Guide to WordPress Performance Optimization
Get posts directly to your inbox
Kegan is an army of one. We've worked with him on numerous WordPress projects, 2018-2021 and counting. He's always current on tech and techniques, extremely responsive and thorough, and his infectious optimism fuels our projects forward. He's a rare find. Travis Culwell - AAA
17 Reviews, 5 Stars
Welcome to the Ultimate Guide to WordPress performance Optimization. Presumably you landed here because you have a slow loading WordPress site, or you just want to learn how to optimize your site so it can be the fastest, leanest, most optimized it can be.
Fret not, I am obsessed with site speed and performance, and have spent years optimizing all kinds of WordPress sites (and others, but in this guide we’re just going to talk about WordPress — the principles hold true for all websites, but will be rather specific to just WordPress).
In this guide we’re going to go over everything about your WordPress site: what hosting to use, what plugins to use, what themes to use, how to streamline your process for uploading content, and much more.
Some of the things will be on a higher level (IE what theme to pick), and some of the things will be a lot more in depth (how to remove scripts). It’s meant to serve as a guide for DIYers when it comes to your WordPress website. PLEASE PLEASE PLEASE test everything before making any code changes!
Step 1: Measure
The age old saying goes, “you can’t improve what you don’t measure.” So before we even begin, lets put our site through Google PageSpeed Insights, and the Pingdom speed test. Both of these speed tests will give you an excellent starting point when looking for things to improve.
In fact, if you just follow their suggestions (and do nothing else) your site will likely rank 90+ for speed and performance.
Within these suggestions there are a lot of things you can control with the WordPress codebase (serving styles, scripts, fonts, etc. from the same domain for instance), but there are also a lot of things you can’t control with just WordPress alone.
That brings us to hosting.
Hosting Your WordPress Site
You’ll often notice a suggestion for improving site speed is to “Reduce initial server response time.” This is, of course, outside control of WordPress itself and requires a good web host.
In short, there are two types of web hosts: shared and dedicated. A shared host will host your site along with thousands of others on the same server. They’re cheap, slow, and not optimized. They cost around $3/mo, and are often a security risk too.
With dedicated hosts, you’ll get a server specifically built for WordPress, but will have to pay a little bit more ($25/mo). The benefits are well worth it, though. The two I recommend are WPEngine and Kinsta. Aside from the obvious benefit of focusing their servers specifically on WordPress they automatically back up your site every day, make adding an SSL super easy, and automatically cache your content for you.
All-in-all, without a good host the rest of this article is rather moot. Of course, you can optimize your WordPress site without it, but you will never achieve that coveted 100 score.
Many sites have dozens of plugins. Part of the problem with this is the fact that these plugins carry a ton of bloat with them. They’ll often load scripts and styles from third parties, add a ton of features you don’t need, and ram ads down your throat to upgrade to their premium (cough Yoast cough).
Here are the plugins I use, and that I recommend you also use. These have very little bloat, and will really help to improve your WordPress performance optimization. If you need functionality outside of these plugins, I would highly recommend hiring a developer (we can build whatever you need and nothing more, nothing less… this will keep your site lean, and easier to maintain).
Advanced Custom Fields
If I could pick one and only one WordPress plugin it would be this one. Advanced Custom Fields allows you to easily add custom metadata to any post, page, post type, taxonomy, etc. and easily call it in the code. They have extensive documentation, and make it super simple to build out custom options.
Instead of hard coding text into the theme files (generally a big no-no as you have zero flexibility), you can add a custom field and display that custom field if there’s a value.
Advanced Custom Fields has support for the WordPress Gutenberg editor, so you can now easily create your own blocks (and frontend templates for them), and the support is only going to continue to get better.
This plugin is a bit more code-heavy than some of the rest, and requires a bit of knowledge on how to edit theme files and write a little PHP, but you can get started here.
There are a ton of form plugins, but Gravity Forms stands head and shoulders above the rest. Gravity Forms allows you to easily create forms, manage entries, send notifications and much more.
They also allow you to setup conditional logic which allows you to send various email notifications or display other form fields based on user input data.
You can also easily display forms within the Gutenberg editor, on the sidebar, or via shortcode.
Gravity Forms does cost $59/year for a single site, but is easily worth the cost. You’ll never lose entries or worry about emails not being sent. There are a number of free alternatives (like Contact Form 7), but they don’t store the entries and often the confirmation emails get caught by spam filters or don’t send at all.
Because inbound leads are so important, the $59/year is well worth the cost to never have to think about it.
Imagify with compress your images, and output modern image types to allow your site to load much faster. There’s not much you have to do after the initial setup, and they’ll compress 20mb of images for free each month.
I recommend turning on the setting to output the WebP format images, but that will change some of the HTML on the front end of your site. Regardless, you should be compressing images automatically upon upload, and Imagify does that perfectly.
All of your icons should be in SVG format. Ideally, they’re not the
src of an
img tag but rather the actual XML output of each file. Either way, WordPress does not allow SVG upload natively, so you’ll need this plugin.
I use Noun Project for all my icons (you can download icons in either SVG or PNG format).
There are a number of good SEO plugins out there, but Rank Math is the best (especially when compared to Yoast). It’s relatively simple, and very comprehensive. They walk you through the entire setup process, and give you a ton of content add-ons to make sure you’re getting the very best data you possibly can. They integrate nicely with WooCommerce, and Advanced Custom Fields, so you can get a better sense of how everything will rank.
Their baseline product is free, but you can upgrade to premium plans.
Autoptimize & Critical CSS
These two plugins are crucial for a fast site load time. Autoptimize will compress all your CSS & JS, lazy load your images, and much more.
They integrate with a product called Critical CSS. The thought is this: your web page cannot load with the CSS, and instead of loading all the CSS at once, if you just load the above-the-fold CSS (or the critical CSS), your site can be viewed while the other styles load in the background.
Plugin Products & Cost
- Advanced Custom Fields (ACF) Pro – $49/yr (or free for the basic version)
- Gravity Forms – $59/yr
- Imagify – Free up to 20mb
- SVG Support – Free
- Rank Math – Free
- Autoptimize – Free
- Critical CSS – $10/yr
Note: these are all included (aka free) if you have me setup WordPress for you.
The plugins mentioned above are the plugins that should be on every site, regardless of other functionality. But there are going to be times where you might need some more functionality. Here are some of my other favorites.
Events & Calendar
There are a number of plugins to help with calendars and events, but the one I prefer is The Events Calendar. Their basic functionality is pretty much all you need to setup events, and display them on the front end of your site. They have a ton of add-ons for things like tickets, virtual events, etc. but their flagship plugin is free and always will be.
Yoast Duplicate Post
Yoast Duplicate Post is a plugin that allows you to easily clone posts, while maintaining all the settings. Often you’ll have one type of page where all you have to change is the title, featured image, and content, but don’t want to have to set everything up from scratch. This plugin is great for that.
Note: if you have a custom post type you have to go into the duplicate post settings and enable cloning for that post type.
Plugins to Avoid
With the vast wasteland that is the WordPress plugin scene, there are some plugins you should try to avoid at all costs. There are of course, more plugins than just what’s listed here that you should avoid, but it’s too big to name. Instead here are some popular ones you may be inclined to try that you should stay away from.
If I had a nickel for every time someone emailed me saying their form entries were lost because of WPForms, I would be rich. Their free version does not store your form entries on the backend of WordPress. Instead they require you to upgrade for this functionality. Their basic version does allow for emails to be sent notifying you of a submission, much like Contact Form 7, but they’ll just pester you to upgrade.
WPForms is an extremely popular form builder because they’re owned by WP Beginner, a huge blog with a ton of SERP space on Google.
SSL & Redirect Plugins
There are too many to list. But this functionality should be done at the host level.
Word Fence is one of many “security” plugins for WordPress, but often leave your site extremely cluttered. You’re given too many choices to make, and most of these choices should be made at the host level. With WPEngine or Kinsta, you don’t have to think about these and can rest easy knowing you have a secure server.
Unfortunately, this is the most popular SEO plugin out there. But beware: it’s riddled with ads, and holds features back to get you to upgrade. Truth be told, for most sites your SEO plugin doesn’t matter as they all pretty much allow you to ad keywords and meta descriptions, which is good enough for most sites, but there are much better options than Yoast out there.
For the most part you should let your hosting do the heavy lifting when it comes to things like caching, but sometimes you’ll need a plugin for these types of things. WP Rocket or Perfmatters are two great plugins that are similar to Autoptimize but offer a few more features for performance that would normally be handled at the host level.
There are too many WordPress themes to list, so lets talk about some high level choices when it comes to themes. First, make sure you put the theme demo through the page speed test. If the demo can’t score high, then you’ll already be starting off on an uphill battle. I’m not saying that it can’t be done. The demos are, after all, much more comprehensive than your pages will likely be. They have to show off all of their features.
The problem with all these features, of course, is that you don’t need about 80% of them. But the styles and scripts associated with them will be loaded regardless of whether you use them or not. Of course, a custom theme is the answer to this, but it’s also a lot more expensive.
Aside from making sure the demo will score okay on a page speed test, you should be looking for simplicity. Think about a user landing on a page, making one or two clicks to take some kind of action (fill out a contact form, call you, make a reservation, etc.). Often times you don’t need all the bells and whistles to make this happen.
Lastly, check reviews, and how often the author updates the theme and what kind of support they have. A lot of the bigger themes on Theme Forest will offer yearly support. You may or may not need this depending on how often you plan to make changes to your site.
Regardless of how often you change your site, however, you will definitely need to keep it updated. And this is where a good theme developer and host really come into play. If you let your site fall by the wayside it will become susceptible to all kinds of security threats.
While it’s easy to ignore all the update notifications WordPress sends, it’s pretty important that you keep it up to date. I generally recommend at least updating on every major version release. They’re constantly making changes and improvements to the WordPress core, that much of WordPress performance optimization can be achieved simply by running updates.
Plugins, however, create a bit more of a headache. There are so many moving pieces, and taking them all into account is often very difficult. For the most part, plugins should be updated on a staging site (or your local site), and well tested, before deploying them to your production site.
Last, if you’ve bought a theme on Theme Forest (or something similar), make sure that you create a child theme, and make all your customizations to the child theme. That way you can continue to update your theme, and not lose your customizations every time you do.
All in all keeping your website updated across all code (WordPress, plugins, themes), will save you a lot of headache when things are deprecated year after year. Likely your site won’t break, or have any noticeable decay with each update you don’t run, but in the long term something will break and it’s usually a nightmare trying to debug and restore websites that break.
If you have one of the web hosts mentioned above, they will automatically run updates for you, as well as keep your site backed up just in case anything goes wrong.
Often, the lowest hanging fruit when it comes to WordPress performance optimization is your media (images, videos, etc.). For the most part images should be compressed and served in next gen formats (WebP). This can be done with the Imagify plugin, automatically on any image upload.
There are a bunch of sites that you can manually compress images with, but for the most part it should be handled automatically, on every image upload. It will save you a lot of headache.
A lot of websites can save tons of load time by just compressing images. IF YOU TAKE NOTHING ELSE AWAY FROM THIS, TAKE THIS: COMPRESS YOUR IMAGES. But to take it one step further you should serve images in WebP formats. This can save 40-50% on even compressed images.
There are a lot of other types of media, too. In fact, too many to cover here, but try to avoid using other domains to add media (YouTube embeds, etc.), and instead either self host or defer loading. Often times
<iframe> elements will cause a lot of pages to load really slowly, because the browser has to render an entire other site within your site.
To close, WordPress performance optimization is usually a lot of tinkering. Trying things, seeing how they effect your site, rinse and repeat. Remember: user experience trumps all. Keep your users in mind when implementing some of these things. Maybe you can’t cut out scripts from your forms because you need a lot of validation to make sure users are submitting good data. Maybe you need to add other plugins to help with other functionality.
Speed is not the end-all-be-all of a website, but remember: no one sticks around for a slow loading website. Speed is rarely noticed by users, unless your website takes forever to load. Users want answers, and they want them now.
It’s an easy rabbit hole to go down: getting your site to score a 100 on the page speed test. But remember, speed is usually a tie-break when it comes to SEO, and as long as you’re above an 80 your website is probably doing just fine.