WordPress is a very powerful and popular Content Management System (CMS). It currently powers over 36% of all the sites on the internet. That means every one in three sites that you visit is most likely running WordPress. Sites like EA, CBN, ESPN, and even The White House, all use WordPress to power their sites.
I personally think WordPress is the best solution for business owners and even enterprise sites when it comes to simplifying the online marketing of their website.
A Slow Website
Even though WordPress is super popular, using it can also come with a price. And that price is performance. WordPress was initially created as a blogging platform. But it has evolved into much more than that. With that evolution comes the need for more functionality. And with so many different configurations out there, WordPress can run quite slow if not set up correctly. 🐌
A slow website will always be very detrimental to a visitor’s experience. It can play a significant factor in your bounce and conversion rates. The days of dial-up are long gone, and people don’t have the patience they used to. If they’re stuck on a page waiting for 5 seconds, they’re most likely going to hit the back button and pick the next search engine result to find what they’re looking for.
In my experience, a recommended website load time is 1.5 seconds or less. If your website takes longer than this, then you’ve probably got some optimization that can be done. In fact, Google has stated that mobile page speed is a ranking factor. This means it can have an impact on your site’s SEO.
The first thing you should do right now is testing your WordPress site’s speed. This will give you a benchmark for starting out. I recommend the free Pingdom speed test tool. Due to caching and CDNs, make sure to run the test at least three times to get a proper result.
Pingdom website speed test
Speed up WordPress
In this post, I want to cover, step by step, exactly how I configure all my WordPress sites and how you can easily achieve speeds of under one second load times.
First, a little bit about me: I have spent over 11 years using WordPress. I previously worked for Kinsta; a high-performance managed WordPress hosting company. And before that, I worked for KeyCDN, a global content delivery network. So performance is in my blood.
I have spent thousands of hours optimizing WordPress sites to ensure that they are running at optimal performance. As an internet marketer, WordPress has helped me achieve amazing things, and it can also help you! Just follow the steps below to speed up WordPress instantly.
I promise you, no matter what your background or level of expertise, you will find something in my post that is useful.
- Invest in Fast WordPress Hosting
- Content Delivery Network (CDN)
- Utilize the Perfmatters Plugin
- Optimize Your WordPress Database
- Lightweight WordPress Theme
- Get Rid of Plugins
- Image Compression
- Clean Up Custom CSS
- Change Web Fonts
- Only Use the Icons You Need
- WordPress Caching
- Tweak Google Analytics
- Speed Test Results
- Get a Web Performance Audit
- Additional Optimization Tips
1. Invest in Fast WordPress Hosting
One of the easiest and most important ways to speed up WordPress is to start with a solid foundation. And that means picking a reliable and fast WordPress host. 👍 Unfortunately, this first step is where a lot of people mess up. Many underestimate just how much of an impact a hosting provider has on your performance.
If you’re on a small website, you’re most likely on a cheap shared web hosting plan. The name of the plan itself really defines what it is. The term “shared” means that your website is hosted on a server along with a lot of other people’s websites. This means they are all fighting over the same resources.
I’m sure you see guys all the time advertising BlueHost hosting. Unfortunately, a lot of those sites are run by affiliate marketers simply trying to make a quick buck. And most of the time, the affiliate marketer doesn’t actually use them, they simply refer people to them.
Picking a host like BlueHost is one of the worst decisions you could ever make when it comes to hosting your website. Did you know that BlueHost is owned by EIG? EIG is a corporation that has been buying up all the crappy hosts. Here is a full list of hosts owned by EIG. You can pretty much expect the same horrible service from all of them.
While it is true that I am an affiliate marketer, my passion for web performance has always trumped that. That is why I will only be referring you to web hosting providers that I currently use for my websites. Having a superior web hosting provider means that you don’t have to worry about downtime or speed. Below are two WordPress hosting providers that I stand behind 100%.
Option 1 – SiteGround
If you are looking for more affordable WordPress hosting, I highly recommend SiteGround. They offer shared hosting with HTTP/2, PHP 7, SSD and tons of other features starting at only $3.95 a month! This is about as good as it gets for shared hosting folks. Make sure to check out our in-depth SiteGround review.
SiteGround is great if you need a cheap host that still has some of the latest features that the bigger guys do. Once you start getting a lot of traffic though I recommend investing in a bigger host like Kinsta.
Option 2 – Kinsta
If you are looking for high performance managed WordPress hosting, I have nothing but praise for Kinsta. Kinsta’s vast feature set is really what sets them apart from the other managed WordPress hosting companies out there. Kinsta is the kind of host you want if you go on Shark Tank. Some of Kinsta’s current clients include Mint.com, Ubisoft, TripAdvisor, and Intuit! Make sure to check out our in-depth Kinsta review.
Some of Kinsta’s features include Nginx, Ubuntu, PHP 7.4, HTTP/2, CDN, Free SSL, MariaDB, free premium DNS via Amazon Route 53, uptime monitoring via New Relic, and they have some of the best support in the business! They use software containers which means no resources are shared between sites. All of my sites are hosted with Kinsta.
2. Content Delivery Network (CDN)
No matter how fast your web hosting provider is, you can never beat the latency issue. When you host your website, it is always stored on a single server somewhere in a data center. For visitors across the country, things are much slower because it has to download everything across the globe.
A CDN fixes that by storing copies of your assets, like images, CSS, and JavasScript on servers, also known as POPs, around the globe. It also caches them. This way, when a visitor from across the globe is looking up your website, the content is delivered from the cache of the local POP instead of your web server. Make sure to check out my article on a CDN for dummies if you want to learn more about how CDNs work.
I use KeyCDN, of course, for all of my websites. At $0.04/GB (lowest price globally) with more POPs than StackPath (currently 33), there really is no comparison, and it’s a no-brainer. KeyCDN also offers origin shield and secure token free of charge, which most other providers charge hundreds of dollars for.
KeyCDN also has a free Let’s Encrypt integration so you can deploy SSL for free. And they fully support HTTP/2, WebP caching, and the latest protocols so that your content is delivered as fast as possible. Make sure to also check out my full review of KeyCDN.
If you aren’t using a CDN yet, then you are hurting yourself. A blog with a decent amount of traffic usually is in the 20-25 GB bandwidth range, and to implement a CDN, it costs less than $5 per month. And suddenly, your site is supercharged from multiple POPs all over the world. I use our Perfmatters plugin to deploy the CDN.
Kinsta is actually partnered up with KeyCDN. So if you use Kinsta as a WordPress host, KeyCDN is included for free! 👏
Can’t afford KeyCDN? Then my next best recommendation would be the free version of Cloudflare.
3. Utilize the Perfmatters Plugin
Perfmatters is a lightweight WordPress performance plugin developed by myself and my brother, which basically includes all the optimizations we use on our sites to gain the extra edge over the competition. Get all the secret sauce from our sites with a few clicks.
Perfmatters web performance WordPress plugin
Some of its features include:
- Disable emojis
- Disable self-pingbacks
- Disable XML-RPC
- Hosting analytics locally
- Lazy load images
- Disable and or limit WordPress revisions
- Remove query strings from static resources
- Disable embeds
- Disable WooCommerce cart fragments (AJAX)
- Change frequency and or disable Heartbeat API
- Change autosave interval
- DNS prefetch
- CDN rewrite (one-click way to deploy a CDN like KeyCDN)
- Support straight from the developers of the plugin
With the Script Manager feature, you can disable scripts on your WordPress site on a per-page/post and even sitewide basis. This is very powerful and can drastically increase the speed on your WordPress sites (especially your homepage). A few examples of what this can be used for:
- The popular Contact Form 7 plugin loads itself on every page and post. You can easily disable it everywhere with one click and enable only on your contact page.
- Social media sharing plugins should only be loaded on your posts. You can easily disable it everywhere and load only on post types, or even custom post types.
Perfmatters Script Manager
The Script Manager even supports Regex. This allows you to disable scripts on dynamically generated archive pages, search results, etc. Basically, any script combination you can think of can be disabled or enabled.
4. Optimize Your WordPress Database
The next thing to do is to ensure that your WordPress database is optimized.
Before proceeding, it’s always good practice to take a backup of your WordPress site. If you’re using a host like Kinsta, you can take a one-click snapshot, and you’re good to go. Otherwise, you can use a free WordPress backup plugin.
WordPress backup snapshot at Kinsta
If you’ve never done any database optimization before, the first thing you will want to check is that you don’t have any mixed MyISAM and InnoDB tables. Basically, there are two different types of MySQL tables. InnoDB has proven itself to be much faster.
You can follow this tutorial here on how to convert MyISAM to InnoDB. When it comes to ways to speed up WordPress, this is often an overlooked optimization.
By default, WordPress stores revisions of posts and pages when you make changes. This is definitely handy in case you need to revert back to an older version. The bad news is that there is no limit on how many revisions are stored. Especially on large sites, this can quickly bog your database down. How many revisions do you really need?
The first you will want to do is clean up the old revisions and then put a limit in place going forward.
You can install the free WP-Optimize plugin and run an optimization. As you can see below, in my case, there were 108 revisions sitting in the database. This is not a lot, but going forward, it’s always nice to start with a fresh slate. For more in-depth steps, check out my in-depth post on how to delete old WordPress revisions from your database.
Note: I delete the plugin immediately after I am done running the cleanup.
Now that the old post revisions are cleaned up, it’s time to limit the number of revisions. This will ensure they don’t start filling up the database again down the line. There are a couple of ways you can do this. I recommend using our Perfmatters plugin. You can limit or disable them with a single click, as seen below.
Disable and or limit WordPress revisions
Or you can do it manually by adding the following code to your wp-config.php file. In this example, I am limiting them to 3.
define('AUTOSAVE_INTERVAL', 300); // seconds define('WP_POST_REVISIONS', 3);
It is important to add the code above the ‘ABSPATH,’ otherwise, it won’t work.
Limit WordPress revisions
You can also disable revisions altogether.
5. Lightweight WordPress Theme
WordPress themes can make or break your site. There are a ton of bloated themes out there that can bring your site to crawl. When you’re looking for a WordPress theme, you want to make sure you are buying from a reputable company with good developers and support.
I use GeneratePress on all of my WordPress sites; including my blogs (this one) and ecommerce sites. I couldn’t be happier.
I saw a 450ms decrease simply by changing themes, without anything else! Kudos to Tom, the developer of GeneratePress. He keeps things lightweight, and still includes loads of functionality so you can literally build whatever type of site you want.
GeneratePress WordPress theme
I also want to mention that you should be careful about buying themes and products on ThemeForest. I’m not saying that all developers at ThemeForest are bad, but unfortunately, a lot of them simply add bloat to increase their sales. Check out my in-depth GeneratePress review along with GenerateBlocks.
6. Get Rid of Plugins You Can Live Without
The next step was to get rid of all the unnecessary plugins you can technically live without. This is one reason I love using WordPress. There are so many different ways to accomplish things. If you go with another platform such as Shopify or Wix, you’re stuck doing it one way or worse; you don’t have a way to fix it at all.
Here are plugins I got rid of on my own site:
- Scroll to Top Button: Scroll to top buttons are already included in the GeneratePress theme.
- Simple Custom CSS: This is already built into the WordPress Customizer which GeneratePress uses. It’s actually gotten quite good over the years and now does basis syntax color and error correction.
- Standout Color Boxes: I simply do this with CSS and GeneratePress hook now.
- Bloom: This plugin has too many requests, so I switched back to the MTS WP Subscribe Pro plugin.
- TablePress: The block editor in WordPress now has tables, and so does GenerateBlocks.
- Hero Favicon Generator: GeneratePress allows you to upload a site icon. You can also easily load your favicon off of a CDN with a GeneratePress hook.
- TweetDis: I switched to Novashare, a social sharing plugin for WordPress, which also includes a tweet shortcode and tweet block.
- Crayon Syntax Highlighter: I switched to the native WordPress code syntax without any plugin.
- Mango Buttons: I simply switched to a CSS button I made, no need for a plugin. The GeneratePress theme also has buttons now.
- Table of Contents Plus: I’m simply hardcoding these now. The block editor now has an easy way to add anchors.
As you can see, there were a lot of plugins I didn’t need. By getting rid of all of these, I significantly reduced the requests on my site and the total page size. I advise you do a plugin inventory and assessment on your site right away!
7. Image Compression
Image compression (making image files smaller by removing data) is no longer optional. It’s one of the easiest things you can do! Uploading full-resolution images onto websites, especially those on small shared web hosting plans, can really slow down the load time on your website. You would be surprised how much some images can be compressed without any quality degradation.
I compress all my images using lossy compression with the Imagify WordPress plugin. This ensures small page weight sizes and fast loading images that still look beautiful. Every image I add to a page or post is automatically compressed behind the scenes. My recommendation is to always keep your images under at least 100 KB.
I also take advantage of the
.webp image format. This is an image format developed by Google that is much smaller than PNGs or JPGs. I use WebP images on all my sites. The Imagify plugin can also do this for you automatically.
How much smaller is the WebP file format? Well, take one of the images on this blog post, for example. The PNG image is 60.6 KB, while the WebP version of the same image is 16.3 KB. That’s a decrease in the size of 73.1%!
8. Clean up Custom CSS
If you are like me, you might have added custom code in the WordPress customizer to make your WordPress theme work the way you want. or sometimes you are in a hurry and just need a quick fix. Over time, this can add up.
I actually went through my custom CSS the other day and it had 247 lines of code in it. Yikes! After moving to the GeneratePress theme, I went through each line and was able to drop this down to 88 lines of code. 😁 And I could probably clean this up even more.
This just goes to show you how much better the GeneratePress theme is coded. It also means the theme has added more features without sacrificing performance.
9. Change Web Fonts
I have been doing a lot of research recently on web font performance. I ditched the Adobe Fonts service (previously Typekit). I saw an additional 300ms reduction by doing this. Adobe Fonts adds two external HTTP requests, and it also base64 encodes all the font formats. If you aren’t familiar with fonts, you no longer need to serve all the font formats, you only need WOFF and WOFF2 (if you are going for extra compression).
You have a couple options when it comes to better-performing fonts.
Option 1: System Font Stack (What I Do)
I’ll start with my favorite and the fastest option you have for fonts. It’s moving to what they call a system font stack.
Custom web fonts, such as Google Fonts, make up on average 3.2% of a web page’s overall weight. While this is not a lot, it still contributes to your overall load time. And it could be a lot more than that. Some websites use a lot more fonts than they actually need.
Big-name brands such as GitHub, Bootstrap, Medium, Ghost, and even your WordPress admin dashboard all use what they call a system font stack. This utilizes the fonts on your computer. A few years ago this wouldn’t have looked very good. But with today’s newer operating systems, they all have nicer looking fonts pre-installed.
By using a system font stack there is no need to load any fonts at all on the page! This is pretty huge. It can also help you get rid of any FOUT (flash of unstyled text) or FOIT (flash of invisible text) ugliness. Did you know this site uses a system font stack? You probably didn’t notice, did you? That’s right, this site doesn’t load a single font.
But you still might want to weigh the pros and cons. Do you want something that looks fancy or do you want blazing fast?
If you’re using a theme like GeneratePress, it now has a one-click option to use System Stack fonts. You can also check out my more in-depth tutorial on how to move to a system font stack.
System fonts in GeneratePress
Option 2: Use Google Fonts
Google Fonts are free, very popular, and used by millions of websites around the globe. And this actually helps their performance due to one very specific reason. They are probably already cached on the visitor’s computer. Therefore, if a person hits your site with a common Google Font, it might not have to load again.
The external call to Google is also much faster than using a third party like Typekit. When Typekit goes down, which it does once in a while, it seems like half the internet breaks.
If you’re wanting to use Google Fonts, many themes like GeneratePress already have this option available. Or you can use a WordPress plugin like Fonts Plugin.
Google Fonts in GeneratePress
Option 3: Host Google Fonts/Custom Font on Your CDN
If you really want to use Google Fonts or have a custom font you prefer, the best method of delivery is hosting them locally on your server or CDN.
The benefit of doing it this way is due to the fact that there is no DNS lookup to a third-party and you have more control over what is actually loading. Check out my tutorial on how to host a custom font on your WordPress site. Or you can use a premium WordPress plugin like Fonts Plugin.
It’s also recommended to prefetch your font files. You can do so by adding the location to your WordPress
header.php file (example below). Or if you’re using our Perfmatters plugin there is an easy option to do this in the settings.
<link rel="dns-prefetch" href="//fonts.googleapis.com/">
10. Only Use the Icons You Need
Font Awesome is great, and millions of sites use it on the web to display the icons you see on a daily basis. However, by default, it loads its entire library of icons for your site.
The best way performance-wise to approach Font Awesome is to package up only the icons you are actually using on your site. Here is a great tutorial on how to host font icons locally (only the ones you need).
Or if you are using a theme like GeneratePress with GenerateBlocks, you can actually paste in the SVG code of any icon you want. This is amazing! As it means there is no need to package up icons. You can easily add only what you need.
11. WordPress Caching
Obviously everyone knows by now the importance of caching for your WordPress site. There are free caching plugins out there such W3 Total Cache and WP Super Cache, but I have never been that impressed by them as far as speed goes. They are also a lot more complicated to set up.
I recommend going with WP Rocket (premium) or Cache Enabler (free). Or better yet, if you host your WordPress site with a host like Kinsta, caching is done at the server-level automatically for you! So no need to hassle with a caching plugin. That’s right, I don’t have any caching plugins running on this website. 😎
But if you’re using shared hosting or a VPS like Digital Ocean, you’ll need a caching plugin.
WordPress Cache Enabler
The free WordPress cache enabler plugin is created by the team over at KeyCDN, a global content delivery network that focuses on speeding up content delivery. The plugin was developed with HTTP/2 and simplicity in mind. Setting up a caching plugin shouldn’t have to be crazy complicated or involve 25+ steps.
How does it work? Basically, it creates static HTML files which are then stored on your web server’s disks. When a visitor hits your website, the static HTML file is served. Due to it being static, this can be delivered super fast! Why? Because it pretty much bypasses the plugins, database, etc.
As of writing this, the plugin currently has a rating of 4.6 out of 5 stars. People seem to love it. Here are just a few of the reviews below.
Simplicity and effectiveness. Love it! – atomiccherry
Loving this lightweight plugin! It even supports WebP! Saw a speed increase after installing! – tandkb
Nice and simple caching plugin, works great, and even supports WebP images generated by EWWW Image Optimizer. Awesome! – nosilver4u
Cache Enabler Features
The cache enabler plugin features the following:
- Caching HTML to disk
- Feature to automatically purge cache when publishing new pages/posts
- Manual purge feature
- WP CLI cache clearing
- Displays the total size of cache in your WordPress dashboard
- Supports WP multisite and custom post types
- Ability to set the expiry directive
- WebP Support (when combined with Optimus, ShortPixel, or EWWW)
- Supports responsive images via srcset since WP 4.4
- Works with Autoptimize
- HTTP/2 Focused
Example of Cache Size in Dashboard
In your WordPress dashboard, you can clearly see on the “At a Glance” widget the size that is currently in the cache.
Cache size in the dashboard
Example of Cache Size in Dashboard
You can individually purge pages/posts or clear the entire cache right from the WordPress admin bar.
Clear cache in WordPress dashboard
How to Install Cache Enabler
Follow the steps below on how to install the free WordPress Cache Enabler plugin.
In your WordPress dashboard under “Plugins” click on “Add New” and search for cache enabler. Ensure that it says By KeyCDN for the author. Click on the “Install Now” button. You can also download it directly from the WordPress repository.
Install Cache Enabler
After you activate the plugin you will want to enable a few settings. In your WordPress dashboard under “Settings” click into “Cache Enabler.” I recommend enabling the pre-compression option and also the WebP support. You can take advantage of this with the Optimus Image Optimizer plugin, ShortPixel, or EWWW.
Cache Enabler settings
Step 3 (Optional)
There is an advanced snippet of code you can use to bypass PHP in WordPress. This is an optional step, but you will see even faster speed increases! I am using this for the speed tests you see further below. Follow the tutorial here on how to enable the advanced snippet for Nginx and Apache.
Cache Enabler Speed Results
So now let’s see what the speed tests say. I am using this on a fresh install of WordPress with the twenty sixteen theme running. If you have a larger site you can expect to see even faster increases!
I first ran 5 tests via Pingdom and took an average without a caching plugin running.
WordPress speed test without caching
With Cache Enabler
I then ran another 5 tests via Pingdom and took the average with the free Cache Enabler plugin enabled.
WordPress speed test with caching
You can see that the Cache Enabler plugin decreased load times from 537 ms down to 390 ms. That is a 27.37% speed increase for only 2 minutes of setup work using a free plugin! Not too shabby.
For a free plugin, the WordPress Cache Enabler plugin can do wonders for your website or blog. It’s super simple to set up and you will see drastic speed increases.
12. Tweak Google Analytics
Having worked in the corporate agency setting in the past I have always enabled advertising features and remarketing in my Google Analytics accounts by default. However, on my blog I don’t use any of the data, so better to remove it. Why? Because if you are running these features you will actually have a 2nd HTTP request for this file:
https://stats.g.doubleclick.net/r/collect? and then your main Google Analytics script will have a 302 redirect in the response header.
Google Analytics collect?
You can fix this by turning both remarketing and advertising reporting features off in your Google Analytics account.
Google Analytics data collection
You can also disable the features by adding the following code to your Google Analytics script.
ga('set', 'displayFeaturesTask', null);
After disabling this you should no longer have that 2nd HTTP request and your main script will no longer have a 302 redirect.
Google Analytics no redirect
Hosting Google Analytics locally can also help speed up your site by reducing extra DNS lookups and resolve the “leverage browser caching” issue from their script. It also allows you to load the analytics script from your own CDN which can help you take advantage of a single HTTP/2 connection.
Note: This is not officially supported by Google, but we have been doing this for years without any issues. This can easily be done with our Perfmatters plugin (as seen below).
Enable local analytics in Perfmatters
13. Speed up WordPress Test Results
And here are my speed test results after I did everything above. The tests were run 5 times and the average taken. The final load time for woorkup is under 500 ms.
Speed test after optimizations (Source: Pingdom)
Not too shabby. I managed to reduce my HTTP requests from 90 down to 36. I decreased my page size from 939.9 KB down to 291.5 KB. And I decreased my load time from 1.52s down to 495ms! 😮
Feel free to click around this site and see how fast it loads. The proof is in the pudding.
14. Get a Web Performance Audit
Still need an extra boost? If you still aren’t satisfied with your speed, I always recommend hiring an expert and getting an audit done on your site.
One day I’ll probably offer web performance audits, but right now I simply don’t have time. For now, I highly recommend Mike Andreasen, a Codeable expert, for web performance audits and HTTPS conversions. Here is an example of a client’s site before and after Mike’s web performance optimizations.
Website performance audit from Mike
I personally chat with Mike on a regular basis. He is one of the only web performance guys out there which I agree with on just about everything when it comes to optimization, which services and tools work the best, etc. 😉 And trust me, that is rare.
He has completed over 1,300 projects for clients. I personally vouch for his work as I have the graphs, speed tests, and data from actual clients to back it up!
15. Additional Optimization Tips
Here are a few additional things I am already doing that you might want to check out.
- Loading my gravatars from my CDN.
- I use our Perfmatters plugin to fix admin-ajax.php slowness with heartbeat.
- Regardless of what speed testing tool you use, it’s important to pick one and stick with it. Even Google recommends this. Each tool measures speed in a different way and you need an accurate baseline to monitor performance improvements.
Call me crazy but I am actually still not happy with the results. I’m pretty OCD when it comes to performance so I will always be optimizing. It’s a job that never ends. Make sure to bookmark this post as I am constantly updating it. Hopefully, my experience above on how to speed up WordPress will be eye-opening for you.
I would love to hear any feedback below!
Get More Stuff Like This
Marketing, WordPress, Blogging Tips, SEO and Reviews, twice a month.
Thank you for subscribing.
Something went wrong.