How To Speed Up Your Slow HostGator Website In 15 Steps (But Their Hosting Is Notoriously Slow And I Suggest Leaving)

Slow hostgator website

Have a slow WordPress site on HostGator?

To check if HostGator is the problem, test your server response time (TTFB) in KeyCDN. Google flags your TTFB if it’s over 600ms, but <200ms is ideal. TTFB is directly related to hosting speed.

The fact is, HostGator is notoriously slow. They’re cheap shared hosting with slow technology (Apache servers, SATA SSDs, no cache plugin/CDN and very minimal CPU/RAM with CPU limits).

While I never recommend using HostGator, this guide should help improve your load time and core web vitals. However, I recommend looking at alternatives like NameHero (similarly priced with cPanel but faster with LiteSpeed and 3 CPU + 3GB RAM). Or Rocket.net if you have $25/mo which is no comparison with 32 CPU + 128GB RAM, NVMe, Redis, and free Cloudflare Enterprise.

Benchmark your scores + load time in your favorite tool and let’s get started (PageSpeed Insights is good but the Chrome UX report does take a while to update once you make changes).

Feel free to leave me a comment with questions.

 

1. Check For A Slow TTFB

Run your site through SpeedVitals which measures TTFB in 35 global locations. Test your site 3 separate times to make sure your caching/CDN are working properly in the test, then view your average TTFB worldwide of your 3rd test (screenshot below). It should ideally be under 600ms.

This is an easy way to check whether your hosting is the problem, but CDNs also play a big factor especially with full page caching. You’ll want to setup Cloudflare (and ideally Cloudflare’s APO) if you want to improve this. However, HostGator’s slow servers obviously don’t help either.

Omm ttfb speedvitals 1

Hostgator garbage and cloudways

Bluehost hostgator godaddy worst choices

WP Hosting Benchmark also tells you if your hosting sucks. Here’s mine:

Wp hosting benchmark tool

 

2. Move Your DNS To Cloudflare

If you bought your domain through HostGator, you’re using them for your DNS. dnsperf.com shows the performance of popular DNS providers and HostGator is definitely not one of them (they’re not even listed). Their slow DNS causes latency which is also part of TTFB. Cloudflare’s DNS is not only one of the most consistently performant providers on dnsperf.com, but it’s free.

Step 1: Sign up for Cloudflare, add your site, and you’re prompted to change nameservers.

Change hostgator nameservers cloudflare

Step 2: Login to your HostGator account and change nameservers to Cloudflare’s:

Hostgator change nameservers

 

3. Configure Cloudflare’s CDN And Dashboard

Once you’ve changed nameservers in Cloudflare, you have access to their dashboard.

There are several things you can tweak to improve speed/security (listed below), but the main thing is to activate Cloudflare’s CDN. To do this, head to your DNS settings, locate your website, and turn the cloud from DNS only to “Proxied.” Cloudflare’s CDN has one of the largest networks of 250+ data centers with features to improve speed/TTFB. If you decide to leave HostGator, it’s worth checking out hosts with Cloudflare Enterprise like Rocket.net or Cloudways since you get Enterprise features like prioritized routing, Argo, image optimization, WAF, and load balancing.

Cloudflare speed dashboard
Go through the left tabs and tweak you Cloudflare settings

  • Monitor your bandwidth – in your Analytics settings → Traffic → Bandwidth, you’ll see how much bandwidth you’re offloading to Cloudflare (more is better).
  • CDN – in your DNS settings, find your domain in the DNS manager and change the proxy status from DNS Only to Proxied (orange cloud). This activates Cloudflare’s CDN which is performant on cdnperf.com and is needed for other features to work.
  • TLS version – in your SSL settings → Edge Certificates, set min. TLS version to 1.2.
  • Bot fight mode – blocking bad bots from hitting your server saves resources. You can either use Cloudflare to do it or the Blackhole For Bad Bots plugin is good too.
  • HTTP/3 – turn this on to enable HTTP/3 which is significantly faster than HTTP/2.
  • 0-RTT Connection Resumption – good for repeat visitors, latency, mobile speed.
  • Firewall rules – in your Security settings → Firewall rules, create rules to block access to wp-login, XML-RPC, and even block “spammy” countries. These block unwanted requests to the server and free up resources for more important things.
  • Bot protection – in your Security settings → Bots, enable bot fight mode to block spammy bots from hitting your servers. “Good bots” like Google won’t be blocked.
  • Early hints – in your Speed settings → Optimization, enable early hints to cut down on server wait time. You will also find several paid features here that can significantly speed up your site such as APO, image optimizations (which almost always do a better job than plugins), and SXGs to improve LCP in core web vitals.
  • Browser cache TTL – in your Caching settings → Configuration, set the browser cache TTL to 1 year for static sites (my blog is mostly static so this is what I use) or 1 month for dynamic (eCommerce) sites. This is recommended by Google and can fix “serve static assets with an efficient cache policy” found in PageSpeed Insights.
  • Crawler hints – in the same setting, enable crawler hints to help Google and other search engines time their crawling more efficiently to save resource consumption.
  • Cache everything – in Rules → Page Rules, you can use a page rule to cache everything (HTML) which improves TTFB. But instead of creating a page rule, I recommend using the Super Page Cache for Cloudflare plugin, or pay for APO.
  • Hotlink protection – in your Scape Shield settings, enable hotlink protection which stops people from copying your images and using them on their website when they’re still hosted on your server. This can save quite a bit of bandwidth.
  • SXGs (signed exchanges) – speeds up your site when someone clicks your result in Google by prefetching content which leads to faster rendering (can help LCP).
  • Cloudflare Enterprise – some hosts include Cloudflare Enterprise which is much faster than the free version of Cloudflare since it includes paid features like image optimization, WAF, prioritized routing, and Argo + Tiered Cache. If you’re open to changing hosts, I suggest Rocket.net who is faster than Cloudways/Kinsta. Or use FlyingProxy. Either of these should be faster than configuring Cloudflare yourself.

Cloudflare cdn proxy
Activate Cloudflare’s CDN in the DNS settings

 

4. Configure A Top Rated Cache Plugin

Which cache plugin you use and how you configure the settings has a huge impact on scores as well as real-world browsing speed.

Most people recommend WP Rocket because of affiliate commissions. But if you compare features, FlyingPress (and LiteSpeed Cache) are both significantly better. FlyingPress can be used with any host, so that’s the one I recommend using on HostGator, while LiteSpeed Cache requires you to use a LiteSpeed host. I switched from WP Rocket to FlyingPress and saw a major improvement (they also have a Facebook Group run by the developer, Gijo). Just make sure you use my recommended FlyingPress settings for best results. I also have a tutorial for WP Rocket.

WP Rocket FlyingPress
Remove unused CSS Inline Separate file
Host fonts locally x
Preload critical images x
Fetchpriority resource hint x
Lazy render HTML elements x
Lazy load background images Inline Helper class
Exclude above the fold images By URL By number
Self-host YouTube placeholder x
CDN (beyond Cloudflare) StackPath BunnyCDN
CDN PoPs 60 114
CDN Tbps 65 80
CDN geo-replication x
CDN image optimization x
CDN image resizing for mobile x

HostGator has  an option to enable cache in the cPanel which you should leave disabled if you’re using a cache plugin. Cache plugins take care of many other optimizations other than caching (minifying HTML, CSS, JS) and you should get much better results with a cache plugin.

Hostgator caching

 

5. Stop Using Page Builders

Elementor, Divi, and Fusion Builder (Avada) add extra CSS/JS to your site which can flag multiple items in PageSpeed Insights.

Gutenberg is much faster when used with GeneratePress (what I switched to) or Blocksy/Kadence. Oxygen Builder is also good but is usually a steeper learning curve.

Fastest wordpress themes

Want to see how much your page builder is slowing down your site? Open your Chrome Dev Tools coverage report to find out. Not to mention all those extra page builder plugins you add on top of it also slows it down. It’s best to avoid these all together and I was actually able to eliminate 2 plugins by switching to Gutenberg since I now use their blocks for tables/galleries.

Elementor css

Trust me, I’ve done it and the “drag and drop” feature isn’t worth it.

Elementor source code

Combining page builders with HostGator’s shared hosting is a recipe for disaster.

 

6. Avoid Slow Loading Plugins

Besides the obvious “use lightweight plugins” recommendation, here are a few more tips:

  • Avoid common slow plugins.
  • Find your slowest plugins using Query Monitor.
  • Consolidate plugins and replace them with code.
  • Delay plugins if their content loads below the fold.
  • Disable plugin settings adding database bloat (check using WP-Optimize).
  • Disable plugin settings that run background tasks which increases CPU usage.
  • Disable plugins from specific pages/posts using Perfmatters (what I use) or Asset CleanUp.
Plugin Category Memory Impact PageSpeed Impact
All In One SEO SEO x x
Broken Link Checker SEO x
Disqus Comments x
Divi Builder Page Builder x x
Elementor Page Builder x x
Elementor Premium Addons Page Builder x
Elementor Pro Page Builder x x
Elementor Ultimate Addons Page Builder x
JetElements Page Builder x x
Jetpack Security x x
NextGEN Gallery Gallery x x
Popup Builder Popup x x
Site Kit by Google Analytics x
Slider Revolution Slider x x
Social Media Share Buttons Social Sharing x
WooCommerce WooCommerce x x
Wordfence Security x
wpDiscuz Comments x x
WPML Translate x x
Yoast SEO SEO x
Slow wordpress plugins query monitor
Find slow plugins in Query Monitor
Disable social sharing plugins perfmatters
Disable plugins where they don’t need to load in Perfmatters

 

7. Optimize Images

These are the 7 image optimization recommendations in PageSpeed Insights:

Image optimization pagespeed insights

  • Properly size images: resize large images to be smaller.
  • Defer offscreen images: lazy load them (i.e. in your cache plugin).
  • Efficiently encode images: compress images (I prefer doing this with a CDN).
  • Serve images in next-gen formats: serve images in WebP using a plugin or CDN.
  • Preload largest contentful paint image – all above the fold images should generally be preloaded and excluded from lazy load as well. The easiest way is in FlyingPress or Perfmatters using the preload critical images setting where you set a number of images typically shown above the fold (usually 2-3). See image below.
  • Use explicit width/height: add a width and height to the image’s HTML or CSS.

Above the fold images
Optimizing above the fold images is especially important for improving LCP

 

8. Optimize Fonts

Check your GTmetrix Waterfall report to see all your font files and how long they take to load.

The first thing I always look at is whether they’re served locally from your domain. If they’re served from a third-party resource like fonts.gstatic.com, you want to host them locally which you can do in Elementor, Perfmatters, or the OMGF plugin. Hosting fonts locally is always faster.

Local vs third party fonts

The next step is to reduce the number of font families, weights, and icons. You should ideally only have a few font requests (maybe around 4-5) and that you’re only loading fonts actually being used on your site. This includes font icons. Several page builders like Elementor/Divi also have built-in optimizations for fonts in their performance settings (most can load them inline).

Next, if you see ensure text remains visible during webfont load in your PageSpeed Insights report, this means you need to change the font-display property to “swap.” Again, Elementor and many cache/optimization plugins have a setting for it (or manually add it to  your font files).

Elementor google fonts swap

The last step is to preload fonts. Copy font files from your GTmetrix Waterfall chart and test preloading them (almost all cache plugins do this, you can do it manually, or use the Pre* Party Resource Hints plugin). You should usually preload all fonts loading above the fold, but make sure to test each one since preloading too many resources can actually have a negative impact.

Preload font perfmatters

 

9. Reduce CSS/JS File Sizes

Multiple PageSpeed items are related to CSS/JS files (how large they are and whether they’re optimized).

Nothing beats lightweight themes/plugins and I’d say it’s 90% of people’s problem if you look at your Chrome Dev Tools coverage report. However, third-party code can also add JavaScript (which is why you should host it locally if possible and delay it in cache plugins or Perfmatters).

Page builders have built-in settings to optimize CSS/JS, like Elementor Experiments. And if you must use a page builder, make sure you hard code your header/footer/sidebar in CSS instead of building these in your bloated page builder code (trust me, this should make a huge difference).

The remove unused CSS feature (found in many cache plugins) should either be done in FlyingPress, LiteSpeed Cache, or Perfmatters. The reason is because these plugins load used CSS in a separate file which is faster than loading it inline (like WP Rocket does). This is one of many reasons why WP Rocket is actually inferior to other optimization plugins like FlyingPress.

Wp rocket used css
Both Perfmatters and Vikas agree the “external file” method is faster for real visitors

Cache plugins have additional settings to optimize CSS/JS like minification, combination (although I usually don’t recommend combining), deferring/delaying JavaScript, and replacing YouTube iframes with a preview image (which prevents CSS from YouTube loading on your site).

You can also try preloading Gutenberg’s CSS (or disabling it if you don’t use it), and same with jQuery. If you’re already using the Perfmatters script manager, go to your script manager settings and turn “display dependencies.” Then when viewing your script manager, you can see all plugins that rely on jQuery (it can be a long process, but try to remove as many as possible).

Jquery plugin dependencies 1

I have more in-depth tutorials on reducing CSS and JavaScript, but that’s the gist.

 

10. Optimize Third-Party Code

PageSpeed Insights shows all third party code loading on your site as well as their domains (Google Fonts, Analytics, Maps, AdSense, embedded YouTube videos, Gravatars, and social media sites caused by things like social sharing plugins or Facebook Pixel are fairly common).

Overtracking is the most common bottleneck I see. Do you really need to use Google Analytics, Tag Manager, Heatmaps, or other tracking scripts? It’s not realistic for most sites, but I only use Search Console which is all the SEO data I care for (I just look at each page’s rankings over time).

Some third-party code can be hosted locally (Google Fonts, Analytics, and even YouTube thumbnails to eliminate requests from i.ytimg.com). Always host files locally if it’s possible.

In general, third-party code that can’t be removed or hosted locally should be delayed. Check your cache plugin’s documentation on how to delay JavaScript or use the Flying Scripts plugin.

The are also miscellaneous ways to optimize third-party code like using a smaller GA tracking code (using Flying Analytics or Perfmatters), local avatars, replacing YouTube iframes with a preview image, not loading a Google Map in the footer, and using a lightweight social sharing plugin (while using Perfmatters to disable it where it doesn’t load). Some Cloudflare features also add a tiny piece of JavaScript like email obfuscation, bot fight mode, and Rocket Loader.

Reduce impact of third party code wordpress 5

 

11. Remove WordPress Bloat

By “bloat” I really mean cleaning up your admin and disabling background processes like Heartbeat, autosaves, post revisions, etc. Here’s a short and sweet list of bloat removal plugins:

  • Unbloater
  • Perfmatters
  • Widget Disable
  • Disable WooCommerce Bloat

Unbloater plugin

 

12. Clean Your Database

WP-Optimize does a better job cleaning your database than cache plugins because:

  • It lets you remove tables left behind by old plugins
  • It lets schedule cleanups while taking an UpdraftPlus backup
  • It lets you keep a certain number of post revisions (not delete them all)

Wp optimize unused database tables

 

13. Reduce LCP By Focusing On Above The Fold Content

Largest contentful paint is the core web vital people struggle with most.

Keep in mind TTFB is 40% of LCP which is mainly related to your hosting/CDN. However, the other 60% is mostly related to how long above the fold content takes to load (images, script, styles… everything else).

Many recommendations in this guide should improve LCP, but you should also try lazy rendering HTML elements (in FlyingPress), deferring JavaScript, and trying Cloudflare Workers (which is more advanced). Or even moving heavy elements below the fold and delaying them.

Largest contentful paint wordpress

 

14. Use Tools To Find Bottlenecks

I’ve mentioned many tools in this guide to help find bottlenecks, but are the ones I think are most important:

  • Query Monitor
  • WP Hosting Benchmarks
  • Speed Vitals (and their TTFB test)
  • Coverage report (in Chrome Dev Tools)
  • Waterfall charts (in GTmetrix, Chrome Dev Tools, etc)

People say it’s easy to get good scores with a small page size, but getting a small page size is optimizing your site. Switching themes, reducing plugins, and scaling images all takes work!

Speedvitals omm

 

15. Leave HostGator

If you went through this guide and your site is still slow (or you just have a slow TTFB), leave HostGator. I recommend doing this anyway since their hosting is honestly bottom of the barrel. I’m damn honest if you read my hosting reviews. TLDR: stay clear of most mainstream hosts.

Rocket.net is who I use with their free Cloudflare Enterprise which is $25/mo when paying yearly, or you can use this coupon to get $1 your first month. But I can pretty much guarantee it will make your site, core web vitals, and browsing speed night and day. All their plans have a whopping 32 CPU + 128GB RAM + NVMe, Redis, LiteSpeed’s PHP, and full page caching. They also don’t limit PHP workers (CPU limits) which most hosts use to force you to upgrade. I could list plenty of other reasons why they’re better (than everyone), but you can read my full review.

Rocket. Net 1

If that’s too much, NameHero is similarly priced but still miles ahead of HostGator. They use LiteSpeed servers (which means you can use the LiteSpeed Cache plugin). When setting up LiteSpeed Cache, I recommend testing out QUIC.cloud’s CDN which is arguably one of the best WordPress CDNs (aside from Cloudflare Enterprise). I would use their Turbo Cloud plan since you get 3 CPU + 3GB RAM + NVMe storage (faster than HostGator’s SATA SSDs) for about $8/mo. Plus, their support/uptimes are much better and they use cPanel. They also do free migrations.

Namehero 1 litespeed

Cloudways Vultr High Frequency is another option and popular in Facebook Groups. They’re who I used before Rocket.net (you can see what happened when I migrated from SiteGround). It’s cloud hosting + NVMe storage + Redis Object Cache Pro which is a great setup. However, it’s a little more “techie” than Rocket.net/NameHero since you have to launch a server (it’s really not hard though) and there are lots of settings in the dashboard. They also have a Cloudflare Enterprise add-on, but it costs $5/month and doesn’t have full page caching like Rocket.net’s.

Cloudways vultr high frequency discount

Here’s what the setups look like:

Hosting Cache Plugin CDN Email Hosting Total (Monthly)
Rocket.net ($25/mo) FlyingPress ($42/year) Cloudflare Enterprise (Free) Google Workspace ($6/mo) $34.5
Cloudways Vultr HF ($13/mo) FlyingPress ($42/year) Cloudflare Enterprise ($5/mo) Google Workspace ($6/mo) $27.5
NameHero ($7.38/mo) LiteSpeed Cache (Free) QUIC.cloud (free plan) Included $7.38

Any of these are wayyy faster than HostGator (it really just comes down to your budget). But whether you take my hosting recommendations or not, do yourself a favor. Leave HostGator.

Why is my HostGator website slow?

HostGator's servers are notoriously slow and overcrowded which leads to a slow TTFB (time to first byte). If you're using a cheap shared hosting plan, don't expect a fast website.

How do I fix a slow website on HostGator?

To speed up your website on HostGator, setup Cloudflare's CDN and configure the dashboard. Optimize your theme, plugins, cache plugin, images, fonts, and third-party code. Using the right tools and settings is critical to site speed.

Cheers,
Tom

You Might Also Like:

25 Comments...

    • Better off reading this. HostGator’s lack of resources doesn’t help but it could be from plugins, no object cache/OPcache, not offloading bandwidth to CDNs (including full page caching), database bloat, too much preloading/automatic cache clearing in cache plugins, etc.

      Reply
  1. Don’t use Hostgator, I’ve tried them and they are the worst! My site was fresh, just installed the Astra theme, no plugins, no images, just the theme. My site scored less than 20 in pagespeed insights. Plus I had a hard time customizing my site because my WordPress backend was so slow like it took around 30 seconds just to switch pages, no exaggeration.

    Reply

Leave a Comment