Site loading speed is considered to be one of Google SEO factors.

These days, there are many online tools which allow you to measure your or anyone else’s site loading speed. Personally, I use 5 tools of this type: GTmetrix, Google PageSpeed Insights, Pingdom Tools, WebPageTest, and Dotcom-Tools.

In this guide, I will show you how to speed up WordPress site and how you can go from results like these (or even worse):

to these:

When it comes to WordPress speed optimization, it’s enough to use Kinsta combined with Astra, WP Rocket, and ShortPixel, and almost all of your loading issues will go away!

If you want to get more details on this topic, just keep reading this article. 🙂

How To Speed Up WordPress Site In 8 Easy Steps

1. Choose The Best Possible Hosting Provider

Your hosting provider is the first and one of the most important aspects of your website’s speed optimization. Some time ago, I published an article with the list of the best hosting providers in the world. This list is regularly updated.

As it comes to speed optimization and security of your website, there is only one really valuable hosting provider that you should choose – Kinsta.

If you prefer any other company, this is your choice, but you probably won’t be able to achieve such amazing results as I did.

2. Choose The Best Possible WordPress Theme

Nowadays, there are thousands WordPress themes available online. Some of them are paid, some are free. Some time ago, I have even written an article about the best WordPress themes in the world.

But in this area, I have only one recommendation for you and I’m almost sure that you will be happy with it – it’s a free version of Astra theme.

Certainly, you can purchase a paid version of this theme if you’d like to add more features to it.

But In terms of performance, there is no better WordPress theme than Astra! Click To Tweet

3. Configure CDN (Cloudflare) In A Proper Way

Since the year 2016 (when I started blogging), I have tested a few CDNs such as: Cloudflare, MaxCDN, KeyCDN, BunnyCDN, Amazon AWS, Sucuri.

And here’s my view on CDNs:

Besides performance improvements, good Content Delivery Network should also provide high security level.

Obviously, you can choose whichever CDN you want, but from my point of view, Cloudflare provides the best relation between performance, security, ease of use, and pricing.

When it comes to activating Cloudflare, there are two ways to do it. You can do it with SiteGround’s client area (if you host your site with SiteGround) or by signing up on cloudflare.com.

The second of these two solutions is the way recommended by AliveBetter since it has one very big advantage. If you use Cloudflare and decide to change your hosting provider at any time in the future, you'll be able to propagate your DNS settings in just a few seconds! You won't have to wait long hours until your site is reachable again. Click To Tweet

You will just need to update your server’s IP address in Cloudflare DNS settings and clear the cache. Your site will start being served from the new server in less than a minute!

So, this is how you should configure Cloudflare in order to get maximum security and performance benefits:

DNS

An IP address on the screen above is the address of your server.

SSL/TLS

Speed

Caching

Page Rules

The 1st path on the screen above is my WordPress login page. If you’d like to change your login path, you should download and install WPS Hide Login , type in your path, and add it to the Page Rules tab as you can see above.

Network

Traffic

I’m not going to show screenshots from Argo Tunnel, Load Balancing, and the next 3 sub-tabs since I have the Argo feature turned off.

Scrape Shield

If you haven’t found one or more tabs in this section of the article, it means that there is nothing to set.

4. Reduce Number Of 301/302 Redirects

Both my blogs (www.alivebetter.com and www.alivebetter.pl) have SSL certificates (green padlock on the left-hand side of your address bar), hence their addresses begin with “https://” instead of “http://”. As you can see below, some time in the past, this blog had two 301 redirects instead of one.

This issue has been solved by SiteGround support. In order to solve a problem like this one, I needed to configure Cloudflare as it is shown in point 2 of this article, and add the following lines:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^alivebetter\.com [NC]

RewriteCond %{SERVER_PORT} 80

RewriteRule ^(.*)$ https://www.alivebetter.com/$1 [R=301,L]

to .htaccess file.

This method worked fine with SiteGround a few years ago, but it failed with Cloudways when I tested it in 2019.

Majority Of Hosting Providers (Except SiteGround)

If you host your site with any Apache-based provider other than SiteGround, you should go to .htaccess file and add these few lines:

<IfModule mod_rewrite.c>

RewriteCond %{HTTP_HOST} !^www\. [NC]

RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTP:X-Forwarded-Proto} !https

RewriteCond %{HTTPS} off

RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

</IfModule>

at the beginning of the file.

In order to do that, go to WP File Manager plugin, right-click .htaccess file, and choose Code Editor from the menu.

Now, you can click Save & Close and clear the cache on both your server and Cloudflare.

If you host your site with SiteGround, you just need to enable HTTPS Enforce.

That’s all!

This option is available in SiteGround Site Tools and in SG Optimizer plugin.

If you host your site with Kinsta, you need to install an SSL certificate and force HTTPS.

More details in this topic are available in my comparison of 4 best hosting providers.

5. Optimize (Compress) Images

Compressing images is a very important factor of speeding up your WordPress website. There are a few popular WordPress plugins for that purpose, such as: EWWW Image Optimizer, Imagify Image Optimizer, Kraken.io Image Optimizer, WP Smush.

My favourite plugin for optimizing images is ShortPixel Image Optimizer and I can recommend it to everyone! Although majority of the photos on this website had been optimized online with tinyjpg.com, then with a WP Smush plugin, ShortPixel managed to reduce their sizes about 25-30% without any noticeable loss of quality!

6. Install And Configure The Best Possible WordPress Caching Plugin

These days, there are a few quite good and very popular WordPress caching plugins such as W3 Total Cache, WP Fastest Cache, and Autoptimize.

However, in this section of the guide, I will show you one paid WordPress plugin which works perfectly. This tool is called WP Rocket and this is the plugin installed on both version (PL and ENG) of AliveBetter blog.

The cheapest version ($49) of WP Rocket can be installed on one website only, the most expensive one ($249) is for unlimited number of websites.

This amazing plugin will also allow you to add expires headers to your WordPress site very easily. 🙂

After choosing the cheapest or medium package, you will be able to upgrade to higher package(s), and you will pay only the difference between your current and the future package.

If you’d like to renew your licence before the end of the first year, you can get even more than 50% discount!

WP Rocket is the tool which helped me achieve the best results in terms of speed. You can find them in one of the following sections of this article.

Below, you can see an optimal WP Rocket configuration:

Dashboard

Cache

File Optimization

On this tab, you should check every possible option. When you do this, clear cache using the second from the top option of WP Rocket menu, then log into your hosting provider client area and clear the cache there, and log into your CDN dashboard and also clear the cache.

After all these steps, open any web browser and check whether your site isn’t visually broken (you may need to check it in a private window – Ctrl + Shift + N if you use Opera or Chrome, Ctrl + Shift + P in case of Firefox).

In case if it was, go back to WP Rocket settings, uncheck the first option from the top (on File Optimization tab), clear the cache again and check your site again.

Repeat these steps until you find the best possible settings for your hardware and software configuration.

The next step is very important in the process of speeding up websites.

If you check Optimize CSS delivery option, you should add some code in a field described as Fallback critical CSS.

In order to generate that code, you should visit SiteLocity’s Critical Path CSS Generator.

There, you need to type in your domain name and click the green button below.

After a while, you will get a code (shown above) which you should copy and paste into the field mentioned earlier and shown on the screen below.

Media

Preload

Database

There is completely nothing to configure on the Advanced Rules tab so I decided to skip it.

CDN

This tab is helpful for those who want to use a CDN other than Cloudflare and Sucuri.

In such a case, you need to check Enable Content Delivery Network and paste your CDN’s CNAME (which you can find after logging into your CDN dashboard) in the field below.

Heartbeat

You can completely disable Heartbeat’s activity, but remember to check whether your site works properly after this step.

Add-ons

Add-ons should be activated according to your needs.

In my case, it is Google Tracking and Cloudflare.

Global API key and Zone ID are available after you log into your account on cloudflare.com.

Image Optimization tab recommends using Imagify plugin for compressing images.

However, according to my tests of various image optimizers, ShortPixel brings the best results and it perfectly satisfies all website loading testers.

7. Fix Mixed Content Issue If It Occurs

Mixed content is a very common issue which occurs on millions of websites around the world. I’m pretty sure you have seen such an issue many times before.

Mixed content occurs when a site has an active SSL certificate and is loaded with https “prefix”, but some elements are still loaded through http.

Here are some examples of such an error.

And here are the solutions:

If your site is hosted with SiteGround and you have enabled HTTPS Enforce like I recommended you earlier, the issue probably does not occur.

If it occurred anyway, there is a simple solution which allows you to fix the problem with just a few clicks.

If your site is hosted with Kinsta, you will have to use Search and replace tool. More details are available in another article.

If your site is hosted with any other company, you will have to use Search & Replace WordPress plugin. The complete solution was described in this article.

8. Install And Activate Clearfy (An Alternative To Perfmatters)

Perfmatters is the most frequently recommended paid plugin which allows its users to disable some unneeded WordPress features.

But do you really have to purchase another paid plugin in order to maximize your results?

The answer is ‘no’.

Some time ago, I have created the article with comparison of Clearfy and perfmatters.

However, I haven’t mentioned about one strange and interesting thing there.

I purchased perfmatters in the first half of October 2019, my PayPal account was charged immediately, but I haven’t received any license key.

Customer support was not answering my questions.

After more than 5 weeks, Brian Jackson (who is an employee of Kinsta, a founder of perfmatters, and the owner of woorkup blog) reached me out with the information that my purchase and my enquiry have landed in their spam folder 😮 😮

After receiving my license key, I decided to test that plugin anyway. The results are available in the article which I have linked to above 🙂

Although Kinsta, WP Rocket, and ShortPixel are amazing services which are worth the money, perfmatters (at least in my opinion) is not…

Keep reading this article and read my comparison of perfmatters and Clearfy, and you will understand why I think so.

AliveBetter’s Speed Tests Results

Before writing this article, I went through all the steps described above and I can see that they work.

Here are my speed tests results achieved just a few days before writing this guide (and obviously after going through the steps described in this guide):

GTmetrix

Google PageSpeed Insights

Pingdom Tools

WebPageTest

Dotcom-Tools

WordPress Speed Optimization – Quick Summary

So in this article, you’ve learnt how to speed up any WordPress site.

However, now I have to repeat what I’ve written at the beginning of this guide: