WordPress site running slow on HostGator?
HostGator was rated the 23th host in this Facebook poll (and #44th in last year’s poll) and is known for being 1 thing – cheap. They’re owned by EIG who is infamous for acquiring hosting companies and cutting costs by packing too many people on one sever, making them incredibly slow. You can find this out first hand… run your site through Google PageSpeed Insights and to see if ‘reduce server response time‘ is in your report. You can also run your site through bytecheck.com to see your TTFB (time to first byte) which measures server response time.
So while I’ll show you how to improve scores/load times in Pingdom and other speed testing tools, you may want to consider switching hosts if you want a faster site. I use SiteGround who was #1 in that poll, my site loads in .5s in Pingdom and .5s in GTmetrix, and SiteGround will migrate you for free. Fast hosting is the #1 factor in the WordPress optimization guide so it’s kind of important. Leave me a comment if you have any questions… I’m glad to help you out.
We will use multiple speed testing tools throughout this tutorial (Pingdom, GTmetrix, Google PageSpeed Insights) since each tool helps in different areas of speed optimization.
This video should help (timestamps are in the video description):
1. Check Your Server Response Time
This happens with many HostGator sites…
You can also check TTFB in the GTmetrix Timings tab…
Slow response times? Do yourself a favor and migrate to SiteGround. They are 10x better.
2. Upgrade To PHP 7
Most WordPress users are running outdated PHP versions when upgrading can make your site 2-3x faster. HostGator will not upgrade you automatically (because they don’t want to risk breaking your site) so you need to do this yourself as HostGator releases new PHP versions.
Step 1: Run the PHP Compatibility Checker plugin to make sure your plugins work with the newest PHP version. This is why you should use reliable plugins that are actively maintained.
Step 2: Go to your HostGator cPanel → Software → PHP Selector…
Step 3: Upgrade to the latest PHP version…
Step 4: Check your website for errors. If you see any, you can always downgrade to the PHP version you were using previously. Errors are likely caused by themes/plugins that are not updated frequently by the developer, so make sure you’re using reliable plugins and theme.
Step 5: Keep your PHP updated to the latest version. HostGator does an OK job in releasing new versions, however other hosting companies already have a stable version of PHP 7.2.9.
3. Configure A Cache Plugin (Ideally WP Rocket)
Your cache plugin and hosting are the 2 biggest speed factors in WordPress. This Facebook poll of top rated cache plugins is accurate and I wrote tutorials for all 3 (WP Rocket is definitely the way to go). This alone can help fix over 20 items in Pingdom/GTmetrix and will help tremendously when configured properly with Cloudflare (free) and StackPath ($10/month but definitely helps). Each cache plugin has options to use Cloudflare/StackPath.
- The Ideal WP Rocket Settings With Cloudflare + StackPath CDN Instructions
- The Ideal WP Fastest Cache Settings With Cloudflare + StackPath CDN Instructions
- The Ideal W3 Total Cache Settings With Cloudflare + StackPath CDN Instructions
- The Ideal WP Super Cache Settings With Cloudflare + StackPath CDN Instructions
Why WP Rocket Is Rated The #1 Cache Plugin
WP Rocket is better because it has more features than other cache plugins (lazy loading, database cleanup, hosting Google Anallytics code locally, and integration of Cloudflare + CDNs) which if you were to use another cache plugin, you would likely need to install 1 extra plugin for each of these features. WP Rocket has these built-in and for that reason, should give you better load times. It’s easy to setup, is updated frequently, and has less chance of errors.
Here’s a test I did in Pingdom…
WP Rocket (.406)
WP Fastest Cache (.527)
W3 Total Cache (.619)
Here’s a glimpse of the WP Rocket settings which are easy to configure…
Here’s a glimpse of the WP Fastest Cache settings which are also easy to configure…
The W3 Total Cache settings are more difficult to configure but I have a pre-configured zip file of the same settings I use which you can download in my tutorial, then upload to your plugin under General Settings → Import / Export Settings. Even though recommend using WP Rocket since it has more features, is less buggy and is updated frequently… a LOT of people have success with W3TC and my guide has been used by 250,000 people with over 500 comments.
4. Setup Cloudflare
Cloudflare is free and improves speed, security, and even spam protection. The most valuable part is their CDN which hosts your site on 150+ data centers and is a recommendation in the WordPress optimization guide but they also have Railgun + Rocket Loader to increase speed.
Cloudflare settings with WP Rocket…
Global API Key – click your name (top right in your Cloudflare account) and go to manage settings. Scroll down and you will see your global API key, then paste this into WP Rocket.
Cloudflare settings with W3 Total Cache (must first activate in the “extensions” tab)…
If this doesn’t work, here’s how to setup Cloudflare through HostGator…
1. Sign up for Cloudflare, add your website, run the scan…
2. Click ‘continue setup’ then scroll down and click ‘continue.’ Choose ‘free website’ then continue again. Cloudflare will provide you with 2 name servers…
3. HostGator says you will need to contact them to setup private nameservers…
4. Once they do, find them and enter the nameservers provided by Cloudflare…
5. Still in Cloudflare, go to your speed settings and use these…
6. Go to Cloudflare’s caching settings and Purge Individual Files → Purge Everything.
All done! It can 24 hour for Cloudflare name servers to propagate so be patient :)
5. Lazy Load Videos
Lazy load delays the loading of photos, videos, and iframes so they only load once you scroll down the page and see them. Videos are a heavy element so I suggest at least doing that – I don’t lazy load photos since it can be annoying to constantly load photos as you scroll down.
WP Rocket has an option for this in the media options…
6. Clean Your Database
You can do this in WP Rocket’s database tab (below), otherwise use the WP Optimize plugin. Backup your site if this is your first time doing this and schedule this for weekly or monthly.
7. Configure WP Disable
WP Disable lets you disable settings in WordPress that consume CPU and slow down your site. Simply go through the settings and disable anything you don’t use. Enabling heartbeat control, deleting spam, minimizing requests, and disabling Gravatars, pingbacks, and trackbacks should all help improve load times (and the speed of your WordPress admin panel).
Host Google Analytics Locally – on the right side of the WP Disable settings, enter your Google Analytics UA code. This should fix the “leverage browser caching” item for Google Analytics often seen in GTmetrix, Pingdom, and PageSpeed Insights. Be sure to delete ALL other tracking codes and Google Analytics plugins, and make sure GA is still tracking user data.
8. Avoid High CPU Plugins
- AdSense Click Fraud Monitoring
- Backup Buddy (use UpdraftPlus)
- Better WordPress Google XML Sitemaps (use Yoast)
- Broken link checker (use Dr. Link Check)
- Constant Contact for WordPress
- Contact Form 7 (load JS + stylesheet only when necessary)
- Contextual Related Posts
- Digi Auto Links
- Disqus Comment System (use Disqus Conditional Load)
- Divi Builder
- Essential Grid
- Fuzzy SEO Booster
- Google XML Sitemaps (use Yoast)
- NextGEN Gallery
- Reveal IDs
- Revolution Slider
- S2 member
- SEO Auto Links & Related Posts
- Similar Posts
- Slimstat Analytics
- Wordfence (disable live traffic reports)
- WordPress Facebook
- WordPress Related Posts
- WordPress Popular Posts
- WP Bakey (formerly Visual Composer)
- WP Statistics
- WP Power Stats
- Yet Another Related Post Plugin
- Yuzo Related Posts
9. Disable Plugin Settings You Don’t Use
Turn of ALL plugin settings you don’t use especially if you think they consume a lot of CPU. For example, in Yoast under Settings > General > Features I disabled all of the following…
Avoid Plugins That:
- Provide statistics
- Run ongoing scans
- Send admin or email notifications
- WP Rocket’s preload bot
- Wordfence’s live traffic reports
- Broken Link Checker’s ongoing scans
- Yoast’s settings under Dashboard > Features
- Chat and calendar plugins that run constantly
- Statistical plugins that constantly collect data
- Related post and popular post plugins that store tons of data
10. Resize Large Image (Serve Scaled Images)
You will find the “serve scaled images” item in your GTmetrix report which just means you need to resize large images to be smaller. GTmetrix will tell you which images need to be resized (and their correct dimensions) but ONLY for that page. That’s why I would start by fixing images that appear on multiple pages (like your logo, sidebar, and footer images) then run your most important pages through GTmetrix and optimize individual images on those.
Once you find oversized images in GTmetrix, resize them, reupload them, and replace the old images with the new ones. In the future it’s best to resize images to the correct dimensions BEFORE uploading them, which is why an “image dimension cheat sheet” can be very handy.
11. Losslessly Compress Images (With Imagify)
This is the “optimize images” item in GTmetrix. Imagify and Kraken are the best plugins for this… which are both are free until you hit a monthly limit. Other completely free plugins (with no limit) usually have bugs and can break images or just won’t do anything (trust me, I’ve done my research). Avoid plugins like WP Smush.it and EWWW Image Optimizer even if means paying for a $5 Imagify plan or waiting month-to-month for your 25MB Imagify limit to reset.
- Sign up for Imagify
- Install the Imagify plugin
- Paste your API key into the plugin
- Set your compression level (normal, aggressive, ultra), I use aggressive
- Go to media → bulk optimization and Imagif’em all
- If you reach the limit, pay $5 for a plan or wait until next month for it to reset
12. AMP (Accelerated Mobile Pages)
AMP Pages make your mobile pages load faster and adds an AMP stamp next to your mobile snippets. This is easy to do (it’s done through a plugin) but it will change the design of your mobile pages. You will basically use the AMP plugin to add the actual mobile pages, then the Glue for Yoast SEO & AMP plugin to customize the color of those new mobile AMP pages.
How To Add AMP Pages To WordPress
- Install the AMP plugin
- Install the Glue for Yoast SEO & AMP (if using Yoast)
- Add /amp/ to any page to see your new AMP pages
- Use the Glue for Yoast to customize the design of these pages
- Wait a few days for Google to update your mobile snippets
- Use Google Search Console’s AMP section to test for errors
13. Minimize Redirects
Means you changed the WWW or HTTP version of your site, but your links/images are still using the old version. You need to correct ALL these which can be done in bulk using the Better Search Replace plugin. Pingdom will only show you errors for that page, so test a few pages out in Pingdom to make sure you took care of all redirects throughout your website.
14. Setup StackPath’s CDN
Most cache plugins have an option to integrate StackPath which is $10/month with a free 30-day trial and 31 data centers. A CDN (content delivery network) hosts your website on multiple servers around the country/world which reduces the distance it takes for your content to reach your visitor. This can reduce load times by multiple seconds for visitors who (used to be) far from your 1 origin server. A CDN is also an item in your GTmetrix YSlow tab.
- How To Setup WP Rocket With StackPath
- How To Setup WP Fastest Cache With StackPath
- How To Setup W3 Total Cache With StackPath
Step 1: Sign up for StackPath and create a StackPath CDN site…
Step 2: Paste your StakPath CDN URL into your cache plugin (or use CDN Enabler)…
15. Avoid Google Maps + Advertisements
Google Maps and advertisements (eg. Adsense and other advertising networks) are notorious for slowing down WordPress sites since they require pulling heavy resources from external sites. Maybe just use a Google Map on your contact page, and use affiliate links instead of ads?
16. Retest Your Site In Pingdom/GTmetrix
Switch To 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.
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.
They’re recommended by WordPress:
A few threads:
SiteGround has 3 plans which are 77% off for Labor Day:
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:
People usually migrate because their speed technology can cut load times in half:
I’m just gonna leave this here…
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 email@example.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 my full WordPress speed guide first.
Here are some reviews on his profile…
I hope you found this tutorial helpful! Retest your site in Pingdom and if your WordPress hosting is still slow on HostGator leave me a comment and I’ll be glad to help. I tried to include everything here but I know it can get technical, so drop me a line if need be. Or if you were able to make your site faster, I would love to hear about your new scores and page load times.