How I Optimized My Slow WordPress Site For 100% GTmetrix Scores — 28 Tips For Speeding Up WordPress Sites (2020 Guide)

Home » WordPress Speed Tips & Tricks » How I Optimized My Slow WordPress Site For 100% GTmetrix Scores — 28 Tips For Speeding Up WordPress Sites (2020 Guide)

Have a slow WordPress site?

This post you’re reading has over 70 images, 470 comments (while showing Gravatars), uses external fonts, Google Analytics, social sharing buttons, and an embedded YouTube video. Yet, it can load in under 2s with a 2.56MB page size, 89 requests, and 100%/97% GTmetrix scores.

Everyone ranking for “slow WordPress” in Google has a bad GTmetrix report: WP Buffs, Themeisle, Torque Mag, and Search Engine Shop who uses 0 images and copies my keywords.

So thanks for choosing mine!

I’ll show you how to take your GTmetrix + PageSpeed Insights report and make WordPress-specific optimizations that improve grades/load times. I’ve already written popular guides on WP Rocket, slow plugins to avoid, and a list of 24+ speed plugins. This combines everything.

When in doubt, look at the WordPress optimization guide to see the most important factors. The most common fixes for a slow WordPress site are usually related to your infrastructure (theme, hosting, page builder, cache plugin, CDN, and plugins you’re using). While optimizing images and third party scripts can definitely speed up WordPress, most factors are site-wide.

For this, I recommend Cloudways or Kinsta (hosting), Astra or Oxygen Builder (theme + page builder), and WP Rocket (main optimization plugin). You will avoid 90% of speed issues and they’re all rated highly in Facebook polls. Comment with your GTmetrix report if you need help.

GTmetrix (load times) should be your primary metric while PageSpeed Insights doesn’t even measure load times. Getting 100% in every single tool is not realistic unless you have a bare bones, static HTML site. Don’t obsess over scores – obsess over your actual load times instead.

2020-GTmetrix-Report

Watch My Video – it’s a 42 minute video, but I cover pretty much everything (timestamps are found in video description). You will learn a ton of good stuff on WordPress speed optimization.

 

1. Use Faster WordPress Hosting

Hosting is the #1 factor in the WordPress optimization guide.

Run your website through Google PageSpeed Insights and check if reduce server response times is in your report. Google recommends a response time of <200ms. You can also check your TTFB (time to first byte) in the GTmetrix Timings tab. If these are slow, so is your hosting.

Reduce Server Response Time

I would personally skip the shared crap and go with Cloudways.

They’re who most people recommend in the WordPress Hosting Facebook Group and #1 in most recent Facebook polls, especially since SiteGround increased prices and went downhill. I migrated from SiteGround to DigitalOcean on Cloudways and you can view the results below.

SiteGround-vs-Cloudways

I use them and you can check my GTmetrix report, or visit cwdoserver.com to see the speed of a $10/month Cloudways DigitalOcean test server I set up with an Astra Site. It loads instantly (for reference, stgrndserver.com is the identical Astra Site only on SiteGround’s GrowBig plan).

Do your research on EIG, SiteGround’s CPU limits, and look at Facebook polls, conversations, and migration results. Check your server response time in PageSpeed Insights and your TTFB.

2020-Hosting-Poll

Cloudways Response Times

Godaddy-to-DigitalOcean-Migration

VPS Cloud Hosting WooCommerce Poll

SiteGround-Alternative

Hosting Recommendations Facebook

2017-WordPress-Hosting-FB-Poll

Favorite Hosting For Elementor

Elementor-Hosting-Poll

Untitled

Vultr-Migration

WordPress Hosting Suggestions

SiteGround-Alternative-For-Beginners

VPS Cloud Hosting Poll

2016-WordPress-Hosting-FB-Poll

Elementor Hosting Recommendations

Cloudways-Facebook-Review

I signed up for 15+ hosting accounts to test their speed. All domains in this video are live, which means you can visit them in real-time and click through their pages, use GTmetrix, etc.

Each website is identical except for it’s hosting (same Astra Starter Site, SSL, no caching, no CDN, and the same 6 plugins). I also used WP Hosting Performance Check and KeyCDN to measure the most popular options. The results align with what most people are saying in the WordPress Hosting Facebook Group which I recommend joining to get real, unbiased opinions.

#1. DigitalOcean On Cloudwayscwdoserver.com was the fastest, is who I use, and are very popular in Facebook Groups (especially as an alternative to SiteGround). DigitalOcean is also the only host mentioned in the WordPress Optimization Guide. Cloudways was #1 in most recent Facebook polls and people who migrate usually see significant load time improvements. They use PHP 7.4, Maria DB 10.3, Memcached, Varnish, Nginx, and Redis. Pricing starts at $10/month with no strict CPU limits or renewal prices like on other hosts. The community manager is very helpful and they do free migrations. You can get 25% off your first 2 months with the promo code OMM25.

#2. Kinstaknstaserver.com had similar speeds as DigitalOcean on Cloudways only they are more expensive starting at $30/month. Known for being capable of handling many concurrent visitors. People consistently recommend Kinsta in Facebook Groups, Twitter, and in migration results. Even though they’re not always #1 in Facebook polls (likely because not everyone can pay $30+/month), they are great for high traffic sites.

#3. WPX Hostingwpxserver.com is also very quick, but Cloudways and Kinsta are slightly faster. Starts at $20-$25/month and is who Matthew Woodward recommends.

#4. A2 Hostingatwoserver.com usually outperformed other shared hosting but is not nearly as fast as cloud hosting (just cheaper). I use A2 for my girlfriend’s restaurant website and it’s decently fast with good uptimes. A2 (and all shared hosting) is only sufficient for smaller websites with low traffic/plugins. Otherwise, use cloud hosting.

#5. SiteGround – has gone downhill with many complaints about their renewal prices, price hikes, CPU limits, and support isn’t as good as it used to be. SiteGround shifted to Google Cloud hosting (instead of shared) which is supposed to be faster, but load times and TTFB on stgrndserver.com were usually above 1s. Their SG Optimizer plugin should help, but I still wouldn’t use them. You’re better off on Cloudways DigitalOcean.

Affiliate Disclaimer – I would seriously appreciate you using my affiliate links which means I earn a commission at no expense to you. This would help me make GoFundMe donations ($6,000 so far)! I try to base my recommendations on tests, Facebook polls, and conversations I see on a daily basis in the 30+ WP Facebook Groups I’m active on.

 

2. Rethink Your Theme + Page Builder

Most people are using Astra Themes.

The only problem with Astra is that most of their themes use page builders. Even Elementor adds a lot of scripts that can mildly slow down your WordPress site (you can check these in Asset CleanUp or Perfmatters). That was my biggest complaint when I had my site redesigned in Astra (I even went themeless). My StudioPress theme was slightly faster with 0 extra scripts.

It really depends on what you want; if you like Astra + Elementor for designing your site and don’t mind a slight decrease in speed, that’s what I would recommend. If you’re a speed freak like me and only want the fastest stuff, I wish I would have stuck with StudioPress and Genesis.

studiopress-themes

Here were my extra CSS and JavaScript files added by Elementor:

Elementor-Scripts

I recommend either Astra or Oxygen Builder.

Astra-Themes-Facebook-Poll

 

3. Configure A Solid Cache Plugin

As far as GTmetrix scores go, your cache plugin has the biggest impact.

WP Rocket is the most popular cache plugin (it’s also what I use) mainly because it comes with more speed optimization features than any other cache plugin. This not only results in better GTmetrix scores, but also means you don’t have to install a bunch of extra plugins on your site.

Get 10% off WP Rocket by signing up for their email list on their coupons page. Then check my recommended WP Rocket settings for optimal GTmetrix scores/load times.

With most other cache plugins, you would need to install about 7 extra plugins to get these features when WP Rocket has them all built-in. Otherwise you will need to research which features your cache plugin comes with, then install these plugins if it doesn’t support them.

2016 best cache plugin poll

2019 cache plugin poll

Swift vs WP Rocket

2016 cache plugin poll

Best cache plugins 2018 poll

wp rocket vs w3 totla cache

What About SG Optimizer? If you’re on SiteGround, use their SG Optimizer plugin (instead of WP Rocket) with these SG Optimizer settings. It’s free and comparable to WP Rocket (you will still need heartbeat control and database cleanup). This plugin is only for SiteGround’s hosting.

WP Engine + GoDaddy – these hosts have their own built-in caching system and blacklist you from using cache plugins. In this case, use Autoptimize to optimize HTML, CSS, and JavaScript.

I also have configuration tutorials for WP Fastest Cache, W3 Total Cache, WP Super Cache, and Swift Performance, but I definitely recommend WP Rocket as your one and only caching plugin.

 

4. Upgrade To PHP 7.4

Login to your hosting account (or use the Display PHP Version plugin) to see which PHP version you’re currently running. WordPress stats show most users are running outdated PHP versions when PHP 7.4 is available on many hosting accounts. Upgrading is as simple as finding the PHP Version Manager (or similar) in your hosting account, then upgrading the latest version of PHP.

PHP-7.4

WordPress PHP Benchmarks

Some hosts are quick to release new versions (SiteGround, Cloudways, Kinsta), while others don’t make an effort to stay current in technology. Another reason to avoid EIG and GoDaddy.

*Check your website for visible errors since non-maintained plugins may not be compatible. If you do see errors, you can always revert back to an earlier PHP version.

 

5. Enable Varnish + Memcached

Many cloud hosting providers support Varnish + Memcached. Login to your hosting account and activate them. If you’re using Varnish, be sure to enable the Varnish addon in WP Rocket.

Hosting-Application-Services

 

6. Use A CDN

Most people use Cloudflare or RocketCDN (from WP Rocket).

RocketCDN uses StackPath’s data centers and offers it at a lower price than if you buy directly from StackPath. Both are great CDNs, but there are a few major differences between the two.

Cloudflare vs. RocketCDN

  • Cloudflare is free, RocketCDN is $6.99/month
  • Cloudflare cannot serve images from their CDN, StackPath can
  • Cloudflare has 200+ data centers, StackPath has 45 data centers
  • Cloudlare’s data centers are likely not as high-performance as StackPath
  • Cloudflare has a dashboard you can login to and tweak, RocketCDN does not
  • Cloudflare’s dashboard has extra features like page rules, Rocket Loader, Railgun
  • Cloudflare requires changing nameservers (some hosts also have an option to activate Cloudflare directly from your account), StackPath’s set up is automatic with WP Rocket

Cloudflare-Bandwidth-Savings

Ensure Cloudflare Compatibility With WP Rocket – WP Rocket and most other cache plugins ask for your Cloudflare Zone ID, Global API Key, and your Cloudflare account email. Add them.

WP-Rocket-Cloudflare-Add-On

Configuring The Cloudflare Dashboard – if you’re using Cloudflare, login to your dashboard. There are a few things in here that aren’t available if you set up Cloudflare through your host.

Page Rule 1: Cache Everything And Force HTTPS – cache your website aggressively.

http://*yourwebsite.com/*

Always-Use-HTTPS-Page-Rule

Page Rule 2: Secure The WordPress Admin And Bypass Cache – sets security level of the admin to high and bypasses Cloudflare’s cache in the admin, since you don’t want CDNs (or apps + performance features like Rocket Loader) running inside the admin.

yourwebsite.com/wp-admin*

WordPress-Admin-Page-Rule

Page Rule 3: Decrease Bandwidth Of WP Uploads – since the content in your WP Uploads folder does not change frequently, increasing Edge Cache TTL to a month can save on bandwidth, since the WP Uploads folder cache won’t be refreshed as often.

yourwebsite.com/wp-content/uploads*

WP-Uploads-Page-Rule

Setting Up RocketCDN Or StackPath – the easiest way to set up RocketCDN is with WP Rocket. If not using WP Rocket, you will need to sign up for a StackPath account through their website then follow instructions for creating a CDN site. They will assign you a CDN URL which most cache plugins (including Autoptimize) have a field for. Or use the CDN Enabler plugin.

Make Sure Your CDN Is Working – every CDN should show 100% in GTmetrix YSlow except Cloudflare’s CDN. To make GTmetrix detects Cloudflare, you’ll need to sign up for a GTmetrix account → User settings → “add your hostname to YSlow CDN Hostnames.” You can also use Cloudflare’s Claire Chrome Extension to see if it’s working. GTmetrix always detects StackPath.

CDN GTmetrix YSlow

 

7. Avoid 65+ Slow Plugins

You can find your slowest plugins in the GTmetrix Waterfall tab or Query Monitor.

Slow WordPress Plugin

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.

  1. AddThis
  2. AdSense Click Fraud Monitoring
  3. All-In-One Event Calendar
  4. Backup Buddy
  5. Beaver Builder
  6. Better WordPress Google XML Sitemaps
  7. Broken Link checker (use Dr. Link Check)
  8. Constant Contact for WordPress
  9. Contact Form 7
  10. Contextual Related Posts
  11. Digi Auto Links
  12. Disqus Comment System
  13. Divi Builder
  14. Essential Grid
  15. View Full List Of 65 Slow Plugins

Lightweight Plugin Alternatives

 

8. Optimize Third Party Scripts

Third party scripts are anything that create requests from external websites.

These include Google Fonts, Analytics, Maps, AdSense, Tag Manager, embedded videos, social media widgets, Facebook Pixel, Gravatars, or even like buttons from your social sharing plugin. Some can be optimized to have no impact on GTmetrix while AdSense/Tag Manager are harder.

The next sections (7-16) show you how to optimize specific third party scripts that may be giving you errors in your GTmetrix and Google PageSpeed Insights reports.

Step 1: Learn Which Third Party Scripts Are Slowing Down Your Site
Look at reduce DNS lookups in GTmetrix YSlow or third party usage in PageSpeed Insights.

External-Scripts

Common third party domains taken from Github:


//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//use.fontawesome.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//www.googletagmanager.com
//www.googletagservices.com
//googleads.g.doubleclick.net
//adservice.google.com
//pagead2.googlesyndication.com
//tpc.googlesyndication.com
//youtube.com
//i.ytimg.com
//player.vimeo.com
//api.pinterest.com
//assets.pinterest.com
//connect.facebook.net
//platform.twitter.com
//syndication.twitter.com
//platform.instagram.com
//referrer.disqus.com
//c.disquscdn.com
//cdnjs.cloudflare.com
//cdn.ampproject.org
//pixel.wp.com
//disqus.com
//s.gravatar.com
//0.gravatar.com
//2.gravatar.com
//1.gravatar.com
//sitename.disqus.com
//s7.addthis.com
//platform.linkedin.com
//w.sharethis.com
//s0.wp.com
//s1.wp.com
//s2.wp.com
//stats.wp.com
//ajax.microsoft.com
//ajax.aspnetcdn.com
//s3.amazonaws.com
//code.jquery.com
//stackpath.bootstrapcdn.com
//github.githubassets.com
//ad.doubleclick.net
//stats.g.doubleclick.net
//cm.g.doubleclick.net
//stats.buysellads.com
//s3.buysellads.com

Step 2: Add Domains To Prefetching
Take the external scripts from your GTmetrix report and add them to WP Rocket (Preload → Prefetch DNS Requests). Prefetching and other browser resource hints makes them load faster. If you don’t have WP Rocket, you can do this with Perfmatters or Pre* Party Resources Hints.

Prefetch-DNS-Requests

Step 3: Use Flying Scripts To Delay Loading Them
The Flying Scripts plugin delays loading JavaScript until the timeout period you set in the plugin. It’s the only plugin that let me show Gravatars without them impacting my GTmetrix report, but this can also be done with other third party scripts. Just enter the keyword of the script into the plugin (eg. discuz) and set a timeout period. I also recommend checking out Gijo’s speed plugins.

Flying-Scripts

Don’t forget to see the next few sections which will help you better optimize external scripts.

 

9. Google Fonts

Here are 4 steps for optimizing Google Fonts and Font Awesome.

Optimize Fonts With WP Rocket Or SG Optimizer – both WP Rocket and SG Optimizer have an option to optimize Google Fonts. This combines your fonts to create fewer HTTP requests.

Optimize-Google-Fonts

Host Google Fonts Locally – use the OMGF plugin to host fonts locally. The plugin will automatically download your fonts, create a stylesheet for them, then include it in the header.

Preload Fonts – grab the URLs of your font files in the GTmetrix Waterfall report and add them to WP Rocket’s “preload fonts” option, or in OMGF. This helps browsers download fonts faster.

Preload-Fonts

Be Minimal With Fonts + Weights – be minimal with the number of fonts and weights.

 

10. Google Analytics

Hosting Google Analytics locally will fix the leverage browser caching issue for Google Analytics in GTmetrix. For this, I use the Flying Analytics plugin since WP Rocket’s Google Tracking add-on still showed errors. Insert your Google Analytics Tracking ID (the UA code) into the plugin, then use the “Minimal Analytics Inlined” method which only adds a measly 1.4KB.

Flying-Analytics

Plugins to host Analytics locally: WP Rocket, Perfmatters, Flying Analytics, CAOS.

 

11. Google AdSense

Google Adsense is one of the most difficult scripts to optimize and you shouldn’t expect a good GTmetrix report with it. You can try enabling Cloudflare’s Rocket Loader which defers loading of JavaScript until after rendering, but affiliate links are way faster and usually more profitable.

 

12. Google Tag Manager

GTM should usually only be used for large, unoptimized sites.

If you absolutely need it, use a good Google Tag Manager plugin and be minimal with tags, but that’s about all you can do. I don’t use GTM on my website (my load times are more important).

Google Tag Manager Speed

 

13. Comments + Gravatars

I use 3 plugins for comments which you’ll see zero errors for in GTmetrix.

  • wpDiscuz: commenting plugin.
  • Flying Scripts: delays loading of Gravatars.
  • WP User Avatar: use a custom, optimized photo as the default avatar.

Step 1: Configure wpDiscuz to load faster.

Comment thread displaying → initiate AJAX loading after page and lazy load comment.

Disqus-Comment-Thread-Displaying

General → disable “use WordPress native AJAX functions” and enable combine/minify JS/CSS.

Disqus-General-Settings

Styles and colors → disable “load font awesome CSS lib.”

Disqus-Load-Font-Awesome-CSS-Lib

Step 2: Delay Gravatar loading with the Flying Scripts plugin.

Speed-Up-Comments

Step 3: Upload a custom, optimized photo using WP User Avatar.

WP-User-Avatar

Retest your GTmetrix report and your comments should load much faster with no errors.

 

14. Facebook Pixel

Use the Pixel Caffeine plugin and host Facebook Pixel locally in WP Rocket.

Facebook-Pixel-Browser-Caching

 

15. Use A Fast Social Sharing Plugin

WP Rocket did a test on the fastest social sharing plugins.

The Grow by Mediavine plugin (Social Pug) was rated the #1 fastest social sharing plugin. It’s also what I use and saw no difference in my GTmetrix report. You can see a preview near my comments section; the buttons look nice, can be loaded before and after the content, and has options for Facebook, Twitter, Pinterest, LinkedIn, email, print. You can also do a floating bar.

 

16. Optimize Images + Videos

There are several ways to optimize images. The first 3 items are in GTmetrix, the last 2 are from PageSpeed Insights. Speed testing tools only show you unoptimized images for the single page you test (keep that in mind when fixing serve scaled image or specify image dimension errors).

  • Serve scaled images – resize large images to be smaller.
  • Specify image dimensions – add a width/height to the image’s HTML.
  • Lossless compress – use an image optimization plugin to compress images.
  • Lazy load images + videos – delays load of images/videos until they’re visibly seen.
  • Serve images using next-gen formats – use WebP/SVG format instead of JPEG/PNG.

image-optimization

Serve Scaled Images – resize large images to be smaller. GTmetrix tells you the correct dimensions. Just click the image in GTmetrix, resize it to the new dimensions, and replace it. Never use the ‘drag to resize’ feature in the visual editor since this only resizes the displayed image (not the actual image). It’s best to resize to the correct dimensions before uploading it.

Serve-Scaled-Images-GTmetrix

Create a cheat sheet so you can use the correct dimensions before uploading images:

  • Slider images: 1903(w) x 400(h)
  • Carousel images: 115(h)
  • Widget images: 414(w)
  • Full width blog post images: 680(w)
  • Featured images: 250(w) x 250(h)

Specify Image Dimensions – means you need to add a width + height in the image’s HTML or CSS. This usually only happens for hand-coded HTML and plugins that don’t take care of this for you. Get the image dimensions from GTmetrix, locate the image, then add the width and height.

Specify-Image-Dimensions-WordPress

Optimize Images – losslessly compress images (also known as “optimize images” in GTmetrix). The best way to compress images is when you’re editing them (eg. in Photoshop or GIMP) since you will likely see a loss in quality with image optimization plugins, even if you select “lossless compression” in the settings. Otherwise, ShortPixel or Imagify are decent options. These plugins can also be resource-intensive and slow down your WordPress website temporarily.

Lazy Load Images + Videos – in your WP Rocket Media settings, enable lazy loading of images, videos, and replace the YouTube iframe with a preview image. These will make images and embedded videos load significantly faster, as they’re often the heaviest element on a page. If you’re not using WP Rocket, try A3 Lazy Load (for images) and WP YouTube Lyte (for videos).

WP-Rocket-Lazy-Load

Serve Images In Next-Gen Formats – most image optimization plugins have an option to convert images to WebP format, or the WebP Converter For Media plugin has great ratings.

Serve-Images-In-Next-Gen-Formats

 

17. Reduce Server Response Times

I want to clarify a few things about server response times.

Most hosting providers let you monitor CPU and RAM (memory usage). If you notice these are very close to exceeding your limits, this will put stress on your server. The whole goal is to make your server “relaxed” by giving it enough server resources to accommodate your site’s resource consumption (from high CPU plugins, traffic, WooCommerce, etc). If you notice you’re almost hitting your limits or exceeding them and getting 503 errors, it means your server is stressed.

Cloud-Memory-Increase

That’s why it’s so important to look at how many server resources come with your hosting plan. Any host that says “unlimited bandwidth” is lying (just check their terms and conditions page and they will mention their CPU limits). Especially if you anticipate high resource consumption, make sure your hosting plan includes enough resources to properly accommodate your site.

SiteGround-Server-Resources-Comparison

 

18. Clean Your Database

Use WP Rocket or WP Optimize to clean your database.

Ongoing cleanups keep your database optimized and removes transients, spam + trash comments, and potentially hundreds of post revisions which WordPress stores automatically every time you update content. Unless you need post revisions to restore backups of old content, you should be able to delete everything. I recommend scheduling weekly cleanups.

WP-Rocket-Database-Settings

Delete Old Plugin Tables – one thing I like about WP-Optimize is the option to delete database tables left behind by old plugins that aren’t installed anymore (these are often pre-configured settings). If you don’t plan on using these plugins again, delete the tables that say “not installed.”

WP-Optimize-Tables

 

19. Remove Bloat

Perfmatters (by Kinsta) is the ultimate bloat removal plugin.

The features page includes descriptions of what each item does, but it removes unnecessary WordPress features which you probably don’t need. It even has options for optimizing your Google Analytics tracking code, WooCommerce, prefetch + preconnect, and heartbeat control. Remember to selectively disable plugins in the Perfmatters script manager or Asset CleanUp!

perfmatters-features

Limit Post Revisions – use Perfmatters or add the code to your wp-config file.

define('WP_POST_REVISIONS', 5);

Increase Autosave Interval – use Perfmatters or add the code to your wp-config.php file.

define('AUTOSAVE INTERVAL', 5);

Disable Trackbacks + Pingbacks – use Perfmatters or disable in Settings → Discussion.

Disable-Trackbacks-Pingbacks

Disable Unused Addons + Modules – if you’re using a plugin containing a bunch of addons or modules (Elementor, Ultimate/Premium Addons, JetPack), delete the ones you’re not using.

Disable-Addons

Delete Unused Plugins + Themes – any plugins/themes you’re not using should be deleted.

Delete Unused WordPress Themes

 

20. Disable Plugin Usage Tracking

Any time you have an option to disable usage tracking, do it. Sorry plugin developers.

I also don’t recommend Yoast’s speed indexing (the comments have horrible reviews).

Yoast-Speed-Indexing

 

21. Disable Plugins On Specific Pages + Posts

The Perfmatters script manager (premium) and Asset CleanUp (free) both let you disable plugins/scripts from running on specific pages/posts. Some plugins load across your entire site (even on content they’re not being used on), so it’s best to disable them when that’s the case.

Examples:

  • Disable slider plugin on pages that don’t use sliders
  • Disable rich snippets plugin on pages that don’t use rich snippets
  • Disable contact form plugin on pages that don’t have a contact form
  • Disable affiliate link management plugin on pages that don’t use aff links
  • Disable social sharing plugin on all pages (since it’s usually for blog posts)

perfmatters-script-manager

Perfmatters and Asset CleanUp (the premium version) have a Regex option that allows you disable plugins/scripts based on specific URL patterns and categories. For example, you may want to only enable your schema plugin on posts containing the word “review” in the URL.

 

22. Minimize Redirects

If you have URL redirect errors in GTmetrix, it usually means you changed the WWW or HTTP(S) version of your website but didn’t change all your links and images to reflect the new version. In this case, try using the Better Search & Replace plugin to fix these errors in bulk.

minimize redirects

Third party scripts and poorly coded plugins can also cause redirect errors in GTmetrix. The solution completely depends on which plugins and third party scripts you’re using on the site.

 

23. Don’t Enable Yoast Indexables

Yoast 14.0 came out with indexables which they claim “can provide a speed boost of 5-10%.”

However, if you look at the comments, it’s clear they have not thoroughly tested this (many complaints about CPU spikes, crashed websites, errors, etc). None of the feedback looks positive, so I would at least hold off of clicking that button until they do more thorough testing.

Yoast-Speed-Indexing

 

24. Utilize Plugins By Gijo Varghese

Gijo Varghese has create quite a few plugins for speeding up WordPress.

These plugins help you host Google Analytics locally, optimize images and serve them from a CDN, preload pages, delay loading scripts by creating a timeout, and ensure text remains visible while loading fonts. All have great ratings. Check out his WP Speed Matters Facebook Group.

Gijo-Varghese-plugins

 

25. Increase Memory Limit To 256MB

WooCommerce and WPML require a 256MB memory limit, but you should really be using 256MB no matter which type of WordPress site you’re running. Some hosts have an option to increase it in their dashboard, otherwise edit your wp-config.php file and add the code below.

Cloudways-Memory-Limit

define('WP_MEMORY_LIMIT', '256M');

 

26. Make WooCommerce Load Faster

WooCommerce sites run extra scripts, styles, cart fragments, and they usually require more plugins. That’s why when choosing a hosting plan, you should usually buy one tier up of what you actually need to accomodate for the extra resources often required for WooCommerce.

WooCommerce Cart Fragments

Optimize WooCommerce Scripts, Styles, Cart Fragments
To optimize these, use Perfmatters or there are quite a few solutions on Github and WooCommerce. Disabling scripts will disable WooCommerce scripts and styles everywhere except on product, cart, and checkout pages. There’s also an option to disable cart fragments.

perfmatters woocommerce optimization

Clear WooCommerce Transients
If you feel like your WooCommerce website is getting sluggish, go to WooCommerce Status settings → delete all transients. Transients temporarily store cached data in your database.

Delete WooCommerce Transients

 

27. Block Bad Bots From Using Resources

You would never know if spam bots are hitting your site unless you checked your Wordfence live traffic report. By blocking them, you will save resources and put less stress on your server.

Step 1: Install Wordfence (you’ll want to uninstall it when you’re done).

Step 2: View your live traffic report (under Wordfence’s Tools settings) which shows you all bots hitting your website in real-time. Googlebot is obviously OK, but when I did this, I saw compute.amazonaws.com making a ridiculous amount of requests every couple seconds. I Googled it and sure enough, this was a bot known for sucking up bandwidth. View your report for a minute or two and see if bots with sketchy names are constantly hitting your site. If you have doubts, Google their hostnames and see if other people are having issues with that bot.

Live-Traffic-Report-Wordfence

Step 3: Block the bots. You have a few options: Wordfence blocking (however the plugin itself consumes resources), Cloudflare firewall rules (comes with 5 free rules which means you can block 5 bots), or the Blackhole For Bad Bots. I have a tutorial for blocking bad bots using all 3 methods. It depends on how many you want to block; if it’s only a few, I’d use Firewall Rules.

Login to your Cloudflare Dashboard and go to Firewall → Firewall Rules → Create A Firewall Rule. Copy the bad bot’s hostnames (from Wordfence) and add it here in the “Value” field. Since you can create 5 rules, you would repeat this step for your 5 worst bad bots from Wordfence.

  • Field = Hostname
  • Operator = Contains
  • Value = hostname of the bad bot you found in Wordfence

Cloudflare Firewall Rule To Block Bad Bots

Step 4: Go to your Blocking log in Cloudflare and watch your spam bots get blocked.

Cloudflare-Firewall-Events

 

28. Identify Bottlenecks In Speed Testing Tools

GTmetrix – my tool of choice since you can find exactly which images, plugins, fonts, and external scripts take longest to load (plus it shows your time to first byte and redirect errors).

2020-GTmetrix-Report

Pingdom – the most accurate tool for measuring your load times according to WP Rocket which is the primary metric you should be measuring (not grades), but there is a correlation.

Google PageSpeed Insights – good for measuring server response times but also has other recommendations like using next-gen format for images (eg. WebP), lazy loading, avoid third party scripts, preconnect, minification, caching recommendations, and serving scaled images.

Query Monitor – great for finding slow plugins, scripts, styles, and other elements slowing down your site. Make sure to delete it when you’re done since the plugin itself can be slow.

Get Help Fixing Your GTmetrix Report

 

Frequently Asked Questions

🚀 What are the most important speed factors?

Your infrastructure (hosting, theme, plugins, page builder, CDNs) have the biggest impact on load times.

🚀 Which cache plugin should you use?

WP Rocket is usually rated the top cache plugin in Facebook polls since it has built-in features most cache plugins don't. These extra optimizations should yield better scores and load times in GTmetrix. The top free cache plugins are usually WP Fastest Cache, W3 Total Cache, and Swift Performance.

🚀 Which WordPress hosting should you use?

The best hosting is highly debatable, but Cloudways, SiteGround, and Kinsta generally the top 3 hosts based on 30+ Facebook polls.

🚀 Which speed testing tool should you use?

GTmetrix has the most robust recommendations especially for finding slow plugins, images, external scripts, and measuring TFFB. Pingdom doesn't have as many recommendations, and Google PageSpeed Insights doesn't measure load times.

🚀 How do you optimize images?

You can optimize images using a plugin like ShortPixel or Smush to compress images and strip EXIF data. Make sure you're resizing images to the correct dimensions, and ideally serve them from a CDN. Lazy loading images and videos will also make the page faster.

🚀 Should you use AMP?

Generally, you should avoid AMP (accelerated mobile pages) since the design changes can lower conversions. Kinsta's conversions dropped 59% after adding AMP and they decided to remove them.

🚀 How do you optimize plugins?

Find high CPU plugins using Query Monitor which usually include portfolios, statistics, sliders, and plugins that run ongoing processes. Next, replace them with lightweight plugins that consume minimal resources. Delete all plugins you're not using, and disable unnecessary plugin settings that consume resources. Finally, selectively disable plugins from loading on certain content using a plugin like Asset Manager or Perfmatters.

🚀 How do you optimize external scripts?

It's best to avoid external scripts all together, such as Google AdSense, Facebook widgets, and plugins that create external requests. Some plugins such as Disques let you load it conditionally. If the page contains JavaScript, try the Async JavaScript plugin. Finally, prefetch all external URLs that are loading on the page.

Really hope this helped! Drop your new GTmetrix scores + load times in the comments :-)

Cheers,
Tom

Subscribe
Notify of
guest
479 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments