How To Reduce Server Response Times (Time To First Byte) In WordPress To Under 200ms: Item In Google PageSpeed Insights

Need to reduce server response times in PageSpeed Insights?

Servers are controlled by your hosting. The easiest way to reduce server response times in WordPress is to upgrade to a more powerful server since shared hosting has strict CPU limits. Try removing high CPU plugins, use a CDN to offload resources, and also clean your database.

Shared hosting (GoDaddy, Bluehost, HostGator) has insufficient server resources and has trouble running high CPU tasks like WooCommerce, Elementor, Divi, or AdSense. Moving to faster cloud hosting should fix this immediately. Otherwise, you need to lower CPU usage and lighten the load on your server. SiteGround has one of the worst TTFBs reported by Backlinko.

Reduce-Server-Response-Times-WordPress

 

What Is A Good TTFB?

Google recommends a TTFB of under 200ms.

This can be realistic for some WordPress sites, but you need to have a fast infrastructure (hosting, theme, plugins). If TTFB is over 600ms, it’s considered slow and will fail the audit.

Slow servers affect load times, PSI scores (multiple items), and admin panel speed. Since web vitals are becoming a larger ranking factor, achieving a fast TTFB is more important than ever.

12
0-200msGoogle Recommended
200-400msAverage
400-600msSlow
800-800msVery Slow
800-1000msUnacceptable
1000ms+Garbage

 

1. Test For Slow TTFBs

Measuring TTFB In PageSpeed Insights

PageSpeed Insights is a good place to measure TTFB. According to Google, “this audit fails when the browser waits more than 600 ms for the server to respond to the main document request.”

Short Server Response Time

Measuring TTFB In GTmetrix

GTmetix shows your TTFB in the Summary and Structure tabs. Sign up for a free GTmetrix account so you can run tests from the data center closest to your visitors instead of Vancouver.

GTmetrix TTFB

Measuring TTFB In KeyCDN

KeyCDN measures TTFB across 14 different locations (it’s also my preferred tool). TTFBs can be fast when testing locations close to your origin server and slow when testing long distances.

KeyCDN TTFB

Measuring TTFB In Pingdom

Pingdom measures TTFB as “wait” time and lets you test from various locations.

Pingdom TTFB

Measuring TTFB In Chrome DevTools

Chrome DevTools measures TTFB but is affected by your computer’s latency and internet connection, so you may want to measure TTFB from a data center using one the tools above.

TTFB Chrome DevTools

 

2. Ditch Shared Hosting

Shared hosting is infamous for slow TTFBs.

If your neighbors (other sites on the server) are hogging resources, your website is being starved. Not to mention shared hosting always has CPU limits. That’s why you’ll often see 500 errors on shared hosting. One day your website is fast, the next day, it’s sluggish. I would never run a page builder or WooCommerce with shared hosting – they demand too many resources.

  • SiteGround – Backlinko found SiteGround had one of the slowest TTFBs. There has also been increased complaints about slow TTFBs in Facebook Groups, CPU limits, recent server issues, and their cloud hosting usually won’t fix your TTFB (demo site is slow when using Astra on SiteGround GrowBig: stgrndserver.com). Many SiteGround customers already left as they rapidly went downhill in 2020.
  • GoDaddy – long reputation for slow hosting and generally a bad provider.
  • Bluehost – popular with affiliates, but not recommended in Facebook Groups.
  • HostGator – same company as Bluehost (EIG) with mostly the same problems.
  • Hostinger – uses LiteSpeed which is faster, but still not fast and very unethical.

Cloud hosting makes a difference.

Shared Hosting vs Managed Hosting

Join the WordPress Hosting Facebook Group to get unbiased opinions. Other Facebook Groups like WordPress Speed Up may be moderated by SiteGround’s community manager where posts get removed if they speak negatively about SiteGround, and opinions are biased.

Here’s a TTFB test I did on 16+ hosts using the same Astra Starter site (read about the test).

WordPress-Hosting-TTFBs

 

3. Upgrade To Cloud Hosting

Most hosting recommendations are honestly garbage.

Join the WordPress Hosting Facebook Group to get unbiased feedback from knowledgeable people who’ve been around the block. I won’t tell you to switch hosts if you don’t need to, so run your website through Lighthouse and check for slow server response times (TTFB) over 600ms.

If your TTTFB is slow, many people in Facebook groups (including myself) use Cloudways WordPress Hosting. Specifically their DigitalOcean or Vultr High Frequency plan. Sure, it’s $10-$13/month, but we’re talking about speed, TTFB, and core web vitals – not being cheap.

Take a look at conversations, migration results, and polls posted in some of these Facebook groups. Or look at Backlinko’s PageSpeed Test where he found SiteGround has a slow TTFB. You already know GoDaddy and EIG brands (Bluehost and HostGator) are obviously not good. Hosting affects TTFB, LCP, and other web vitals which will be a ranking factor as of May, 2021.

Here are 22 people who moved to Cloudways and posted their results (click image to enlarge):

Cloudways Numbers
Another Happy Cloudways Customer

Recent Facebook polls taken on “the best hosting” (click image to enlarge):

Moving from SiteGround
eCommerce Hosting Poll

I use Cloudways DigitalOcean who is #1 in most recent Facebook polls.

Cloudways Shoutout

Not saying hosting is everything, but it helps.

2021 PSI Report

This is a simple Pingdom test to measure TTFB + load times of 16 WordPress hosts. I installed the same Astra Starter Site on 16 hosting accounts (using separate domains) while measuring Pingdom load times for 1 week at 30 minute check intervals, as well as TTFB in various tools. No caching or CDN (with same plugins) are being used since I’m strictly comparing the server. Some domains are still live (cwdoserver.com is hosted on a $10/month Cloudways DO plan and stgrndserver.com is on SiteGround GrowBig). I cancelled most accounts since it got expensive. Even when browsing through those 2 sites or running your own tests, you’ll see the difference.

WordPress-Hosting-2020-Pingdom-Test

I use Cloudways because:

  • My TTFB is consistently under 200ms.
  • Free migration service made it easy to try them.
  • They continuously update their speed technology.
  • Multiple caching levels (Redis, memcached, Varnish).
  • Support is great as reflected in their Trustpilot reviews.
  • Free SSL, staging, bot protection, cron job management.
  • Monthly pricing with no long-term contracts or high renewals.
  • They have a Cloudways Users Facebook Group to ask questions.
  • Choice of 5 cloud providers: DO, Vultr, AWS, Google Cloud, Linode.
  • Their community manager answered my questions when signing up.
  • Launching a server yourself and using their migrator plugin is also easy.
  • Ain’t nobody got time for shared hosting when trying to pass web vitals.

 

Affiliate Disclaimer – if you sign up for Cloudways using my affiliate link, I seriously appreciate it. I try to support my recommendations with real, unbiased evidence. I also make donations ($6,000 to GoFundMe so far) and your support would help. It’s easy to request a free migration and promo code OMM25 gets you 25% off the first 2 months.

 

4. Keep An Eye On CPU Usage

Check your hosting account to make sure you’re not maxing out your CPU limits. Try to never exceed 80% of your limits so your server stays relaxed. On cloud hosting, you can add more CPU + RAM which will help, and on shared hosting you will have to upgrade your plan. But before you do, follow this guide as it should also help you reduce CPU consumed by your site.

Reduce-CPU-Usage-WordPress

That’s why it’s so important to choose a plan with enough server resources. Host companies give you guidelines based on your monthly visitors, but they don’t take into account how many plugins you have, whether they consume lots of resources, and whether you’re using a CDN.

 

5. Eliminate 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 Waterfall in GTmetrix.

  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
  8. Constant Contact for WordPress
  9. Contact Form 7
  10. View Full List Of 73 Slow Plugins

Find Your Slowest Plugins – Query Monitor and New Relic are great for finding slow plugins. Install Query Monitor, view a page on your site, hover over the Query Monitor tab, and go to Queries > Queries By Component. You should check multiple pages/posts for different queries.

Query Monitor Slow Plugins

WP Hive is a nifty Google Chrome Extension that tells you whether a plugin will impact your memory usage / PageSpeed Insights scores when viewing plugins in the WordPress repository.

WP Hive

Lightweight Plugin Alternatives

 

6. Disable WordPress Heartbeat

WordPress Heartbeat consumes resources by showing real-time plugin notifications, when other users are editing a post, etc. For most website owners, it usually does more harm than good. There are many plugins to disable this (WP Rocket, Perfmatters, most cache plugins).

To disable the WordPress Heartbeat API without a plugin, go to Appearance > Theme Editor, then edit the functions.php file of your theme. Next, paste the code right after the

Disable WordPress Heartbeat Manually

add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
wp_deregister_script('heartbeat');
}

 

7. Don’t Combine CSS + JavaScript Files

While speed tests reward you for combining CSS and JavaScript files, it could actually be hurting your load times.

WP Johnny posted an interesting article on why you shouldn’t combine. There have also been a few reports of improved TTFBs in Facebook Groups after unchecking these options. While the topic is debatable, it’s worth a try. Remember, scores don’t matter nearly as much as load time.

Don't Combine CSS

Don't Combine JavaScript

 

8. Avoid Page Builders

Websites using page builders got crushed after the big GTmetrix update.

On top of the extra CSS, JavaScript, and countless div wrappers, these websites typically rely on extra third-party plugins/addons. The result is a lot of bloat, slower website, and a slower TTFB.

Elementor-Souce-Code

I recommend Oxygen, Gutenberg, GeneratePress, Astra, OceanWP, or Neve are some good choices. And yes, I made the mistake of using Elementor but am replacing it with Gutenberg.

Fastest WordPress Themes

 

9. Cache Everything In Cloudflare

If you’re using Cloudflare, add a page rule to cache everything.

Go into your Cloudflare dashboard > Page Rules. Copy and paste the rule below, only replace my domain with yours. If you have WooCommerce or a dynamic site and run into issues when adding the cache everything page rule, try using the WP Cloudflare Super Page Cache plugin.

Cache-Everything-Page-Rule

 

10. Reconfigure Your CDN

CDNs are great for reducing TTFBs (theoretically).

By offloading bandwidth to their data centers, you’re lightening the load on your server which should improve it’s TTFB. This sounds great, but CDNs can actually cause TTFBs to be slower.

Slower TTFBs on Cloudflare have been reported numerous times in Facebook Groups. After chatting with WP Johnny (he’s a master of speed optimization), he also reported that WP Rocket’s RocketCDN (which uses StackPath’s data centers) can also result in slower TTFBs.

Since then, I made the switch to BunnyCDN. It’s highly recommended in Facebook Groups, affordable, and easy to setup using their setup instructions. It’s also consistently performant.

A few things to consider:

  • If your visitors are local, don’t use a CDN.
  • If using Cloudflare, consider testing out their APO.
  • If your TTFB is slow, try disabling your CDN and retest.
  • Cloudflare and RocketCDN (StackPath) can sometimes have a negative effect.

 

11. Clean Up Your Database

A thorough database cleanup can help reduce TTFBs in WordPress.

And yes, your cache plugin probably already has a database cleanup option.

But on top of that, I would install WP-Optimize and do a thorough cleaning of your database. WP-Optimize lets you go through your actual plugin tables and delete tables left behind by old plugins you previously deleted (shown as “Not Installed”). Backup your site before doing this.

WP-Optimize-Tables

 

12. Delete Unused Themes + Plugins

Head to Appearance → Themes and delete any themes you’re not using. You can keep one version (eg. Twenty Seventeen theme) in case something goes wrong with your active theme.

Delete Unused WordPress Themes

Delete WordPress Plugins

 

13. Configure A Solid Cache Plugin

WP Rocket and LiteSpeed Cache are the gold standards for cache plugins.

However, most people don’t configure these with the optimal settings. I have written popular tutorials on configuring WP Rocket, WP Fastest Cache, W3 Total Cache, and WP Super Cache.

With most other cache plugins, you would need to install about 6 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 plugin comes with, then install these plugins if it doesn’t support them.

  • Database cleanup – WP-Optimize
  • CSS/JS optimization – Autoptimize
  • Delay JavaScript execution – Flying Scripts
  • Host Google Analytics locally – Flying Analytics
  • CDN URL integration – BunnyCDN / CDN Enabler
  • Heartbeat control – Heartbeat Control / manual code
  • Lazy load images/videos – Optimole / WP YouTube Lyte
  • Preload links / instant page – Perfmatters or Flying Pages
  • Host Facebook Pixel locally – no plugin does this that I know
  • Prefetch/preload – Pre* Party Resource Hints / manual code
  • Font-display:swap – Swap Google Fonts Display / manual code

WP Rocket settings (click on image to enlarge):

 

14. Block Unwanted Bots

Have you checked your Wordfence live traffic report lately?

I did, and I saw the same few bots were hitting my site constantly and putting stress on my server. Obviously Googlebot and other ones are good, there may also be spam bots hitting your site. Unless you check, you’ll never know. Here’s what I did, and what you should do too:

Step 1: Install Wordfence.

Step 2: View the live traffic report for a few minutes to see who is hitting your site in real-time.

Live-Traffic-Report-Wordfence

Step 3: Take note of sketchy-looking bots constantly hitting your site. Google their hostnames to see if other people are reporting them as spam (Googlebot and Bingbot are obviously okay).

Step 4: Block all spam bots (you have a few options here). Wordfence has blocking settings as well as rate limiting rules. However, Wordfence consumes a lot of CPU itself. The alternatives are Blackhole For Bad Bots, Block Bad Queries, or Cloudflare Firewall Rules (this is what I use). You can create up to 5 free firewall rules which means you can block your top 5 spam bots. Just copy their hostname from Wordfence, then block it in Cloudflare. Be sure to use an asterisk* so any variations of that bot are also blocked: amazonaws.com linode.com are 2 common ones.

Cloudflare Firewall Rule To Block Bad Bots

 

15. Update To PHP 7.4

Many WordPress sites still run PHP 5 even though PHP 7.4 is much faster. That’s because hosting companies won’t automatically upgrade your PHP version (due to potential compatibility issues) which you can use the PHP Compatibility Checker plugin to check for.

Upgrade to PHP 7.4 in your hosting account, then check your site for errors:

PHP-7.4

Make sure your MySQL or MariaDB is also updated to the latest version.

 

16. Increase Memory Limit To 256MB

Elementor and WooCommerce both require a 256MB memory limit, but you should really increase it to 256MB anyway especially if your website is getting fatal memory limit errors.

Add the code to your wp-config.php before “Happy Blogging.”

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

Some shared hosts allow this while other shared hosts require you to contact them. Cloud hosting providers almost always allow this (below is for Cloudways).

Cloudways Memory Limit

 

17. Update WordPress Core, Theme, Plugins

Keep WordPress core, themes, and plugins updated.

WordPress Updates

 

18. Use A Premium DNS

DNS can also impact your server response times.

GoDaddy, Namecheap, and other budget providers offer a DNS, but these low quality providers can cause high DNS lookup times. Many managed hosts offer a premium DNS, otherwise consider moving your DNS to a faster provider (either your host or Cloudflare if you’re using it).

 

19. Optimize Third-Party Code

If you’re using third party scripts, these cause extra requests and will show up in your GTmetrix report. Some scripts are difficult or even impossible to optimize (especially Google AdSense and social widgets which are best to avoid all together), but I listed quite a few optimizations below.

Third-Party-Usage

Tips For Optimizing Third-Party Code

I spent too much time on this video but it’s well worth the 44 minutes.

 

Reduce-Server-Response-Times

 

Frequently Asked Questions

What is a good TTFB?

Google recommends a TTFB of 200ms or less. However, Lighthouse only flags this if your TTFB is 600ms or more.

How do I reduce server response times in WordPress?

Hosting is by far the #1 factor. Using a powerful server is the most effective way to improve TTFB. You can also remove high CPU plugins, WordPress bloat, disable Heartbeat, and clean your database.

How do I improve TTFB on WooCommerce?

Remove unnecessary WooCommerce bloat such as scripts, styles, meta box, and marketplace suggestions. Most can be disabled using the Disable WooCommerce Bloat plugin. Avoid running WooCommerce on shared hosting and using heavy page builders.

Are there WordPress plugins that reduce TTFB?

LiteSpeed cache uses server-side caching which can reduce TTFB, otherwise you should generally avoid adding more plugins as it will likely increase TTFB instead of reducing it.

How do you measure server response times?

Server response times can be measured in Lighthouse, GTmetrix, Pingdom, Chrome DevTools, and KeyCDN.

Conclusion: join the WordPress Hosting Facebook Group to get real, unbiased opinions. Look at the Facebook polls that were taken and people who migrated to different hosts and posted their results. Finally, stay clear of low quality hosting affiliates who only want the commissions.

Cheers,
Tom

About Tom Dupuis

Tom Dupuis 2017Tom Dupuis writes WordPress speed and SEO tutorials out of his apartment in Denver, Colorado. In his spare time, he plays Rocket League and watches murder documentaries. Read his bio to learn 50 random and disturbing things about him.

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