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

Home » WordPress Speed Tips & Tricks » How I Optimized My Slow WordPress Site For 100% GTmetrix Scores — 25 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

All domains shown in this video are live, which means you can test the speed of 15+ different hosting companies in real-time by clicking through pages, running them through GTmetrix, etc.

Each website is identical except for the hosting. I signed up for 15+ different hosting accounts and installed the same Astra Starter Site (Outdoor Adventure) on every website. They all use SSL, no caching, no CDN, and the same 6 plugins. I strictly wanted to measure hosting speeds.

In the video, I also used the WP Hosting Performance Check plugin and KeyCDN to measure some of 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.

Here they are:

#1. DigitalOcean On Cloudwayscwdoserver.com had the fastest load times, is who I use, and are usually #1 in Facebook Groups (especially as a SiteGround alternative). Cloudways does monthly pricing starting at $10/month with no high renewal prices or strict CPU limits like SiteGround. Their stack is very fast: PHP 7.4, Maria DB 10.3, Memcached, Varnish, Nginx, and Redis. Only complaint is email hosting is $1/month (you would need a Rackspace account). The community manager is 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 lower traffic and plugins. Check this Facebook poll.

#5. SiteGround – have gone downhill in my opinion and I no longer recommended them. Load times and TTFB on stgrndserver.com were usually above 1s. 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 they didn’t perform well. 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.

I use DigitalOcean on Cloudways who is also listed in the WordPress Optimization Guide.

SiteGround-vs-Cloudways

I would personally skip shared hosting since cloud hosting is exponentially faster. This is especially true if you’re on GoDaddy or EIG brands (eg. Bluehost and HostGator) and for resource-intensive websites running WooCommerce, WPML, page builders, or slow plugins.

There are plenty of migration results if you check Twitter and Facebook Groups. Avoid the bloggers promoting Bluehost and WP Engine because they have the highest commissions and do your research. Hosting is the #1 factor in WordPress’ optimization guide – very important!

Cloudways Response Times

Godaddy to DigitalOcean Migration

VPS Cloud Hosting WooCommerce Poll

Hosting Recommendations Facebook

2017-WordPress-Hosting-FB-Poll

2018 Hosting Recommendations

Favorite Hosting For Elementor

Untitled

Vultr Migration

WordPress Hosting Suggestions

VPS Cloud Hosting Poll

2016-WordPress-Hosting-FB-Poll

July 2019 Hosting Recommendation

Elementor Hosting Recommendations

Preferred-Web-Hosting-Poll

How To Check If Your Hosting Is Slow

  • Slow server response time in PageSpeed Insights
  • High TTFB (time to first byte) in GTmetrix Timings tab
  • Your website has good GTmetrix scores, but a poor load time
  • 503 server unavailable errors (means the server is overloaded)

Reduce Server Response Time

 

2. Rethink Your Theme And 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 highly recommend WP Rocket as your one and only cache 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 selecting the latest version.

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. Configure Cloudflare’s CDN

CDNs host your website files on multiple data centers around the world, helping to offload bandwidth to their data centers. This should not only make your website faster, but also lighten the load on your server to help improve server response times while reducing hosting costs.

Cloudflare-Bandwidth-Savings

Step 1: Sign Up For Cloudflare’s Free CDN
Cloudflare’s free CDN can be activated in many hosting accounts (eg. SiteGround, Bluehost), otherwise you will need to sign up for Cloudflare, add your website, and change nameservers.

Step 2: Make Your Cache Plugin Compatible With Cloudflare
WP Rocket and most cache plugins ask for your Cloudflare Zone ID, Global API Key, and Cloudflare account email. These are found in your account. Add them to your cache plugin.

WP-Rocket-Cloudflare-Add-On

Step 3: Configure Settings + Page Rules In Cloudflare
Login to your Cloudflare dashboard. There are quite a few things here that aren’t available if you setup Cloudflare through your hosting provider (that’s why you have to login to the actual Cloudflare dashboard). There are a few settings that can improve your WordPress site speed.

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

Step 4: Consider Additional CDNs
StackPath is another CDN which offloads even more bandwidth to their 31 data centers. Should you use multiple CDNs? Some say yes, some say no. I’ve had great results using both Cloudflare + StackPath and you can see I’m saving a ton of bandwidth with StackPath’s CDN. They have a 30-day free trial and a tutorial for setting up a full-site CDN (preferred method).

StackPath-Bandwidth-Savings

CDN-URL-StackPath

WP-Rocket-CDN

Step 5: Make Sure Cloudflare Is Working
Every CDN besides Cloudflare makes this green (it’s just the way Cloudflare is set up). Don’t worry if it’s not – as long as Cloudflare is working (you can check with their Chrome Extension) and is offloading bandwidth which you can check in Cloudflare’s analytics, that’s what matters.

CDN GTmetrix YSlow

 

6. Avoid 65+ Slow Loading 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

 

7. 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 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 GTmetrix, but this can also be done with other third party scripts. Just enter the keyword of the script into the plugin and set a timeout period. I highly 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.

 

8. 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 – find the URLs of your font files in the GTmetrix Waterfall, then 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.

 

9. 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 (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.

 

10. 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.

 

11. 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

 

12. 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-Avata

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

 

13. Social Sharing Plugins

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.

 

14. Facebook Pixel

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

Facebook-Pixel-Browser-Caching

 

15. Optimize Images And 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

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 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

 

16. 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 CPU limits). Especially if you anticipate high resource consumption, make sure your hosting plan includes enough resources to properly accommodate your site.

You truly get what you pay for.

SiteGround-Server-Resources-Comparison

 

17. Remove Junk From Your Database

You can use WP Rocket or WP Optimize to clean your database.

Scheduling ongoing cleanups help keep your database tables optimized and removes transients, spam + trash comments, and potentially hundreds of post revisions which WordPress stores automatically anytime you update a page or post. Unless you need post revisions to restore backups of your old content, these are, for the most part, complete trash.

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

 

18. 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

 

19. 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 lets 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.

 

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. 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.

 

22. 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');

 

23. 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 site is getting sluggish, go to WooCommerce Status settings → delete all transients. Transients store cached data temporarily in the database.

Delete WooCommerce Transients

 

24. Block Bad Bots From Consuming 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

 

25. 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