How To Reduce Server Response Times (TTFB) In WordPress: Preferably Under 200ms – Lighthouse + PageSpeed Insights Item

Need to reduce server response times?

Servers are controlled by your hosting. The easiest way to reduce server response times in WordPress is to avoid shared hosting and use a more powerful server. That’s because shared hosting has limited resources + CPU limits. Some host’s TTFB like SiteGround and WP Engine, have also gotten worse. There are many polls, migration results, and conversations about “the fastest hosting” which you can find in many unbiased Facebook Groups like WP Speed Matters.

Other than hosting, the other way to improve TTFB is by reducing CPU and lightening the load on your server. Cloudflare has many features that can reduce TTFB including their CDN, Brotli, HTTP/3, bot protection, and APO. You can also use server-level caching, latest PHP versions, clean up junk (database, bloated plugins, page builders, and admin bloat), and disable heartbeat.

 

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-600msPasses Lighthouse
600-1000msFails Lighthouse
1000ms+Very Slow

 

How To Properly Test Your TTFB

Lighthouse

Lighthouse is an ideal place to test 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

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.

OMM TTFB GTmetrix

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

Pingdom

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

Pingdom TTFB

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 of the tools above.

TTFB Chrome DevTools

 

 

1. Reduce CPU Usage

Reducing CPU (found in your hosting account) is one of the best ways to reduce server response times. The majority of this tutorial will be focused on reducing CPU and therefore, lightening the load on your server. Avoid using 75%+ of CPU limits so your server stays relaxed.

Reduce-CPU-Usage-WordPress
Keep your server relaxed by keeping CPU usage under 75%
Usage - Chrome Dev Tools
Check usage of specific elements in Chrome Dev Tools

That’s why it’s so important to choose a plan with enough server resources. Host companies give you guidelines based on 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.

GrowBig Server Resources
Use a hosting plan with enough resources to accommodate your traffic, plugins, etc

 

2. Avoid Shared Hosting

Shared hosting has limited server resources, often resulting in a slow TTFB.

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

Shared Hosting vs Managed Hosting
Managed/cloud hosting can make a big difference
Backlinko TTFB Test
TTFB test done by Backlinko
WordPress-Hosting-TTFBs
My TTFB test correlated with Backlinko’s, and I also tested a few other hosts

  • SiteGround has a slow TTFB, CPU limits, declined support, price increases, and other issues. Their TOS (sec. 9) prevents affiliates from using ‘SiteGround’ in bad reviews. I left them in 2019 and stopped endorsing them entirely. As one person said, “SiteGround is no longer any kind of value for the money.” Do your research.
  • Hostinger writes fake reviews, votes for themselves in FB polls, also unethical. Employees pose as customers and trick people into buying Hostinger (view poll).
  • GoDaddy can actually have a decent TTFB but comes with problems: paying for SSL, malware, slow DNS, and the dashboard gives you little control (see thread).
  • WP Engine makes absurd claims like “the unequivocal performance leader in WordPress” when most people migrate away and post much faster load times.
  • EIG brands like Bluehost and HostGator have overcrowded servers, slow TTFB, bad support/uptimes, and malware issues (view thread). Mainly promoted by “how to start a blog” affiliates and pay a lot to be “recommended” by WordPress.

SiteGround-Slow-TTFB

 

3. Switch To Faster Hosting

Most hosting recommendations are garbage and I suggest joining the WP Speed Matters Facebook Group (run by Gijo Varghese) to get unbiased feedback on hosting + site speed.

I use Cloudways Vultr HF which is a popular choice in Facebook Groups. You can check my GTmetrix report, TTFB, or click through my site and see yourself. I moved from SiteGround to Cloudways in 2019 which cut load times in half and fixed CPU issues (it’s also monthly pricing with no high renewals). They use Object Cache Pro/Redis with NVMe and 44 data centers. The main cons are no file manager or email hosting and their Breeze plugin + CloudwaysCDN aren’t great. I suggest using WP Rocket, Cloudflare or BunnyCDN, and Google Workspace. They do 3-day trials, free migration, and have a promo code for 30% off 3 months. Some people say they’re techie since it requires an extra step to launch a server + connect your domain, but it’s not hard.

Cloudways Launch Server

SiteGround Slow TTFB

SiteGround Cloudways CPU Usage

SiteGround vs Cloudways Pricing

 

Spend 5 minutes looking at recent Facebook polls on “the best hosting,” migration results of people who switched, and unbiased feedback in Facebook groups (click thumbnails to enlarge).

Favorite-Cloudways-Server

Moving away from SiteGround

NameHero is a gem. They use LiteSpeed with more CPU/RAM for a cheaper price compared to SiteGround, Hostinger, A2, Cloudways (although they are cloud hosting) and most major hosts. The Turbo Cloud + Business Cloud plans use NVMe storage while most hosts use slower SSDs. You get LiteSpeed Cache with QUIC, HTTP/3, Redis, and faster server-leveling caching (all are free with your plan). I don’t know anywhere else you can get 3 CPU cores, 3GB RAM, and NVMe on LiteSpeed for $8/month. For larger sites, their managed cloud plans also use LiteSpeed with more CPU/RAM, NVMe, and MariaDB + PHP-FPM (like Cloudways) as well as full root access.

So even though NameHero is known as a “simple, beginner-friendly host” with cPanel and cheap intro prices + higher renewals, they use much faster technology behind the scenes. Plus, they don’t sacrifice support, uptimes, or security like most hosts in their price range. The biggest con is their data centers are only in US/Netherlands. Otherwise, they do a free migration, have a 30-day refund time, and the CEO (Ryan) is a genuinely awesome guy if you watch his YouTube channel. Pull up your host’s specs page (here’s SiteGround’s, Hostinger’s, and A2’s) to compare their technology/resources. You should use WP Johnny’s or my LSC guide if you make the move.

NameHero Plans Resources
Compare your current host’s specs with NameHero’s

Web server poll

Web server poll Oxygen

SiteGround vs Cloudways vs NameHero

NameHero vs SiteGround Feedback

SiteGround to NameHero

NameHero Facebook Feedback

Cloudways TrustPilot Review

NameHero TrustPilot Review

Affiliate Disclaimer: I use affiliate links to Cloudways/NameHero and appreciate your support.

 

4. Avoid Slow Plugins + Page Builders

Some plugins can slow down your website, TTFB, and increase CPU.

PluginCategoryMemory ImpactPageSpeed Impact
All In One SEOSEOXX
AnalytifyAnalyticsX
Backup BuddyBackupX
iThemes SecuritySecurityX
Broken Link CheckerSEOX
JetpackSecurityXX
Query MonitorAnalyticsX
NextGEN GalleryGalleryXX
Site Kit by GoogleAnalyticsX
WordfenceSecurityX
wpDiscuzCommentsXX
WPMLTranslateXX
Yoast SEOSEOX

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

Avoid Heavy Page Builders – Elementor + Divi got crushed in core web vitals. On top of extra CSS, JavaScript, and countless div wrappers, these websites typically rely on extra third-party plugins and addons. This results in even more bloat. I migrated from Elementor to Gutenberg and it made a huge improvement. Even hard coding your menu, header, footer, and sidebar in CSS can remove a lot of page builder bloat. You can also use Asset CleanUp and Perfmatters to unload unused CSS and JS (and use Elementor’s Experimental features) but I would avoid them.

Page Builder Speed Test
Source: gutenberghub.com

Lightweight Plugin Alternatives

  • SEO – Rank Math.
  • BackupsUpdraftPlus.
  • SlidersSoliloquy or MetaSlider.
  • Page BuilderOxygen, Kadence theme, Gutenberg, Genesis.
  • Gallery – Gutenberg Gallery or Meow Gallery.
  • Analytics – Google Analytics and Google Search Console (no plugins).
  • Social SharingGrow By Mediavine (fastest social sharing plugin in WP Rocket’s test).
  • Comments – native comments or wpDiscuz with optimized settings and JavaScript delay.

 

5. Clean Your Database

A thorough cleanup of your database can improve TTFB.

Many of you are using WP Rocket for automatic database cleanups, but this doesn’t let you go through your actual database tables and remove tables left behind by old plugins. For this, I recommend WP-Optimize. View the “Tables” tab and look for plugins that are “Not Installed.” If you deleted a plugin (or disabled a plugin module) and don’t use it anymore, you can remove it.

WP-Optimize-Tables

 

6. Increase Cache Lifespan

Most cache plugins let you set the cache lifespan. By increasing this, you’re saving server resources since the cache doesn’t need to be built as frequently. This is good if you don’t publish content frequently (like a news website), otherwise you should likely leave this as the default.

Cache Lifespan

 

7. 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 <?php tag:

Disable WordPress Heartbeat Manually

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

 

8. Don’t Combine CSS + JavaScript

Smaller sites should usually combine CSS/JS while larger sites should not. According to WP Johnny, websites with a CSS/JS size of under 10KB should combine while over 10KB should not. He goes on to say that regarding TTFB, it’s all about starting sooner, not finishing sooner.

CSS JS Size GTmetrix Waterfall
If CSS/JS size is over 10KB, don’t combine

Don't Combine CSS

Don't Combine JavaScript

 

9. Update To PHP 7.4

Many hosts have already released PHP 8.0, newer MySQL versions, and new features to make your site faster while reducing TTFB. Make sure you’re using the optimizations your host offers. Many plugins/themes still have compatibility issues with PHP 8.0 in which you can use PHP 7.4.

PHP 7.4

WordPress-Plugin-Updates
Don’t forget to update WordPress core, theme, and plugins

 

10. Increase Memory Limit

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 hosts also have an option to increase it in their dashboard.

Cloudways Memory Limit

 

11. Use Server-Level Caching

Many hosts offer server-level caching which reduces TTFB and speeds up your site. Cloudways, SiteGround (and SG Optimizer), Kinsta, and A2 Hosting are just a few of them. I personally use memcached, NGINX, and Redis (with Varnish disabled) in Cloudways. Server-level caching is faster than cache plugins because it’s from your server, which is faster than file-based caching.

Cloudways Manage Services
Memcached, NGINX, and Redis are examples of server-level caching

 

12. Offload Resources To CDNs

CDNs offload resources to their data centers and lighten the load on your server.

I suggest Cloudflare, BunnyCDN, QUIC.cloud (if using LiteSpeed Cache) or Cloudfront. And consider not using StackPath which is used in many CDNs like RocketCDN and CloudwaysCDN.

The other three CDNs tend to have better performance than Cloudflare, but most of them cost money. Regardless of which CDN you choose, I would use Cloudflare for your DNS since their DNS is much faster than GoDaddy or NameCheap’s DNS. To use Cloudflare’s DNS, just sign up for a free plan, then change nameservers. I use Cloudflare for DNS and BunnyCDN for my CDN.

One benefit of Cloudflare is they have additional features that can reduce TTFB (like Brotli, HTTP/3, bot protection, page rules, and their APO) which I’ll talk about in the next few steps.

Step 1: Sign up for a free Cloudflare account, add your site, and run the scan prompted by Cloudflare. You will eventually come to a page where Cloudflare assigns you 2 nameservers.

Cloudflare-GoDaddy-Nameservers

Step 2: Add Cloudflare nameservers to NameCheap. Go to Dashboard → Domain List → Manage → Nameservers → Custom DNS. Add the two nameservers Cloudflare provided you.

NameCheap Nameservers
It can take up to 24 hours to for nameservers to update

 

13. Enable Brotli

Brotli is faster than GZIP compression. Both will reduce the file sizes of your HTML, CSS, and JavaScript. This allows these resources to download faster and improves TTFB. Cloudflare has an option to enable Brotli in the speed settings, otherwise you’ll use Gzip in your cache plugin.

Cloudflare Brotli

 

14. Enable HTTP/3

In the Cloudflare blog, they say that on average, with HTTP/3 we see the first byte appearing after 176ms. With HTTP/2 we see 201ms, meaning HTTP/3 is already performing 12.4% better.

HTTP/3 can be enabled in the Network settings of your Cloudflare dashboard. And if you’re using Quic.cloud or another CDN, be sure the check whether they have HTTP/3 support as well.

Cloudflare HTTP3

 

15. Enable Bot Protection

Your wp-login page is a high target for bad bots.

Even if bots don’t succeed in logging into your site, you may find them attempting to login which consumes server resources. You can block them by moving your login page (using Perfmatters or WPS Hide Login) to a custom login URL, then enabling bot protection in Cloudflare’s settings.

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.

WordPress login bot spam

Step 3: Move your wp-login page. You can do this with Perfmatters or WPS Hide Login.

Move WordPress login URL

Step 4: Block spam bots even further by enabling bot fight mode in Cloudflare → Firewall → Bots → Bot Fight Mode (Cloudways also has bot protection) or try Blackhole For Bad Bots.

Cloudflare Bot Fight Mode

 

16. Create A Cache Everything Page Rule

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

Go into your Cloudflare dashboard → Page Rules. Copy/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

Additionally, you can create a page rule for the wp-admin to protect it, bypass the cache, and prevent apps and performance features (i.e. Rocket Loader) from running in the admin area.

WordPress-Admin-Page-Rule

 

17. Consider Cloudflare’s APO

Cloudflare tested their APO on 500 sites and found on average, it improved TTFB by 90ms. This servers your entire site from Cloudflare’s edge network. It’s $5/month but worth testing if you have a slow TTFB. Make sure it’s compatible with your cache plugin since it’s not in WP Rocket.

Cloudflare Automatic Platform Optimization for WordPress

Cloudflare APO TTFB FCP SI

 

18. Use A Faster 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

 

 

19. Disable Data Sharing In Plugins

Sorry plugin developers, but if any plugins ever ask you to share your data, disabling it will slightly reduce CPU usage since your server won’t need to send the data to plugin developers.

Disable plugin data sharing

 

20. Limit Post Revisions + Autosaves

By default, WordPress doesn’t limit post revisions and the autosave interval is frequent (1 minute). Decreasing post revisions (backups of your old posts) and increasing the autosave interval (i.e. 5 minutes) can slightly reduce CPU usage and prevent a boated database. You can do both of these using Perfmatters or by adding the following code to your wp-config.php file.

Limit post revisions autosaves

define('WP_POST_REVISIONS', 5);
define('AUTOSAVE_INTERVAL', 300); // seconds

 

21. Replace WordPress Cron With Real Cron Jobs

The WordPress cron is executed every time a page is loaded and is often a target of DOS attacks. By replacing it with a real cron job, you can also schedule intervals and save resources.

In most cases, you’ll open the wp-config.php file and add a line of code to disable WordPress cron. Then you will add the second line of code to the cron job section in your hosting account.

define('DISABLE_WP_CRON', true);
cd /path/to/your/wordpress; wp cron event run --due-now >/dev/null 2>&1

SiteGround Cron Job

 

Retest Your Server Response Time (TTFB)

Once you’ve made all the changes from this guide, retest your TTFB and hopefully it’s faster.

OMM GTmetrix 2021

 

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 best 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 WP Speed Matters 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.

22 thoughts on “How To Reduce Server Response Times (TTFB) In WordPress: Preferably Under 200ms – Lighthouse + PageSpeed Insights Item

  1. Thank you for the great information. Server issue cannot be fixed completely (for me), but I agree hosting effects a lot. I am too getting server response time of 0.65sec and I think this is due to the hosting provider.

  2. Thank you for the great information. Server issue cannot be fixed completely (for me), but I agree hosting effects a lot. I am too getting server response time of 0.65sec and I think this is due to the hosting provider.

  3. Thank you so much .. This is one of the definitive and most complete guides about wordpress sites which is informative and very useful.

  4. Hi Tom,

    I checked onlinemediamasters in the page speed tools. The score is outstanding!
    My client has hosted his site with digitalocean already. The site speed is low and one of the reasons is slow server response time.
    This post is eye-opening in many ways.
    Should I suggest my client to change his hosting provider? Cloudways charges twice the price of the digital ocean.
    Will this change over show the results?
    Thanks.

    1. Hey Siva,

      If your client is a good server admin, you can stay with DigitalOcean. If your client doesn’t do those tasks, I would personally switch to them. Cloudways is basically the middleman that takes care of the server maintenance, that’s why they’re double the price. I’m not sure of your client’s current server setup, but I would think that it would fix the slow server response time especially if they haven’t been maintaining the server. Also, make sure to use PHP 7.3, Maria DB 10.3 (if possible), and increase memory limit to 256MB in the Cloudways dashboard.

  5. Thank you! I’ve been wondering how to speed up my site and after going through each step here, it is unbelievably faster! I haven’t made the hosting switch from Bluehost to Siteground but I will be planning on it in the near future!

    Thanks for the help!

    1. Any time Nicole! SiteGround and Cloudways are both good but it also depends on what you’re looking for in a host. Feel free to shoot me an email and I’ll try to point you in the right direction. But yes, Bluehost isn’t great.

  6. This was excellent!
    I use SiteGround middle plan and have consistently scored 100 on speed page and get metric.
    Just few days ago, SiteGround is showing 96 -99 ( reduce server response)
    Wondering if go geek would get it back up there again?
    Howard

    1. It could, how’s your overall load time? Have you done everything else (eg. from my full WordPress speed guide)? But yes, server response time is mostly from your hosting, upgrading almost always helps.

Leave a Reply

Your email address will not be published.