How optimize speed of wordpress

Speed of sites on wordpress is one of the weak side of wordpress, because default wordpress cache system is very simple and not effective. But power of wordpress is in it’s community and number of awesome free plugins. Today I will tell you how you can get A grade on gtmetrix, google page speed, increase your page speed. These rules are working great in 95% of cases.

First of all, I want to talk about speed analytic. Many people uses google page speed test, but I don’t like it for one reason, because of this


Normally, on all standarts, css must load in head tags, js – in footer. This allows to render site correct, without shaking and jumping. But google doesn’t think so and recommend to load css inside content or asynchronously. Second way is hard to do on wordpress, and loading css inside content is not valid and not correct, so, I absolutely don’t understand this rule, which usually grabs near 10-15 points.

Update 1.

Render-blocking Javascript in above-the-fold content

You can try plugin Async Javascript to eliminate Render-blocking Javascript in above-the-fold content. Other possible plugin is WP Deferred JavaScripts

Note, this can cause problems with your scripts. So, use carefully.

So, I recommend to test site on which compares score between 2 tests.

Also, note, score – is just score, you should think about speed of site, not just score.

Let’s begin

First of all, I want to tell you that if you have slow hosting you can’t get good speed for your site even you are a master of caching websites. How to check your hosting? I want to give you advice. Go to your admin panel of wordpress and activate default theme and deactivate all plugins. If it loads not quickly – you need to change your hosting.

Also, sometimes, it’s important to have server localization close to your destination. For example, if site is for USA, make sure that your server is located near USA (or in USA). Because I have some cases, when hosting is good, but because of it’s location, it works very slow in my country.

Currently, I tried most of popular hostings, like Siteground, BlueHost, HostGator, WPEngine. All are ok, but I like Siteground more because it has inner cache system even for shared hosting + Memcache. I think it’s only one hosting which allows memcache functions on simple shared packages.

Ok, you have good hosting. Let’s do some improvements.

First things that you need to do – check your external scripts. If you use many ADS on page + social buttons + external scripts – you can’t get A grade, because you can’t cache external scripts and you will lose many points. But, even if you don’t get A grade, don’t upset. The most important thing – is your site speed. It must be under 4 second. 2-3 second – good, 1 second – awesome. Even if you get C grade, but your site loads under 1 second – this is ok.

Cache plugins for wordpress

I think I tried near 10 different cache plugins for wordpress. Some of them were awesome in past, but now is outdated. Currently, I think there are two good plugins which I used on sites. Wp Super cache and W3 Total Cache. I can recommend Wp super cache, because it’s much easier. W3 Total Cache – is all in one solution, but it’s very hard for novices to configure it correct + sometimes it has many incompatibilities with many plugins.  After installing Wp super cache – just enable caching. Usually, all things work by default.

Next things that you need to do – css and js minifying. If you use W3 Total Cache, you can just enable minifying. There is no minify function in WP super cache, so you need to use another plugin. I tried many of them and find that the best is Autoptimize which is working great with super cache plugin. I recommend also to install and activate Plugin Autoclean cache of Autoptimize because AO has weird problem, it can’t flush cache automatically and can fill your disk space very fast.

Settings for Autoptimize is very simple. Usually, I just enable two checkboxes: to minify Js and minify Css. I don’t change any other settings, just enable these two things. You don’t need to enable also HTML caching in Autoptimize, because this will be made in WP super cache

Leverage browser caching

Next step is setting correct expiration data for static resources. For this, you need to edit file .htaccess

If you have enabled Seo by Yoast plugin, you can edit this file without ftp. Go to Seo – Tools – File Editor

In most cases you have some code in .htaccess which allows wordpress use permalinks. Left it as is and add such code after

Image optimization

Usually I make two things. First – EWWW Image Optimizer plugin which reduces your image size. It works on all new uploads, but also you can optimize all existing images. For this, go to Settings – EWWW Image Optimizer. At the top of page you will find link Bulk Optimize. Click on it and then begin Optimize Media Library and Optimize Everything Else

Second plugin for images – BJ Lazy load. It allows to load images only when user reach them in screen. Usually, works ok with default settings. Note, some themes already have lazy load option for images, so, try to use inner theme functions.

Wpsoul’s theme buyers. Check theme option – global enable/disable to enable lazy loading for thumbnails in theme

Also, you can try to configure CDN for images. But note, that in this case you can’t optimize them.

I made all changes, but still have bad points

Usually, this is because of external scripts. All external sources can’t be cached and don’t have expiration date on your server. So, try to avoid using many external scripts.

First of all, check your fonts. Many theme uses google fonts. But I see that many users add tons of google fonts on site. Use only 1, maximum 2 custom fonts on site.

Second – icon fonts. It will be better to upload icon font on your site and use it from your server than external source.

Third – most common. Too many plugins. I see this very often on client’s websites. Many people install plugin just because they read that this is must have plugins. For example, most of sites have jetpack with all enabled modules.

Remember – use only those plugins which you know. Disable all plugins which you don’t understand.

Update 2

Some page speed test tool will take some points when your static scripts and css styles have query strings. Example, The problem is that this is default behavior of wordpress. You can delete this strings with plugin


These are the main things that you can do with site. Usually, after all steps you will get A grade. Of course, there are many possible reasons why you can’t get it and they are individual for each site. If you want – you can hire me to check your settings and optimize your site. Check contacts to send me email

These methods are good for most hostings, shared and VPS. If you have high load project, you maybe need some another methods with server optimization. For example, setting nginx + memcache.


Leave a Reply

31 Comment threads
21 Thread replies
Most reacted comment
Hottest comment thread
34 Comment authors
wpsouladminelizon.vnDWAIPAYAN BANERJEEBlog ReviewNguyễn Hồng Nhung Recent comment authors
newest oldest most voted
Notify of

[…] Also, we have great article how to increase speed of site with cache functions […]


Great post. Best edit to .htaccess I have found on the net.

Divaksh Jain

I can’t find option for the fontawesome, it is not there. Is there anything wrong with me? O.o

Rohit Singh

Thanks for this wonderful post I think that we must take steps to make our wordpress blog fast to load as possible because Google now considers blog speed as one of the major ranking factor.


Awesome guide. I agree with you about the Google’s PageSpeed and I think GTmetrix is good enough, for me at least.


What about AMP, does Rehub supports the mobile standard of AMP?

Blog Khuyen Mai

Thank you. Your theme is nice


Website is running very slowly, I’m using it on vps


I tried EWWW Image Optimizer plugin and after installing it was showing fatal error. Is it happening due too conflict with other plugin? I had WP-Optimize plugin before I installed EWWW Image Optimizer.


Can next update of rehub is a light weight theme ? I only need a simple theme with content egg templates and top pages. It would be great if rehub have an option for choosing a light weight child theme ?


how to manage cookie free domains notification in GTmetrix?


You must use CDN for this and special settings for domain. Ask your hoster how to do this

Bao Nhu

I used Litespeed Cache, it so good


I am not a much coding person so I use WProcket results are good loads around 2 sec

Tinh Dau Haku

Yes, WP Rocket is simple and easy to use, I’m using it on my business site 🙂

A gia re

Thank you for sharing code. Litespeed is so good


Question, just i just copy and paste the htaccess and replace the one that is already in place?


It’s really a nice theme. Thanks you

David vil

Is it true that some wordpress themes can’t optimize because of their JavaScript and Css?

Giang Hannah

Great code, my wordpress site speed better

o to tuan

Nice post. It’s show me how to make my site faster.


I use all the requirements of you, but my web only reached 5s. And how can you optimize the speed?

loot deals

Great information. we can easily reduce the website loading speed by using the low plugins.

Shop Nhat Chaly

Thank you for sharing, my website is better now

Ma Giam Gia

Awesome guide. Thank you!

Khuyen Mai Hang Ngay

Great post .Thank for your sharing


Nice post, Great code, my wordpress site speed better, thanks


The hosting plays an important role also, is it right?


Hi shazam,
Related to the “Remove Query Strings From Static Resources” plugin. Do it makes website become slow and CPU, Physical Memory Usage of hosting full? I have checked Review about this plugin and some comments not good about it.

Blog Review

Hi, I’m using LiteSpeedCache. Do you think this is a good choice? I’ve used W3 Total Cache and Super Cache but it doesn’t work too much for me.

Nguyễn Hồng Nhung

Nice post and Great Code, my blog speed better. Thanks your share


In our site we are facing Slow page loading and site performance on is not so good as Page is loading on 8-9 seconds with page request 132.

We have added Wp-rocket but not getting any speed improvement.

Currently we are facing the following issues With Yslow Score-61%
1)Make fewer HTTP requests
2)Add Expires headers
3) Use cookie-free domains
4)Reduce the number of DOM elements.

Also Page Speed Score-58%
1)Serve scaled images
2)Optimize images
3)Defer parsing of JavaScript
4)Avoid bad requests
5)Leverage browser caching

How to improve the Overall Page Score?


google updates web speed part in google SEACH consel , SO i see my web
web has dropped sharply