Google PageSpeed Insights tool shows many recommendations for improving the page loading time of a website. For WordPress site, you can easily fix most of the issues with the help of plugins. However, fixing certain issues like “Reduce initial server response time” needs a better understanding of how WordPress works and other external factors affecting your site loading time. If you are struggling with this issue, here is a complete guide to fix reduce initial server response time in WordPress.
What is Initial Server Response Time?
When you open a webpage, browser sends a request to your web server. After receiving the request, server checks the correctness and sends a response back with a proper HTTP status code. In this process, the time taken between opening a webpage and the first byte of response received from a server is called Time to First Byte or TTFB.
Google measures this TTFB as a performance metrics since delayed response from server can annoy the user and affect the experience. When TTFB is longer, you will see the warning “Reduce initial server response time” under “Opportunities” section as shown below.
You can find the actual response time from your server in seconds and suggestion to reduce the time under the recommendation.
Why You Should Fix this Issue?
Server response time is something you should consider improving regardless of whether it is showing in Google PSI or not. Slow initial server response essentially means that the content on the page is not loading for long time after the user initiated the request through browser. Due to this delay, users may leave your site causing potential revenue loss to you. Hence, you need to fix slow server response to retain the user on your site and offer good user experience. Remember, happy users can potentially become your long term paying customers.
Fixing Slow Initial Server Response Time
Earlier, the guidance was to have less than 200 milliseconds response time while the Google PSI audit will still pass if TTFB is lower than 600 milliseconds. However, this is not directly applied when calculating Core Web Vitals score with the latest Lighthouse version used in Google PSI. As you can see in the above image, it affects two metrics in Google PSI – FCP and LCP. These are First Contentful Paint (FCP) and (Largest Contentful Paint).
Here is what Google says about the best TTFB score on the official page:
Due to the wide variation of network and application backend stacks, an arbitrary number can’t be placed on what consists of a “good” TTFB score. Because TTFB precedes user-centric metrics such as First Contentful Paint (FCP) and Largest Contentful Paint (LCP), it’s recommended that your server responds to navigation requests quickly enough so that the 75th percentile of users experience an FCP within the “good” threshold.Google
The FCP threshold is 1.8 seconds for 75th percentile separately measured for desktop and mobile devices. On other hand, LCP metrics is used for Core Web Vitals and hence this issue can directly affect your search ranking visibility.
Keeping this complex stuff away, you can simply focus on reducing TTFB below 600ms. Once this is done, you will see the audit passes and the message moves under “Passed Audits” section with green bullet.
How to Fix Reduce Initial Server Response Time Issue in WordPress?
You can click on the “Learn more” link showing in Google PageSpeed Insights tool to get an idea of the issue and the suggestions for fixing. However, it may not be a quick fix like how you can fix other issues like enable text compression, reduce total blocking time or unused CSS/JS. Below is the image from Google’s TTFB page indicating the components involved in TTFB from the request to receiving first byte of response.
As you can see, there are multiple factors like redirects, DNS and caching can affect the TTFB and result in slow initial server response time. Based on this input, let us explain some basic stuffs you have to look for fixing reduce initial server response time issue in WordPress to improve the TTFB.
1. Quality Hosting
As the warning message indicates, server response time depends on the quality of your hosting company. Do not expect to get <600ms response time when using shared hosting services from Bluehost or HostGator. Even when you have a small blog, these servers are shared across multiple websites and hence will respond slowly. If you are determined to have a good website, then upgrade your hosting plan in which you get sufficient server resources.
The best way is to check the server usage dashboard in your hosting panel to understand the current situation.
- Check how many CPUs are used and how many more can help you to handle the traffic.
- Find the RAM usage to understand how your server handles the traffic spike and how many GBs you need to increase.
In summary, you need to go for managed WordPress hosting companies like WPEngine or Kinsta. Alternatively, you can use VPS or dedicated servers with any hosting company to dynamically allocate resources for your need. For example, we use Cloud VPS hosting with SiteGround with autoscale feature to dynamically increase CPU and RAM.
2. Use CDN
Having a premium quality hosting service will not be simply sufficient to fix “Reduce initial server response time” warning in Google PSI. In fact, the above screenshot of warning is from this website which we host on Cloud VPS. The reason is simple – network latency affects the server response time. The origin sever of this site is located in United States but we did the testing from India using VPN. The warning message will not appear if we check the Google PSI tool from US.
That’s being said, obviously user’s location will affect the server’s response time. The solution is to use Content Delivery Network (CDN) to deliver the content from the nearest location of the user. This will help you in reducing the load on origin server as well as reduce the TTFB thus increasing the server response time. Most hosting companies offer free Cloudflare CDN integration. Or you can connect your WordPress site to Cloudflare by creating an account and change the DNS nameservers. If you do not like to change nameservers, try CNAME setup with StackPath, BunnyCDN or similar services.
Note: Tools like GTmetrix will explicitly shows to use a CDN while Google PSI will not detect this.
3. Use Dedicated Private DNS
DNS comes as part of you hosting service and generally use the common nameservers provided by the company. Though this will work fine, you can always go for a dedicated IP and private DNS setup. This will help to propagate through the network of servers and reduce the DNS lookup time considerably.
- Go to Pingdom speed test tool and test any page on your site.
- After the test finished, scroll down and check under “File Requests” section.
- You will see a waterfall chart with different colors or each item loaded on your site.
- Hover over the first item, which should be your URL to see breakup of time taken from the request till response.
- Check the time taken for DNS and make sure it is lowest as possible in few milliseconds.
As you can see the “Wait” time is too high causing delay in page loading. In this case, it is a clear indication of problem with the response from the server and not with DNS or TLS connection.
4. Avoid Multiple Redirects
Another issue with delayed response is having multiple redirects before reaching the final requested page. For example, you might have migrated from another platform with .html page extension to WordPress and then changed the slug of a page two times to setup 301 redirects. In this case, someone trying to access your old .html page will be redirected three times before the request reaches the final and correct resource on the server. We have migrated our site from Weebly to WordPress more than five years back and still receive hits from the old Weebly URL. This is due to the reason that many websites linked old URLs at that time and we can’t change those external URLs pointing to our site.
Though you can’t change the externally linked URLs, here are some of the ways you can avoid multiple redirects in WordPress.
- Avoid updating the slug (which will change URL), instead only the title of the page. For example, many users recycle the content by updating the year in the slug like “Top 10 WordPress Plugins for 2021” to “Top 10 WordPress Plugins for 2022”. In this case, you can only change the title of the page and keep the slug as common as “Top 10 WordPress Plugins”. Since URLs do not have direct SEO impact, this will not affect your ranking in search results.
- Do not change the permalink once set. Also, do not change the setup for adding or removing category in the URL.
- When you have to change the slug multiple times, make sure to update all old URLs to the latest URL. This can help to connect with single redirect instead of looping multiple times.
5. Check Your Plugins
In 99% of cases, using quality hosting with CDN will fix reduce initial server response time warning in Google PSI (especially if you have new site without redirect issues). If not, it’s time to audit your website setup by checking the plugins you installed on your site. Some plugins will create complex database query and take long time for retrieving the data from your database. Since these queries are dynamic in nature, CDN will not help much as it is only used for caching static resources like images, CSS and JS files.
The best example is using popular post plugin to show content recommendation below the article. It may work well when you have a smaller site but will fail with long database query when you have larger database. It will considerably slow the TTFB when the plugin needs to pull related content from thousands of posts and this has to happen dynamically each time the user loads the page.
Due to this fact, hosting companies like WPEngine does not allow query intensive plugins that slow down the server. You may need to disable the plugins one by one and find which one is causing the issue for your site. Alternatively, you can use Query Monitor plugin and monitor the response time from your dashboard to find which request takes longer time. Once you identified the culprit plugin, simply delete it from your site and use better replacement.
Here are some types of plugins that you should avoid in WordPress:
- Using page builder plugins for posts, make sure to use page builder only for pages.
- Related and popular posts plugins.
- WooCommerce on shared hosting.
Other example of heavy plugins include page builder plugins and WooCommerce.
6. Check Your Theme
Next thing to optimize is your theme. We strongly recommend using minimalist themes like GeneratePress or Astra. You can get all needed features with these themes and install a plugin when you need additional features. Besides slow initial server response time, you can find some indications when you have a slow theme.
- Query Monitor plugin shows the theme files are taking too long time to load.
- Theme not updated frequently and does not support the latest PHP or WordPress version.
- Bundled with large number of plugins which do not use on the site.
If you find any of the symptoms with your theme, then it is high time to consider changing the theme.
7. Clean Your Database
Over period, WordPress accumulates plenty of stuffs in the database. These stored options in database may load on the page, even though you do not need and affect the loading time. Though you can cleanup some of the items, you may need a professional SQL developer to completely cleanup the junk. Here are some of the ways to avoid accumulating junk in your database.
- Schedule database cleanup with WP Optimize or any similar plugin to delete post revisions, autosaves and spam comments. Hosting companies like SiteGround offers custom plugins (SiteGround Optimizer) which you can use for this purpose.
- Avoid installing unnecessary plugins and delete the database tables related to those plugins that you have already deleted. For example, if you use WP Rocket plugin for used CSS generation, you need to delete the table in database where it stores huge CSS while deleting the plugin from your site.
- Search and delete all unused custom fields stored in wp_options and wp_postmeta tables.
- Avoid using a theme or plugin that adds meta box with custom fields. Each value for the custom field you add in the post meta box will be stored in the database and needs to be retrieved during page loading. This can intensify the database query and delay the content loading.
8. Use Optimized Caching Solution
If you have a CDN setup, it is possible to enable minify and combine CSS and JS at CDN server level. However, using a strong caching plugin like WP Rocket can help you in complete level of optimization. You can get page level caching, browser caching, lazy loading and integrate CDN to super charge the loading of your pages. If your hosting company offers a caching plugin or server level caching, make sure to use that option.
9. Disable Heartbeat API
Heartbeat API is a real-time service to call the server and get updates for you. For example, you can have a WooCommerce sales widget in your WordPress dashboard section to monitor the sales in your online store. However, this can slow down your site by sending frequent AJAX calls to your server and not required if you do not have to monitor real-time statistics.
10. Update WordPress, PHP, Themes and Plugins
PHP updates bring a big speed boost by optimizing the code level performance. Therefore, make sure to update to the latest PHP version to reduce slow server response time and improve TTFB. WordPress always supports the latest stable PHP version; hence you have to keep the WordPress core to the latest version to make use of the PHP benefits.
You may face problems with theme or plugin that do not support the latest PHP version. We recommend monitoring the status with your developer and consider a switch if the developer do not have plan to update regularly.
11. PHP Memory, Execution Time and Service Workers
Since WordPress needs to run PHP files to get the content from your database, it needs sufficient memory and execution time set in the server configuration. Otherwise, it will affect the performance by delaying the response. Therefore, you have to consider few PHP factors when purchasing a hosting plan. Unfortunately, most of the hosting companies do not declare the limits on the sales page. Since most of the commercial WordPress themes need higher PHP resources to work properly, you need to configure the server properly to reduce the response time. For example, below is the system status warning in a minimalist Breek theme, showing the server limits are not sufficient.
Make sure the following PHP related stuffs are sufficient for your server, otherwise discuss with your host to increase the capacity to improve TTFB.
- Host supports latest PHP version.
- Allow changing PHP memory limit to custom level needed by you. In general, you may need 256M depending on the resources needed for your site.
- Default maximum PHP execution time limit is 30 seconds in most hosting companies. This will not work when you need to run a PHP script for 120 or 300 seconds.
- Allowed PHP workers for handling requests.
Below is the pricing plan page from Kinsta indicating the supported PHP version and the PHP workers available for each plan. If your hosting company does not offer your sufficient details, contact them to know the situation and the possibilities of increasing the limits.
12. Reduce Third-Party Code
In our earlier article, we have explained the way to delay third-party code loading to make the total blocking time to zero. Using too much third-party code like Google AdSense advertisements will considerably delay the page loading time regardless of your hosting and theme/plugins quality. This is a kind of trade-off between revenue Vs speed and you have to choose one depending on your need. If you are focusing on speed, then use plugins like Flying Scripts, Perfmatters or WP Rocket to delay the loading of third-party codes on your site to improve the TTFB.
As you can see, there are too many factors that could affect slow server response time in WordPress. For a normal WordPress blog without online store or complex theme, having a quality hosting, CDN and caching plugin are sufficient to improve TTFB and fix slow initial server response time.