How I Optimized My Slow WordPress Site To Load In

How I Optimized My Slow WordPress Site To Load In

Slow WordPress site?

I’ll show you how to take your GTmetrix, Pingdom, and PageSpeed Insights report and use them to make WordPress-specific optimizations that improve grades/load times. I’ve already written popular tutorials for WP Rocket, high CPU plugins to avoid, and image optimization. This guide combines everything I’ve done to get 100% scores on my homepage as well as other pages. Even this post can load in <2s and it has 172 requests, 5.78MB size, and 400 comments.

Table Of Contents

 
Hosting And Cache Plugin – these are the 2 biggest factors in the WordPress optimization guide. I use SiteGround who is also used by Yoast and rated #1 in multiple Facebook polls. For caching, I use WP Rocket who was also #1 in Facebook polls and comes with more features than other cache plugins (reducing the number of plugins on your site). SiteGround is $3.95 – $11.95/month and WP Rocket is $49/year, but are mostly what I contribute my load times to.

Watch My Video – it’s a 42 minute video, but I cover pretty much everything (timestamps in video description) and you should learn a ton of great information on WordPress site speed:

 

1. GTmetrix vs. Pingdom vs. Google PageSpeed Insights

GTmetrix has the most robust recommendations, like which images need to be optimized in the Page Speed tab (steps 14-16) and using a CDN in the YSlow tab (step 11). It’s also good for finding slow loading plugins if they take a long time to load in the Waterfall tab, or they appear multiple times in your main report. You can also view your time to first byte in the Timings tab.

My GTmetrix report:

2019-GTmetrix-Report

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

My Pingdom report:

2019-Pingdom-Report

Google PageSpeed Insights is only good for 1 thing – checking server response times which Google recommends should be <200ms. Otherwise it’s pretty useless and there are many articles that explain why. You can improve server response times by upgrading plans with your current host to include more server resources or switch to faster hosting from SiteGround, DigitalOcean on Cloudways, or Kinsta who are generally the best 3 hosts in their class (join the WordPress Hosting Facebook Group to get unbiased opinions or look at the Facebook polls).

Reduce-Server-Response-Times

 

2. Avoid EIG Hosting

The same company (EIG) owns Bluehost, HostGator, iPage, Site5, Unified Layer, and over 60 different hosting companies. They are known for cutting costs by packing too many people on the same server (stressing it out) and have horrible reviews because of it. Many websites hosted by EIG have high response times, and I would avoid using these companies at all costs.

List-Of-EIG-Brands

This is well-known in Facebook Groups.

EIG-Facebook-Post

 

3. SiteGround (#1 Host In Facebook Polls)

SiteGround is used by Yoast, myself, and recommended by WordPress. They are #1 in nearly every Facebook poll and give most people significant load time improvements especially if they were using mediocre hosts: GoDaddy, Bluehost, HostGator, InMotion, Dreamhost, EIG.

Yoast-on-Twitter-We-just-switched-to-Siteground

I use their semi-dedicated GoGeek plan which comes with 4x more server resources than shared hosting. Click through my pages to see how fast they load, check out my GTmetrix report, or see people who migrated and posted new load times. They also do free migrations.

DigitalOcean on Cloudways and Kinsta are also good and start at $10/month and $30/month. Cloudways is more for developers who don’t need cPanel, email hosting, or the support you get with SiteGround. Kinsta is basically what WP Engine used to be (pricey, but awesome). My entire blog is basically dedicated to helping people make their website load faster. I refuse to recommend $2/month hosting since it’s most people’s biggest regret when running a website.

2019 Hosting Poll

2017-WordPress-Hosting-FB-Poll

Elementor Hosting Recommendations

July 2019 Hosting Recommendation

WordPress-Host-Poll-Aug-2018

Shared-Hosting-Poll-2017

2019-Hosting-Poll

Go-To-Hosting-Company

WordPress-Hosting-Poll-2017

Managed-Hosting-Poll

WooCommerce-Hosting-FB-Poll

2016-Web-Hosting-Poll

Best-WordPress-Hosting-Provider-Poll

Best-Web-Hosting-2019-Poll

WP Friendly Hosting Poll

2016-WordPress-Hosting-FB-Poll

Favorite Hosting For Elementor

2018 Hosting Recommendations

WordPress Hosting Poll Sept 2018.png

Managed-WordPress-Hosting-Poll-2017

2019-Hosts-Poll-1

Hosting-Poll-For-Speed

WordPress-Hosting-Poll-June-1

SiteGround-Recommendation

2014-Managed-WordPress-Hosting-FB-Poll

Best-Web-Hosting-Provider-Poll

Hosting-Poll-Feb-2019

Hosting-Recommendations-Poll

Bluehost vs SiteGround

WordPress Web Host Poll

They’re recommended by WordPress:

SiteGround-Recommended-WordPress-Host

And by Ivica who runs the WordPress Speed Up Facebook Group with 16,000+ members.

WordPress-Speed-Up Recommended Tools

A few threads:

Godaddy To SiteGround Migration

EIG-To-SiteGround

SiteGround-Migration

SiteGround has 3 plans:

SiteGround-Cyber-Monday

Higher plans include more server resources (#1 factor in the WordPress optimization guide). Here’s the full comparison chart, but GrowBig gives you about 2x more server resources than StartUp, and GoGeek is semi-dedicated hosting which gives you even more. GrowBig and up comes with a free migration, staging, advanced caching, and ability to host multiple websites. GoGeek comes with priority support. Their cloud hosting is quite the price jump at $80/month.

You can see this on their features page:

SiteGround-Server-Resources-Comparison

I like SiteGround because:

  1. My GTmetrixPingdom reports speak for themselves
  2. My pages load instantly (click through them if you want)
  3. Fast speed technology (PHP 7.3, NGINX, SG Optimizer, Cloudflare)
  4. Recommended by Yoast, WordPress, Ivica from WordPress Speed Up
  5. Free Let’s Encrypt SSL, easy to use cPanel, and features for eCommerce
  6. WordPress support is unbeatable even without GoGeek’s priority support
  7. GrowBig comes with staging, more storage, and more server resources (scroll down to “we allocate the resources you need” and hover over the server tab)
  8. GoGeek comes with even more server resources, storage, priority support
  9. Free migrations, migrator plugin, and a 30-day money back guarantee
  10. Plenty of praise on Reddit, Facebook conversations, Twitter, TrustPilot
  11. Tons of praise on Facebook: #1, #2, #3, #4, #5, #6, #7#8, #9, #10#11
  12. Many people already migrated and posted results on Twitter: #1, #2, #3, #4, #5, #6#7, #8, #9, #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #20, #21, #22, #23, #24, #25, #26, #27, #28, #29, #30, #31, #32, #33, #34, #35, #36, #37

Affiliate Disclaimer – if you sign up for SiteGround with my affiliate link I will donate a good chunk at no expense to you. Each year I donate $3k to GoFundMe campaigns (2018 was to feed the hungry in Denver, 2017 was to Red Cross at Hurricane Harvey). Your support helps and I genuinely appreciate it. I try to make my reviews unbiased and backed by evidence in the form of Facebook polls, tweets, and real conversations. If you don’t want to use it, here’s a non-affiliate link to SiteGround. Either way I truly believe they are a stellar WordPress host and your site will run faster/smoother… do your research on Facebook groups + Twitter and you’ll find most people say the same.

People usually migrate because their speed technology can cut load times in half:

Switching To SiteGround

SiteGround Load Time Migration

Bluehost to SiteGround GTmetrix

HostGator To SiteGround

SiteGround GTmetrix

SiteGround Google PageSpeed Insights

100 Perfect Score On SiteGround

SiteGround Genesis

Speed Delivered By SiteGround

SiteGround GTmetrix Report

Reduced Load Times With SiteGround

New SiteGround Response Times

HostGator To SiteGround Migration

SiteGround Response Times On Joomla

Switched To SiteGround Hosting

SiteGround Rocket Imagify Combo

Joomla GTmetrix On SiteGround

SiteGround PageSpeed Insights

SiteGround On Joomla

SiteGround Reduced Load Times

SiteGround Speedy Hosting

New Pingdom Results On SiteGround

New SiteGround Response Time

SiteGround Response Time Improvement

Get hosting from SiteGround

 

4. Upgrade To PHP 7+

Upgrading PHP versions is literally the easiest thing and can make your site 2-3x faster.

PHP Speed

So why do most WordPress users run outdated PHP versions?

WordPress-PHP-Stats

Because even though most hosts support it:

Web-Hosting-PHP-Versions

Your hosting company will not automatically upgrade you to the latest version of PHP since your theme/plugins may not be compatible (and they don’t want to break your site). This means you need to do it yourself or request help from your host. It also means if you’ve been on the same host for many years and have never done it, you’re probably still running PHP 5.

Step 1: Install the Display PHP Version plugin to check your current version.

Display PHP Version Plugin

Step 2: Run the PHP Compatibility Checker to make sure your theme/plugins are compatible.

PHP-Compatibility-Checker

Step 3: Upgrade to PHP 7+ by looking for a “PHP Version Manager” in your hosting account:

PHP-Version-Manager

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.

PHP-Upgrade

*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. Cache Plugin

There are lots of cache plugins out there, but these Facebook polls are accurate. Your cache plugin and hosting are two key factors, so splurge on WP Rocket if you have $49/year (you can get 10% off if you sign up for their email list). Otherwise, WP Fastest Cache and Swift Performance are 2 good free choices. I’ve been using WP Rocket on my site for about 3 years.

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

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, reducing the number of plugins on your site. If you’re like me, you only want to use 1 plugin, otherwise you will need to research which features your cache plugins comes with, then install these plugins if it doesn’t support them.

WP-Rocket-Features

Cache Plugin Guides

WP Rocket and WP Fastest Cache are simple to setup, while the others a bit more complex.

Some hosts like GoDaddy and WP Engine blacklist cache plugins because they have their own built-in caching system. In this case, use Autoptimize to optimize HTML, CSS, and JavaScript. It also has a CDN option. See my Autoptimize tutorial, otherwise if your host doesn’t blacklist cache plugins, I recommend either WP Rocket or Swift.

 

6. Clean Database

Deletes your spam and trash folders, trackbacks, pingbacks, database tables, transients, and the potentially thousands of post revisions and post drafts that have accumulated overtime which WordPress stores automatically. These are garbage files and slow down your site. I recommend scheduling WP Rocket or WP Optimize to delete these every week or so. You should be fine, but take a backup of your site if this is your first time cleaning your database!

If using WP Rocket, run (and schedule) this in the database settings:

WP-Rocket-Database-Settings

If not using WP Rocket, use the free WP-Optimize plugin:

WP-Optimize Clean Database

 

7. Heartbeat Control

The WordPress heartbeat API consumes server resources by showing real-time plugin notifications and that other users are editing a post. Since this can generate a request every 15-30 seconds, it’s best you disable this either in WP Rocket, or the Heartbeat Control plugin.

If using WP Rocket, disable this in the Heartbeat settings:

WP-Rocket-Heartbeat-Control

If not using WP Rocket, use the Heartbeat Control plugin:

Heartbeat-Control-Plugin

 

8. Lazy Load Videos

Delays loading of videos until you scroll down the page and they become visible. I was able to reduce the load time of multiple posts by about 6s just by enabling this (since videos are a heavy element). You can do this with photos too but the constant loading can be annoying so I have it disabled. If you’re not using WP Rocket, the WP YouTube Lyte plugin has great reviews.

If using WP Rocket, enable lazy load in the “Media” settings:

WP-Rocket-Lazy-Load

Replace YouTube Iframe With Preview Image – this only loads videos once people click the play button, potentially shaving multiple seconds off content with videos. You can do this WP Rocket, or follow this light YouTube embed tutorial. You will basically paste a code into your web template, paste some more code into your CSS, then embed each video using a “div” code.

See how the video isn’t loaded until you click the play button?

 

9. Google Fonts

If you’re using Google Fonts, you will probably see these errors in GTmetrix:

Google-Fonts-GTmetrix

This means you need to host your fonts locally using a plugin like OMGF:

CAOS-Fonts

Or the Self-Hosted Google Fonts plugin which automatically downloads all Google Fonts you’re using then adds them to CSS, without having to configure anything… it does it for you.

Self-Hosted-Google-Fonts-Plugin

If you prefer not to use a plugin, download your fonts directly from Google Fonts (only the fonts/weights you need), use Transfonter to convert them to web fonts, then add them to CSS.

Transfonter-Google-Font-Conversion

 

10. Google Analytics

If you’re using Google Analytics, you can do the same thing with your tracking code.

Leverage-Brower-Caching-Google-Analytics

If using WP Rocket, the Google Tracking in the Add-Ons tab should fix this:

WP-Rocket-Google-Tracking

Or use the CAOS for Analytics plugin:

CAOS-Analytics

 

11. Cloudflare Setup

Cloudflare is free and improves speed, security, and spam protection. Their CDN hosts your files on 190+ data centers which helps offload resources to their servers (lightening the load on yours). The data centers also reduce the geographic distance for your content to travel to visitors. Cloudflare is easy to setup with WP Rocket (I also listed alternative methods below).

Cloudflare-Data-Centers

Step 1: Sign up for Cloudflare, add your website, then it will run a scan. You will go through a set of pages until you reach a dashboard with your 2 Cloudflare name servers (which you will change in your hosting account) and your Global API Key to enter into your caching plugin…

Cloudflare-Nameserver-Dashboard.

Step 2: Change name servers in your domain registrar to the ones Cloudflare assigned you:

SiteGround-DNS-Records

Step 3: Enter your Global API Key (found in your Cloudflare profile) into your cache plugin:

Cloudflare Global API Key

WP-Rocket-Cloudflare-Add-On

Alternative Methods For Setting Up Cloudflare

Some hosts also have an option to activate Cloudflare in their dashboard:

SiteGround-Cloudflare-Activation

Whitelist Cloudflare IPs In Your Hosting Account – you don’t want your host to block Cloudflare, so make sure they whitelist all Cloudflare IPs (you may need them to make sure).

Cloudflare-IP-Ranges

 

12. Cloudflare Settings

CLoudflare has a ton of options, but here are the most important things to do.

Speed Settings
Go to your speed settings and copy these. Check your site afterwards for errors. Here’s more information on minification, AMP Real URL, SG Railgun, Brotli, and Rocket Loader if needed.

Cloudflare-Speed-Tab

Caching

Cloudflare-Caching-Settings

Scrape Shield
Hotlink protection prevents people from using YOUR images on THEIR website – which sucks up the bandwidth on your hosting plan. Go to Cloudflare’s scrape shield settings and enable it.

Cloudflare Hotlink Protection

Page Rules
Cloudflare says:

“We recommend that you create a Page Rule to exclude the admin section of your website from Cloudflare’s performance features. Features such as Rocket Loader and Auto Minification may inadvertently break backend functions in your admin section.”

Go to Cloudflare’s page rules settings

CloudFlare-Page-Rules-Settings

This page rule disables Cloudflare performance features in the WordPress admin panel, bypasses the cache, and improves it’s security (just as Cloudflare recommended you do).

WP-Admin-Page-Rule

This page rule will decrease bandwidth of the WP uploads area. Since items in your WordPress uploads file don’t change frequently, you don’t have to cache them as often, saving bandwidth.

Cloudflare-WP-Uploads-Page-Rule

Firewall
Firewall rules can be used to block bad bots (step 24) and is explained there.

 

13. CDN (Content Delivery Network)

This is recommended in the WordPress optimization guide:

CDN-WordPress-Recommendation

I use StackPath’s CDN, but why use another CDN if you already have Cloudflare? Because…

  • StackPath has 31 additional data centers (more = faster)
  • StackPath uses faster SSD servers with 10GB connections
  • StackPath has dashboards that provide lots of information about your cached files
  • StackPath’s team helped me configure my CDN and improved my GTmetrix YSlow score by 8%, putting the “cherry on the cake” to make my report a perfect 100%
  • StackPath allows you to protect your account using a two-step authentication process; you can whitelist the IP addresses of people who are permitted to access your account

StackPath-Data-Centers

Step 1: Sign up for StackPath (they have a 30-day trial).

Step 2: In the dashboard, click the CDN tab, then create a StackPath CDN Site:

StackPath-CDN-Tab

StackPath-CDN-Domain

CDN-URL-StackPath

Step 3: Paste your StackPath CDN URL into WP Rocket, or use CDN Enabler:

WP-Rocket-CDN-Settings

Step 4: In StackPath go to CDN → Cache Settings, then click Purge Everything:

StackPath-Purge-Cache

Step 5: Run your site in GTmetrix and “content delivery network” should be green in YSlow.

CDN GTmetrix YSlow

If you expand items in GTmetrix and are related to your CDN, contact StackPath’s support who should be able to help you fix these. They did this for me and have outstanding support.

Cookie Free Domains MaxCDN

GTmetrix YSlow Without StackPath
GTmetrix YSlow Without MaxCDN
GTmetrix YSlow With StackPath
GTmetrix YSlow With MaxCDN

Troubleshooting StackPath

Step 6: Whitelist StackPath’s IPs in your hosting account (you may need to contact your host).

StackPath-IP-Addresses

 

14. Serve Scaled Images

Images can be optimized 20 ways, but these are the main 3. You can run any page through GTmetrix and it will show all unoptimized images for that page. Start with images that appear on multiple pages (logo, widget/footer images) then optimize images on your individual pages.

image-optimization

Serve Scaled Imagesresize 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.

Serve Scaled Images

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

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

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.

 

15. Specify Image Dimensions

Specify Image Dimensions – means you need to specify a width and height in the image’s HTML or CSS. This usually happens in your widgets, HTML, or CSS sections of your website since the visual editor takes care of this automatically. GTmetrix will again provide you with the correct dimensions, then you need to locate that image and specify the width + height:

Specify Image Dimensions

 

16. Losslessly Compress Images

Optimize Images – losslessly compress images using Imagify or ShortPixel (both are free until you reach the monthly limit). There are other completely free plugins with unlimited compressions, but do NOT use these since they have bugs, won’t work, or can break images.

  1. Sign up for Imagify
  2. Install the Imagify Plugin
  3. You will be prompted with the instructions below:
  4. Enter your API key from your Imagify account
  5. Set your compression level (normal, aggressive, ultra)
  6. Imagif’em all (photo below) with bulk optimizes all images on your site
  7. Once you’ve reached your limit, pay $4.99 or wait next month to reset your limit

imagify

Once signed up, bulk optimize all images on your site.

imagify-wordpress-image-optimization

 

17. External Resources

External resources are anything from Google Fonts to embedded YouTube videos, social sharing plugins, comment plugins, Gravatars, or anything that pulls information from an external website. These will appear in your GTmetrix report. Sometimes you can optimize them, sometimes you can’t. Here’s few things I learned about optimizing external resources.

Tips For Optimizing External Resources

GTmetrix-Advertisements

Prefetch DNS Requests – this helps browsers anticipate external resources so they load faster. See this list of common domains to prefetch which includes Google Maps, Google Analytics, Google Fonts, Gravatars, social sharing plugins, Disqus, social networks, and others. You should also prefetch your CDN URL if you’re using StackPath, KeyCDN, or another CDN.

Prefetch-DNS-Requests-WP-Rocket

If using WP Rocket, added these in the Preload settings:

Prefetch-DNS-Requests

If not using WP Rocket, use the Pre* Party Resource Hints plugin.

 

18. Remove Bloat

WP Disable lets you disable settings in WordPress that consume CPU and slow down your site. It also has options for heartbeat control (if you remember the actual heartbeat control plugin, you can now delete it and just use this)… as well as a few other options that can speed up your website/admin panel. Go through the settings and simply disable what you don’t use.

Tips On Using WP Disable

  • Disable EVERYTHING you don’t use
  • Scheduling spam deletion is a good idea
  • Emojis, Google Maps, and Gravatars take a long time to load
  • Pingbacks and trackbacks aren’t usually worth the extra resources
  • Set post revisions to 3-5 so you have backups, but you don’t need hundreds
  • Miscellaneous options in the “request” tab can further your improve load times

WP-Disable-Requests

WP-Disable-Tags-Settings

WP-Disable-Admin

/WP-Disable-SEO.

WP-Disable-Others

 

19. Minimize Plugins

Have you deleted the Hello Dolly plugin and WordPress Importer? How about replacing that Twitter plugin with a Twitter widget or that Facebook plugin with a Facebook widget? Instead of using a Google Analytics plugin why not insert the tracking code directly in the footer (or even better, host it locally)? Yoast generates an XML sitemap for you so the Google XML Sitemaps plugin isn’t necessary. Go through your plugins and deactivate/delete the ones you don’t need. You should also avoid using 2 separate plugins if they have duplicate functionality.

Delete all plugins you don’t need, and unused themes under Appearance > Themes:

Delete Unused WordPress Themes

 

20. High CPU Plugins

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. Backup Buddy (use UpdraftPlus)
  4. Beaver Builder
  5. Better WordPress Google XML Sitemaps
  6. Broken Link checker (use Dr. Link Check)
  7. Constant Contact for WordPress
  8. Contact Form 7 (load JS + stylesheet only when necessary)
  9. Contextual Related Posts
  10. Digi Auto Links
  11. Disqus Comment System (use Disqus Conditional Load)
  12. Divi Builder
  13. Essential Grid
  14. Fuzzy SEO Booster
  15. Google XML Sitemaps
  16. Jetpack
  17. NextGEN Gallery
  18. NewStatPress
  19. Really Simple Share
  20. Reveal IDs
  21. Revolution Slider
  22. ShareThis
  23. S2 member
  24. SEO Auto Links & Related Posts
  25. Similar Posts
  26. Slimstat Analytics
  27. SumoMe
  28. Talk.To
  29. Ultimate Social Media & Share
  30. VaultPress
  31. Wordfence (disable live traffic reports)
  32. WordPress Facebook
  33. WordPress Related Posts
  34. WordPress Popular Posts
  35. WP Bakey (formerly Visual Composer)
  36. WP Statistics
  37. WP Power Stats
  38. WP-PostViews
  39. WPML (if you use too many extensions)
  40. wpCloaker
  41. WPML
  42. Yet Another Related Post Plugin
  43. Yuzo Related Posts

You can also use the GTmetrix waterfall tab to see your slowest plugins:

Slow-WordPress-Plugin

Disable Unused Plugin Settings
Go through each of your plugins and decide which settings you can turn off (this will lower CPU). For example, in Yoast under Settings > General > Features I disabled the following…

Yoast-Feature-Settings

Examples

  • Wordfence’s live traffic reports
  • Broken Link Checker’s ongoing scans
  • Chat and calendar plugins that run constantly
  • Statistical plugins that constantly collect data
  • Related post and popular post plugins that store tons of data
  • Disable ALL settings you don’t use since many will consume CPU

 

21. Lightweight Plugins

Social Sharing – WP Rocket’s test showed Social Media Feather, MonarchSimple Shared Buttons Adder, and MashShare had the least amount of requests and fastest load times.

BackupUpdraftPlus.

SlidersSoliloquy, LayerSlider, or Meteor Sliders.

CommentsDisqus Conditional Load.

PortfolioEnvira Gallery, FooGallery, or The Grid.

Analytics – Google Analytics and Search Console should be plenty. Just make sure you’re hosting Google Analytics locally (using WP Rocket or WP Disable).

Page BuildersWordPress Page Builder by MotoPress, but no page builder runs faster than the native WordPress Editor. Combine this with the Duplicator plugin and you shouldn’t need a page builder (including page builders built-in to WordPress themes). Unless your team absolutely refuses to learn a little HTML (the easiest coding language), avoid page builders.

StudioPress Plugins – lightweight plugins for the Genesis Framework.

 

22. Selectively Disable Plugins

Asset Cleanup is great for disabling plugins you don’t use on specific pages/posts. Especially if you’re running a lot of plugins, or just a couple resource-intensive plugins, only loading them on the content they’re used on means your overall WordPress website can load much faster.

Examples:

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

Similar Plugins

 

23. Block Bad Bots

Search engines and bots usually consume the most CPU/bandwidth:

Robots-Spiders-Bandwidth

Wordfence has crawl rate limiting rules that block fake Google crawlers, limits crawler page views, limits human’s page views, and other rules that limit CPU usage and blocks spammers.

Wordfence-Rate-Limiting

Googlebot is usually the most resource-hungry bot. In the site settings of Google Search Console you can limit the crawl rate but this is only recommended if it’s causing high CPU.

Crawl-Rate-Google-Search-Console

You can do the same thing in the crawl control settings of Bing Webmaster Tools

Bing-Crawl-Control

This next section shows you how to use Wordfence to find and block spammy bots that hit your site too much (which may consume CPU and put stress on your server.

Step 1: Install Wordfence.

Step 2: View your live traffic report (under Wordfence’s Tools settings) which shows you all bots hitting your site 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: Go to Wordfence’s Blocking settings and add the spam bots you wish to block. Asterisks serve as wildcards, so if I block *amazonaws.com* it means any hostnames containing amazonaws.com (whether it has characters before or after it) would be blocked. I have saved thousands of requests/bandwidth just by blocking these two spammy hostnames:

  • *amazonaws.com
  • *linode.com

Wordfence-Blocking-Rule

Step 4: Go to your Blocking log and enjoy watching those spam bots get blocked.

Wordfence-Firewall-Blocking

The Block Bad Queries plugin also protects your site against known bad bots. It’s a “one click and done” plugin with a perfect 5 star review – an easy way to reduce CPU from spammy bots.

Block-Bad-Queries

 

24. Avoid AMP

AMP is a Google project that makes mobile pages load faster while adding an “AMP” stamp to mobile snippets. While it does improve performance, it also changes the design of your mobile site which can decrease conversions. Kinsta did a case study where mobile leads dropped 59% when they added AMP, so they disabled it (and after reading that article, I disabled mine too).

amp-pages

Caution: AMP can drop your mobile conversions – use carefully!

Instructions

Cloudflare Accelerated Mobile Links

A common issue is featured images appearing on the top of posts when you might not want them too. There is a work around for this, but it’s not perfect. You can either have no featured image, or you can set a default featured in Yoast under SEO → AMP → Design → Default Image. That default image will show if NO featured image is set, but if one is, that is what will show on the top of the post. You can read Yoast’s AMP guide but I basically just summed it up.

 

25. Gravatars

Gravatars take a LONG time to load especially if you have lots of blog comments (try running a post with comments through GTmetrix and you’ll see how bad it gets). You have a few options:

  • Host Gravatars locally using WP User Avatar
  • Disable Gravatars completely
  • Set your default Gravatar to blank
  • Delete comments that don’t add value
  • Set your default Gravatar to a custom image on your server
  • Restrict your Gravatar images to smaller dimensions (e.g. 32px)
  • Paginate comments in WP Disable to only show 20 comments at a time
  • Try caching Gravatars using the FVHarrys, or Optimum Gravatar Cache

 

26. WooCommerce

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

WooCommerce styles in query monitor

WooCommerce Optimization Tips

  • Disable cart fragments using this Github code
  • Disable WooCommerce scripts using this Github code
  • Disable WooCommerce styles using WooCommerce’s tutorial
  • Clear customer sessions and remove transients occasionally
  • WooCommerce sites require more resources, so choose your hosting plan accordingly

But the easiest way to optimize WooCommerce is using the Perfmatters plugin by Kinsta:

perfmatters woocommerce optimization

 

27. Add SSL

There’s no reason not to use SSL when Let’s Encrypt SSL offers it for free in most hosting accounts. I was reluctant to change and feared a drop in traffic, but my traffic stayed the exact same. Really Simple SSL also makes configuring it very easy. If you haven’t done it, I would do it.

siteground-lets-encrypt-ssl

 

28. Limit Post Revisions

Add this to your wp-config file before where it says “That’s all, stop editing! Happy blogging.” Perfmatters also lets you limit post revisions which accumulate over time in your database.

define('WP_POST_REVISIONS', 3);

 

29. Disable Pingbacks + Trackbacks

These aren’t necessary, so turn them off in Settings > Discussion.

WordPress Trackbacks Pingbacks

 

30. Check AWStats For High CPU

AWStats is a tool built-in to some hosting cPanels that provides statistics on CPU usage. It tells you whether certain bots, images, downloaded files, and even IP addresses are consuming a lot of CPU. You can also use the WP Server Stats plugin but I think AWStats does an awesome job.

AWStats helps you find:

  • High bandwidth crawlers
  • High bandwidth IP addresses
  • High bandwidth download files
  • High bandwidth files (eg. images)
  • Total bandwidth usage (for monitoring)

Monthly-Bandwidth

 

31. Defer Parsing Of JavaScript

Backup your functions.php file then add this code to it – then you’re done. Double check your site to make sure everything looks/functions properly. If this still doesn’t fix the item in Pingdom, try the Scripts To Footer Plugin. This step can require testing and using different code variations but I borrowed the code from this article if you want more clarification.

if (!(is_admin() )) {
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
// return "$url' defer ";
return "$url' defer onload='";
}
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
}

 

32. Add Expires Headers

Most cache plugins should take care of this automatically when you enable browser caching (like WP Rocket and W3 Total Cache). But if ‘add expires headers’ still appears in your Pingdom report under the YSlow tab, add this code to the top of your .htaccess…

<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType text/css "access plus 60 days"
ExpiresByType text/javascript "access plus 60 days"
ExpiresByType image/ico "access plus 60 days"
ExpiresByType image/jpg "access plus 60 days"
ExpiresByType image/jpeg "access plus 60 days"
ExpiresByType image/gif "access plus 60 days"
ExpiresByType image/png "access plus 60 days"
ExpiresByType text/css "access plus 60 days"
ExpiresByType text/html "access plus 60 days"
</IfModule>

 

33. Remove Query Strings

This item has been a pain in the ass for a lot of people (including me). Thankfully, a few recent updates have been made by the most popular cache plugins that allow you to easily fix the ‘remove query strings from static resources‘ item in your GTmetrix and other speed reports. However, most query strings are generated by plugins (which you can see in your GTmetrix report), so it is absolutely critical to only use lightweight plugins and to test them immediately.

WP Rocket has an option in the “file optimization” tab:

Remove-Query-Strings-From-Static-Resources

W3 Total Cache has an option for this under Performance → Browser Cache:

Remove Query Strings From Static Resources

WP Disable has an option in the “requests” tab:

Remove-Querystings-WP-Disable

Remove Query Strings From Static Resources Plugin – you can also try this free plugin.

 

34. Minimize Redirects

Usually means you changed the www or http version of your website but didn’t change your links/images to reflect this. Try using the Better Search & Replace plugin to fix them in bulk.

minimize redirects

 

35. Lightweight Theme

If your WordPress site has been slow since the beginning, it’s probably either your hosting or theme. I remember developing a website using the Law Business theme and it was SO SLOW I had to scratch the entire website and start over using the Executive Pro theme by StudioPress. This is due to poor coding by the theme developer or too many unnecessary built-in features.

StudioPress themes are lightweight (they load fast), responsive, HTML5, secure, and reliable (they won’t crap out or get discontinued like some ThemeForest themes). They are used by over 200,000 people, their themes are built in the Genesis Framework (recommended by Yoast and WordPress founder Matt Mullenweg), plus they have lightweight Genesis plugins.

I know you don’t want to change your theme. But if your design sucks anyway, a StudioPress theme can be a game changer. I wrote a review on StudioPress if decide to look into them.

studiopress-themes

 

36. Monitor Server Resources

You only have a limited amount of server resources on your hosting account. Hosting too many websites on one account, resource-hungry plugins, and many other factors can slow down your server. Make sure your plan has enough resources to properly accommodate your needs.

SiteGround-Server-Resources-Comparison

If you’re getting bandwidth/CPU overages, you need to fix it (this guide should have helped) or upgrade your plan to include more resources. On many cloud plans, you can add resources as needed to make sure you’re not coming close to exceeding them, which stresses on the server.

Cloud-Memory-Increase

 

37. Update WordPress

Update WordPress core, theme, plugins, and framework if you use one (eg. Genesis).

WordPress Updates

Check your hosting cPanel to see if there’s an option for automatic updates:

SiteGround WordPress Autoupdates

Genesis Framework also has an option for this:

Genesis Automatic Updates

 

38. Find Slowest Pages

You can use Google Analytics to find the load times (and recommendations) for your top viewed pages and slowest loading pages. Login to Google Analytics and on the left, go to Behavior → Site Speed → Speed Suggestions. Click the ‘Page Speed Suggestions’ to see recommendations, though I would say GTmetrix recommendations are usually better.

Speed-Suggestions-Google-Analytics

 

39. Cloudways Hosting

If you’re looking for something faster than shared hosting, most people are jumping to Cloudways. They are cloud hosting (not shared) and are even faster than SiteGround. The tradeoff is their support isn’t as good as SiteGround, it’s a little more tedious to manage, and they don’t provider email hosting. But if you’re looking for pure speed, they were also rated #1 in many Facebook polls. Most people use their DigitalOcean plan which starts at $10/month.

For shared hosting, SiteGround is great. But their cloud hosting is quite expensive at $80/month when for the same price at Cloudways, you get almost double the CPU + RAM.

You also pay monthly instead of yearly, which is nice.

SiteGround-vs-Cloudways-Cloud-Hosting

People who migrated to Cloudways (or one of their cloud providers):

Cloudways Response Times

WP Engine To Cloudways

DigitalOcean Pingdom Report

Cloudways Server Response Times

Godaddy to DigitalOcean Migration

Cloudways Load Time Improvement

Cloudways vs WP Engine

Untitled

Cloudways Pingdom Load Times

Cloudways Pingdom Report

Namecheap To Cloudways Migration

Vultr Migration

Cloudways WooCommerce Migration

Cloudways AWS Migration

Also #1 in many Facebook polls:

Hosting Recommendations Facebook

VPS Cloud Hosting WooCommerce Poll

Elementor Hosting Recommendations

2017-WordPress-Hosting-FB-Poll

VPS Cloud Hosting Poll

WordPress Hosting Suggestions

Favorite Hosting For Elementor

2016-WordPress-Hosting-FB-Poll

 

40. Hire My WordPress Speed Optimizer

Still need help with your GTmetrix/Pingdom report? I’ve been working with Pronaya for 7 years (he’s the one who helped me get a <1s load time in Pingdom). You can hire him by creating a profile on freelancer.com and searching for username bdkamol. Here is his full WordPress speed portfolio. He’s $40/hour from Bangladesh (so there is a time change) and you can email him at bdkamol@gmail.com. He also has a perfect 5 star review on his profile. Serious inquiries only, and please don’t expect 100% scores if you’re using slow hosting, a bloated theme, and tons of heavy plugins. Please follow this WordPress speed guide first.

Pronaya-Kumar-S-Reviews

Some reviews on his profile:

BDkamol-WordPress-Speed-Reviews

 

Frequently Asked Questions

What are the most important speed factors?

Hosting, cache plugin, image optimization, plugin optimization, and whether you’re using external scripts are usually the top 5 factors of website speed.

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, but it is a premium plugin. The top free cache plugins are Swift Performance, W3 Total Cache, and WP Fastest Cache.

Which WordPress hosting should you use?

The best hosting is highly debatable, but SiteGround and Cloudways are generally the 2 top-rated WordPress hosts in over 30+ Facebook polls. SiteGround is good for shared hosting, and Cloudways for cloud hosting.

Which speed testing tool should you use?

GTmetrix has the most robust recommendations especially when it comes to optimizing images, finding slow plugins in the Waterfall tab, and measuring time to first byte. Pingdom doesn’t have as many recommendations, and Google PageSpeed Insights doesn’t even 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.

Hope this helped! Drop your new GTmetrix scores + load times in the comments 🙂

Cheers,
Tom