Looking for awesome WordPress speed tips?
These are the same tips I use to get 100% GTmetrix scores and <2s load times on nearly every one of my posts. Even this post has a XYZ page size, 462 requests, and still loads in about <2s. You’ll learn everything from optimizing plugins, images, server response times, CDNs, and external resources like Google Fonts, Analytics, YouTube videos, and even domain prefetching.
If you have questions or need help, drop me a comment or you can also hire my WordPress speed optimizer to help you improve scores + load times with before + after GTmetrix reports.
Use GTmetrix as your tool of choice.
It gives accurate load times and has extensive recommendations like which images need to be optimized, which plugins are slowing down your WordPress site, time to first byte, CDNs, etc.
Google PageSpeed Insights is only good for measuring server response times which should be <200ms. Otherwise, it’s pretty useless and there are many articles out there explaining why.
Pingdom is the most accurate tool for measuring load times, but their recommendations aren’t as great as GTmetrix. (for example, it doesn’t say which specific images need to be optimized).
Without further ado, here are my top 15 WordPress speed optimization tips:
1. Avoid Known High CPU Plugins
“It’s not the number of plugins, it’s the quality,” said everyone
If you’re using any of these slow plugins, consider replacing them with a faster alternative.
*Most slow WordPress plugins include social sharing, statistic (analytics), sliders, portfolios, page builders, calendars, chat, contact forms, related post, sitemap, Wordfence, WPML, WooCommerce, and any plugin that runs ongoing scans or processes. These can be identified using Query Monitor or GTmetrix Waterfall.
- AddThis
- AdSense Click Fraud Monitoring
- All-In-One Event Calendar
- Backup Buddy
- Beaver Builder
- Better WordPress Google XML Sitemaps
- Broken Link checker (use Dr. Link Check)
- Constant Contact for WordPress
- Contact Form 7
- Contextual Related Posts
- Digi Auto Links
- Disqus Comment System
- Divi Builder
- Essential Grid
- Facebook Chat
- Fancy Gallery
- Fuzzy SEO Booster
- Google Analytics
- Google Language Translator
- View Full List Of 65 Slow Plugins
How To Find Your Slowest Plugins
You can either use Query Monitor, or go through your GTmetrix report to see if the same plugin is showing multiple times in your PageSpeed and YSlow tabs. Also check the Waterfall:
2. Don’t Let Plugins Run On Every Page
Asset CleanUp lets you selectively disable plugins + scripts from loading on certain content. For example, you can disable your contact form and rich snippets plugin from loading on content they don’t show on. Or disable your affiliate marketing plugin from loading on pages.
This eliminates unnecessary requests and reduces load times. Asset CleanUp is also easier to use than Plugin Organizer and other plugins with similar functionality. I highly recommend it.
3. Use A Top Rated Cache Plugin
Which cache plugin is best? Look at these Facebook polls:
WP Rocket is usually #1 because it comes with many features most cache plugins don’t (database cleanup, lazy loading images + videos, local fonts + analytics, prefetching, CDN integration) which is why it usually yields better scores + load times than other cache plugins.
That also means if you were to use most other cache plugins, you would need to install about 6 extra plugins, when WP Rocket has these all built-in. If you’re like me, you’d have just 1 plugin.
WP Rocket Features Not Included With Most Cache Plugins:
- Database Cleanup: built-in to WP Rocket, or use WP-Optimize.
- Lazy Loading: built-in to WP Rocket, or use WP YouTube Lyte.
- Heartbeat Control: built-in to WP Rocket, or use Heartbeat Control.
- Local Google Analytics: built-in to WP Rocket, or use CAOS Analytics.
- Local Google Fonts: built-in to WP Rocket, or use either OMGF or SHGF.
- Prefetch DNS Requests: built-in to WP Rocket, or use Pre* Party Resource Hints.
- Facebook Pixel Browser Caching: built-in to WP Rocket (no other plugin does this).
- CDNs: built-in to WP Rocket (both Cloudflare + multiple CDNs), or use CDN Enabler.
Swift Performance Lite is good too, but it’s more difficult to setup and you probably won’t get the same results as WP Rocket. But Swift does come with a plugin organizer which is helpful.
4. Upgrade To PHP 7.3
Upgrading to a higher PHP version is the easiest thing and can make your site 2-3x faster.
All you have to do is login to your hosting account, find the PHP version manager, and make sure you’re on the latest version (check your website after). Some hosts are quicker to release newer PHP versions than others, another reason why you should avoid GoDaddy, Bluehost, and HostGator (both were late to release PHP 7.2 and will likely be stuck there for awhile).
You can use the Display PHP Version plugin to check which PHP version you’re currently on.
5. Optimize External Scripts
External scripts can are anything on your website that create external requests from outsides websites. Embeds are very common (embedded videos, Github code, job postings, even GIFs).
Some scripts can be optimized (hosting fonts + analytics tracking code locally), lazy loading videos, or even clever ways like taking screenshots of Twitter posts instead of embedding them. You can even try caching Gravatars using a plugin or using Disqus conditional load or Permatters (created by Kinsta) to optimize WooCommerce scripts, styles, and cart fragments.
Other external scripts are nearly impossible to optimize. I have never seen a site with AdSense have a decent GTmetrix report. High CPU social sharing and commenting plugins will always slow down your site (this ties into choosing lightweight plugins). My suggestion – optimize the ones you can, try to avoid the rest, and whatever’s leftover, make sure you prefetch this list of common domains to prefetch using WP Rocket. But, avoid external scripts whenever you can.
Google Fonts
You can host fonts locally using WP Rocket, OMGF, or Self-Hosted Google Fonts. Asset Manager and Autoptimize also have options for this. But the best way to optimize fonts is to host fonts locally. Go to the Google Fonts website and download all fonts you’re using (be as minimal as you can with fonts and weights). Next, convert the fonts to web font files using Transfonter. Upload web font files to the wp-uploads folder, and add the custom font to CSS.
Google Analytics
WP Rocket, CAOS Analytics, and the Local Google Analytics for WordPress plugin will fix the “leverage browser caching” error in GTmetrix when using Google Analytics. I use WP Rocket.
Google AdSense
Loading Google AdSense asynchronously and Cloudflare Rocket Loader can help optimize Google AdSense, but this is the biggest GTmetrix killer of them all. It’s basically a trade for monetization over performance, and there is little you can do to make AdSense load faster.
Embedded YouTube Videos
If you’re using WP Rocket, they have an option to lazy load videos and replace the iframe with a preview image (making it so videos are only loaded once people click the play button). If you’re not using WP Rocket, WP YouTube Lyte is a good alternative. This can shave multiple seconds off your initial load times and is easy. Many embedded videos can take over 2 seconds.
Embedded Tweets, Facebook, And Instagram Posts
If you embed posts on your website, consider taking screenshots and replacing it with an image (see the reduce server response time section for an example). I used a 2-column layout and took screenshots of Facebook polls. Now, they don’t have to pull requests from Facebook.
Gravatars
If you have lots of comments on your blog, you probably know how much Gravatars and even some commenting plugins can slow down your site. I decided to disable Gravatars since I’m picky about my load times, but you can also try Harrys, FV, and Optimum Gravatar cache. None of those plugins worked for me though. Your other option is to break or hide comments.
Social Sharing Plugins
Social sharing buttons pull external requests from Facebook, Twitter, and other social networks. If your plugin has an option to update “like counts” you can adjust it so they’re not updated as often. Otherwise, I recommend one of these lightweight social sharing plugins:
6. Serve Scaled Images
Serving scaled images means you need to resize large images to be smaller.
GTmetrix tells you which images are too large and the correct dimensions they should be resized to. All you have to do is resize them then replace the old images with the new one.
It’s a good idea to create an image dimensions cheat sheet so you know the dimensions of all your different images. For example, your sliders might be 1024 x 400px while your widget images are 300 x 300px, or your fullwidth blog images might be 680px width (like mine). So before I create any image, I know it has to be resized to those dimensions for it to load fast.
Sample Image Dimension Cheat Sheet:
- Logo: 300 x 100px
- Sliders: 1024 x 400px
- Widgets: 300 x 300px
- Featured post images: 350 x 350px
- Fullwidth blog images: 680px (width)
If you have serve scale images errors, you will need to fix those manually without a plugin. But once you get familiar with sizing your images properly, you should never have that error again.
7. Compress Images
ShortPixel, Imagify, and Smush are 3 top plugins for this.
Install one of those plugins (I use ShortPixel), sign up with an API key, then bulk compress all images on your site. Of course, you should check your settings, test a few images, and backup your images before bulk optimizing. Even if plugins say “lossless” there is almost always a small quality drop. This is a photographer’s dilemma – if speed is more important, do it. If not, don’t!
8. Setup Cloudflare’s CDN
There’s no reason not to use Cloudflare’s free CDN.
It hosts your website on 190+ data centers, makes it more secure, and has tons of features inside their dashboard. If you haven’t setup Cloudflare and changed nameservers, I’d do that.
If you already have Cloudflare, here are a few extra speed optimizations:
- Setup Page Rules to save bandwidth and secure your wp-admin
- Configure Cloudflare’s speed settings to get the most out of their service
- Enable Hotlink Protection to prevent people from using image bandwidth
- Let your cache plugin take care of minification, then disable it in Cloudflare
9. Consider Multiple CDNs
Multiple CDNs = more data centers = faster delivery of your content.
I use both Cloudflare and StackPath. Smaller websites should be fine with just Cloudflare, but if you’re serious about speed I would consider an additional CDN. StackPath has excellent support and they will help configure the optimal settings if requested. KeyCDN is good too.
With other CDNs besides Cloudflare, they will generate a CDN URL which you will paste into your cache plugin (most cache plugins have a CDN URL field) or use the CDN Enabler plugin.
10. Make Plugins Load Faster
We all know plugins can destroy GTmetrix scores, so here are some tips for optimizing them.
- Avoid high CPU plugins: avoid this list of slow plugins. Common slow plugins include social sharing plugins, portfolios, slider, statistics, backups, and others.
- Replace high CPU plugins with faster plugins: some research will be required, but replace any of your high CPU plugins with faster, more lightweight plugins.
- Delete plugins you don’t need: can you replace plugins with code (eg. insert GA tracking code directly, use Facebook widgets instead of plugins, or create a table of contents in HTML + CSS? Any plugins you can replace with code, do it.
- Don’t use JetPack for a couple modules: first, disable all modules you’re not currently using in the debug settings. Next, do you really need JetPack if you’re only using it for a couple things? It’s infamous for slowing down sites. You’re betting off finding a non-bloated plugin that only does the same functionality.
- Find your slowest plugins: use the GTmetrix Waterfall tab or Query Monitor (the queries by components tab) to see your slowest plugins. If a plugin shows multiple times in your PageSpeed + YSlow report, that may also be an indictor.
11. Limit Post Revisions + Autosaves
By default, WordPress automatically saves each post revision, and also continuously saves drafts when editing them. Saving drafts can be a waste of server resources, and storing thousands of post revisions can bloat your database, so we’ll at least tweak these settings.
Add this to your wp-config.php:
define( 'AUTOSAVE_INTERVAL', 60*60*60*24*365 ); // Set autosave interval to 1x per year
define('WP_POST_REVISIONS', 3);
You can also disable autosaves and limit post revisions using Perfmatters or Clearfy.
12. Block Spam Bots From Hitting Your Site
Spam bots are a waste of server resources.
They hit your site repeatedly and consume server resources, without any benefit. And without checking whether they’re hitting your site (use Wordfence), you wouldn’t know they’re there.
Step 1: Find spam bots using Wordfence’s live traffic report. If you see the same bot constantly hitting your site, Google it’s hostname and see if other people have reported it as spam. Googlebot and other legitimate bots are obviously fine, but bots like amazon.aws and linode have been reported as problems. These 2 bots were hitting my own site nearly every second!
Step 2: Block spam bots using Cloudflare Firewall Rules, BBQ, Blackhole, or Wordfence. I would personally use Cloudflare’s firewall rulers if you only have a few primary spam bots to block, since Wordfence itself can cause high CPU. To review, find the spam bots in Wordfence, block the spam bots using Cloudflare, then delete Wordfence so it’s doesn’t consume CPU.
13. Reduce Server Response Times To <200ms
Your server (hosting) is the #1 factor in the WordPress optimization guide.
To check your server response time, run your site through Google PageSpeed Insights:
SiteGround (shared hosting) and Cloudways (cloud hosting) are usually the top 2 hosts according to multiple Facebook polls, many taken by the WordPress Hosting Facebook Group.
Whatever you do, avoid GoDaddy and EIG who owns 60+ different hosting companies including Bluehost, HostGator, iPage, Site5, and others. They’re infamous for slow servers.
Many people who already migrated to SiteGround, Cloudways, and Kinsta have posted screenshots of their new load times on Twitter. Some people saw an improvement of 7s.
There’s a lot of bad information out there – even hosting reviews on YouTube recommend companies like Bluehost, HostGator, or even HostPapa. This is completely ridiculous; do your research in Facebook Groups and look at what real people are saying on Facebook + Twitter.
SiteGround and Cloudways will both migrate you for free.
14. Disable WooCommerce Scripts, Styles, Cart Fragments
WooCommerce sites are infamously slow.
This is partially because WooCommerce adds scripts, styles, and cart fragments to every single page on your site (even non-eCommerce pages). Just like you shouldn’t let some plugins run on every page (tip #2), you shouldn’t let WooCommerce options run on non-eCommerce pages. You can disable all these in 1-click using the Perfmatters plugin by Kinsta (which also lets you selectively disable plugins/scripts), otherwise you can use these codes from Github.
Disable WooCommerce Scripts:
Disable WooCommerce Styles: see Woocommerce’s documentation.
Disable WooCommerce Cart Fragments:
15. Post Your GTmetrix Report In Facebook Groups
If you still need help, there are Facebook Groups where people are happy to provide feedback. Feel free to also leave me a comment, check out my full WordPress speed guide, or hire my team for WordPress speed optimization who will send you before and after GTmetrix reports.
Recommended Facebook Groups
Hope this was helpful.
Cheers,
Tom
span,.wp-review-56500.wp-review-percentage-type .review-list li>span{display:inline-block;position:absolute;z-index:1;top:32px;left:45px;color:#ededed;font-size:14px;line-height:1;text-shadow:0 1px 1px rgba(0,0,0,.3);-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.wp-review-56500.wp-review-point-type .wpr-user-features-rating .review-list li>span,.wp-review-56500.wp-review-percentage-type .wpr-user-features-rating .review-list li>span{color:inherit;text-shadow:none}.wp-review-56500.wp-review-point-type .wpr-user-features-rating .review-list li .wp-review-input-set+span,.wp-review-56500.wp-review-percentage-type .wpr-user-features-rating .review-list li .wp-review-input-set+span,.wp-review-56500.wp-review-point-type .wpr-user-features-rating .review-list li .wp-review-user-rating:hover+span,.wp-review-56500.wp-review-percentage-type .wpr-user-features-rating .review-list li .wp-review-user-rating:hover+span{color:#fff}.wp-review-56500 .review-list li:nth-child(even){background:#fff}.wp-review-56500 .review-links{padding:30px 30px 20px 30px}.wp-review-56500.review-wrapper .review-result-wrapper i{font-size:18px}#review.wp-review-56500.review-wrapper .review-pros-cons{clear:both;padding:0;border-top:1px solid #fff}#review.wp-review-56500.review-wrapper .review-pros-cons .review-pros,#review.wp-review-56500.review-wrapper .review-pros-cons .review-cons{width:100%;flex:none;padding:0}#review.wp-review-56500.review-wrapper .review-pros-cons .review-pros{background:#2c3fd3;padding:30px 30px 10px 30px;color:#fff;box-sizing:border-box}#review.wp-review-56500.review-wrapper .review-pros-cons .review-cons{background:#5e1d9a;padding:30px 30px 10px 30px;color:#fff;box-sizing:border-box}.wp-review-56500.review-wrapper .mb-5{text-transform:uppercase}.wp-review-56500.review-wrapper .mb-5+p{line-height:26px}.wp-review-56500 .user-review-area{padding:15px 30px;border-top:1px solid}.wp-review-56500 .wp-review-user-rating .review-result-wrapper .review-result{letter-spacing:-2.35px}.wp-review-56500.review-wrapper .review-title{letter-spacing:1px;font-weight:700;padding:15px 30px;background:transparent}.wp-review-56500.review-wrapper .review-total-wrapper{width:40%;margin:0;padding:35px 0;color:#fff;background:#ededed;border-left:1px solid;text-align:center;float:right;clear:none;border-top:1px solid}.wp-review-56500.review-wrapper .review-list{clear:none;width:60%;float:left;border-top:1px solid}.wp-review-56500.review-wrapper .wpr-user-features-rating,.wp-review-56500.review-wrapper .wpr-user-features-rating .review-list{width:100%;clear:both;border-top:1px solid #fff}.wp-review-56500.review-wrapper.wp-review-circle-type .review-total-wrapper{padding:20px 0}.wp-review-56500.review-wrapper.wp-review-circle-type .review-total-wrapper .review-circle.review-total{margin:auto 0;padding-top:10px;width:auto;height:100%;clear:both}.wp-review-56500.review-wrapper.wp-review-circle-type .user-review-area{padding:12px 30px}.wp-review-56500.review-wrapper.wp-review-thumbs-type .review-list{width:100%}.wp-review-56500.review-wrapper .review-result-wrapper{border-radius:25px}.wp-review-56500.review-wrapper .review-percentage .review-result-wrapper,.wp-review-56500.review-wrapper .review-percentage .review-result,.wp-review-56500.review-wrapper .review-point .review-result-wrapper,.wp-review-56500.review-wrapper .review-point .review-result{height:26px;margin-bottom:0;background:#fff;border-radius:25px}.wp-review-56500.review-wrapper li .review-point .review-result{background:#5e1d9a}.wp-review-56500.review-wrapper li:nth-of-type(2n) .review-point .review-result{background:#2c3fd3}.wp-review-56500 .review-total-wrapper .review-point.review-total,.wp-review-56500 .review-total-wrapper .review-percentage.review-total{width:70%;display:inline-block;margin:20px auto 0 auto}.wp-review-56500.review-wrapper .review-total-wrapper .review-total-box{float:left;text-align:center;padding:0;color:#424242;line-height:1.5}.wp-review-56500.review-wrapper .review-total-wrapper .review-total-box h5{margin-top:10px;color:inherit}.wp-review-56500.review-wrapper.wp-review-point-type .review-total-wrapper .review-total-box,.wp-review-56500.review-wrapper.wp-review-percentage-type .review-total-wrapper .review-total-box{width:100%}.wp-review-56500.review-wrapper .review-star.review-total{color:#fff;margin-top:10px}.wp-review-56500.review-wrapper .user-review-title{padding:15px 30px 10px;margin:0;color:inherit;background:#fff;border-top:1px solid;border-bottom:1px solid}.wp-review-56500.review-wrapper .user-total-wrapper .user-review-title{display:inline-block;color:#424242;text-transform:uppercase;letter-spacing:1px;padding:0;border:0;background:transparent;margin-top:3px}#review.wp-review-56500.review-wrapper.wp-review-circle-type .user-total-wrapper h5.user-review-title{margin-top:12px}#review.wp-review-56500.review-wrapper.wp-review-circle-type .user-total-wrapper span.user-review-title{margin-top:8px}.wp-review-56500.review-wrapper .reviewed-item{padding:30px}.wp-review-56500.review-wrapper.wp-review-circle-type .review-total-wrapper>.review-total-box{display:block}.wp-review-56500.review-wrapper.wp-review-circle-type .review-total-wrapper>.review-total-box>div{display:none}#review.wp-review-56500.review-wrapper .user-review-area .review-percentage,#review.wp-review-56500.review-wrapper .user-review-area .review-point{width:20%;float:right;margin-bottom:5px}.wp-review-56500 .review-embed-code{padding:10px 30px}.wp-review-56500.review-wrapper,.wp-review-56500 .review-title,.wp-review-56500 .review-list li,.wp-review-56500 .review-list li:last-child,.wp-review-56500.review-wrapper .review-list,.wp-review-56500 .user-review-area,.wp-review-56500.review-wrapper .review-total-wrapper,.wp-review-56500 .reviewed-item,.wp-review-56500 .review-links,.wp-review-56500 .wpr-user-features-rating,.wp-review-56500.review-wrapper .user-review-title{border-color:#fff}.wp-review-56500 .wpr-rating-accept-btn{background:#5e1d9a;margin:10px 30px;width:-moz-calc(100% – 60px);width:-webkit-calc(100% – 60px);width:-o-calc(100% – 60px);width:calc(100% – 60px);border-radius:50px}@media screen and (max-width:480px){.wp-review-56500.review-wrapper .review-title,.wp-review-56500.review-wrapper .reviewed-item,.wp-review-56500.review-wrapper .review-list li,.wp-review-56500.review-wrapper .review-desc,.wp-review-56500.review-wrapper .user-review-area,.wp-review-56500.review-wrapper .review-embed-code{padding:15px}.wp-review-56500.wp-review-circle-type .review-list li{padding:15px 15px 0 15px}.wp-review-56500.review-wrapper .review-pros-cons>div>div{padding:15px;padding-top:0}.wp-review-56500.review-wrapper .ui-tabs-nav{padding:0 15px}.wp-review-56500.review-wrapper .review-links{padding:15px 15px 5px}.wp-review-56500.review-wrapper .review-list,.wp-review-56500.review-wrapper .review-total-wrapper{width:100%}.wp-review-56500.review-wrapper .review-total-wrapper{padding:10px 0}.wp-review-56500.review-wrapper .review-total-wrapper .review-total-box h5{margin-top:0}.wp-review-56500.review-wrapper .review-total-wrapper .review-total-box div{line-height:1}}]]>
Keep reading the article at Tom Dupuis. The article was originally written by Tom Dupuis on 2019-12-30 15:44:54.
The article was hand-picked and curated for you by the Editorial Team of WP Archives.