Learn How To Speed Up WordPress Site Like A Pro [COMPLETE GUIDE][2021 Edition]

Learn How to Speed Up Your WordPress Site easily in 30 minutes.
Is your WordPress website slow? If it is, you should take steps to optimize it.

Shaving extra milliseconds from your site’s loading time can have a great impact on your traffic and search engine visibility.

What causes WordPress to load slowly?

WordPress is a great platform for clean and well-designed code, but it’s not perfect. There is a massive list of themes and plugins, but they don’t all offer good performance.

Slow themes and plugins can make your website sluggish. Combine that with a crappy web host, and you’re in big trouble.

If you’ve been asking yourself questions, like “Why is my WordPress site so slow?” or “How can I speed up my WordPress site?” , please read and carefully follow this guide.

It describes the easiest ways to speed up your WordPress site. After reading it, if you have more questions, just drop them in the comments section.

Why is speed so crucial in today’s web environment?

Google now considers site speed a deciding factor in your search result ranking. If your site is slow, get ready to lose a huge number of visitors.

Check out this amazing info-graphic from Kissmetrics:

How loading time affects websites traffic and conversation
Infographic by Kissmetrics

How to Speed Up Your WordPress Site?

Before starting, please check your current website performance with Pingdom Tools and GTmetrix. Compare this result after applying tips from this guide.

I guarantee you this tip helps to boost your website speed.

#1. Choose a Good Webhost

You want to optimize your WordPress site for speed but how you improve a site where your web server makes things sluggish and slower.

How to Choose Good Webhosts for Your WordPress Websites

I Know, When you start as a newbie, you fascinated by Unlimited Pageviews or Bandwidth type web hosting advertise by pro blogger. As a newbie, it’s reasonable to buy this type of host because they offer a cheap plan affordable by any new blogger.

But this unlimited thing comes with costs, when you or another user who hosts on the same server, get traffic to your blog its load slower like a turtle. If blogs receive massive traffic then in many cases your website down or they send you to email about upgrading your site to a higher plan.

They cover their expenses by hosting thousands of websites on the same server and all accessible through the same IP. This means if any site flagged in search engines then it hurts your site SEO too. Check this article, 👉 The Truth About Unlimited Hosting.

Before purchasing a web host, please go to google and search for a review. Check communities like WebHostingTalk and please don’t trap yourself in Unlimited Hosting Plan. Check this article, 👉 Beware of “Web Hosting Review” and “Top 10 Web Hosts” Sites

I divide WordPress Hosting in three different categories. For more details, please check, 👉 How To Choose Best WordPress Hosting and Save Money

a. Affordable WordPress Hosting:

If you are looking for affordable WordPress optimize hosting, check SiteGround or GreenGeeks or A2 WordPress Hosting.

They offer managed WordPress hosting with the latest features like PHP7, HTTP/2, SSD, Free SSL Certificates, and tons of other features starting from 3.95$ / Month.

GreenGeeks or SiteGround have similar features as compare to WPEngine in affordable price range.

Finally found a better Unlimited Hosting company than Bluehost, GreenGeeks. GreenGeeks provides you SSD space, low websites on server (means faster speed) and 300% Powered by Renewable Energy.

But, if you still want to use unlimited type WordPress hosting, choose BlueHost. If you are from India and want to buy hosting from BlueHost, choose US Hosting. Don’t buy Indian BlueHost hosting account.

Please don’t use any EIG owned hosting provider, bluehost owned by EIG. Check 👉 Why you should avoid Endurance International Group (EIG)

b. Premium WordPress Hosting:

Not Every business is same, that’s why some business or high traffic getting website need premium WordPress hosting. Choose Kinsta or WPEngine for your big projects.

👉 WPXhosting is a fastest Managed WordPress hosting provider.

👉 Kinsta is a fast Managed WordPress hosting powered by Google Cloud.

👉 A WPEngine plan starts at 35$ / Month, and they are a leader in WordPress Managed Hosting.

c. Geeky [DIY] WordPress Hosting:

If you are a tech-savvy blogger or want more power as compared to a shared hosting environment with total control on your server.

Choose any Virtual Private Server provider.

In this type of web hosting, everything managed by yourself or operated by a provider with extra cost.
If you go with this, then choose unmanaged VPS from MaxKVM VPS[currently host this blog] or Digital Oceans.

But, Masood, How can I manage it myself?

Don’t worry, with the help of Webinoly or CyberPanel or WordOps; you can set up the world class WordPress optimized environment in minutes.

I am using WordOps to setup fully optimized WordPress stack for BLOGGYAANI.

#2. Use Solid WordPress Theme/Framework

Themes play a major role in WordPress because either it attracts your visitor or distracts them. That’s why you see many themes in the WordPress ecosystem. As a new blogger, everyone attracts to free WordPress themes or some shiny premium WordPress theme which has endless post display setting and blah blah blah.

Many free themes add lots of unnecessary code on your WordPress site in the name of better user experience, or they won’t follow WordPress themes guide. As a result, your website loads slower due to many calls to your server resources. This condition is also applied to many premium themes. For more sales, they add lots of functions in one theme which is not required by your website, and these features make your site loads slower.

Default WordPress themes are always speedy and well coded and easy to customize, but I advise you to buy some premium themes or hire a coder.

This blog use Authority Theme from MyThemeShop, its optimized by six figure blogger Mathew Woodward.

Check my review here, Authority Theme Review: Make Your Money Blog Now.

Currently I use GeneratePress from GeneratePress.

Authority Theme Responsive Test across devices

If you want clean and light weight theme then choose GeneratePress, or for making fancy website without compromising your speed then choose Elegant Themes. Both theme provider provides wide range of themes which fits in any niche.

#3. Install Good Caching Plugin

The second most important part of this guide after choosing a good web host is installing a good caching plugin. After installing any active caching plugin on your website, you can tell the difference between a page with caching or without a caching plugin.

Caching plugins make a copy of your site in a separate folder in an entirely static form or try to reduce calls to your blog server, and when a user arrives at your site then instead of showing the original page plugin show them a cached version of a page. It reduces database calls, no PHP requests, and no HTTP requests(combining many files into one).


WPRocket is my favorite caching plugin and use it on all my blogs. Before using WPRocket I use W3 Total Cache with memcached enabled and my website load in 300ms, yes 300ms but after WPRocket its loads under 200ms with same page size(page size: 299KB).

ATHEMES compares 9 popular WordPress caching plugin and find WPRocket faster than W3 Total Cache or WP Super Cache.

Check WP Super Cache or PageSpeed Ninja, both are great plugin and newbie friendly.

👉 Check 8 Top Best Free Plugins to Make WordPress Faster.

I am not using WPRocket anymore for my blogs, instead of WPRocket I use CloudFlare full cache, Rocket Loader™ with Autoptimize. It’s give me a better results as compared to WPRocket with CloudFlare full cache.

After WPRocket 3.0 update, everything is changed and now its outperformed above stack.

#4. Use a Content Delivery Network(CDN)

CDN used for offloading your static resources from your main server, like CSS, Javascript, Images, and Files. This offloading process makes your website loading faster at the user end and your primary server free from this task.

How CDN Works?

CDN providers cache your static contents in their data centers, all over the globe. When a user requests these resources then it’s loads from the data center which is closer to the user location.

If your server host in New York and a visitor comes from India, then the CDN provider loads static files from the Asian data center.

There are many CDN providers available in web market, but KeyCDN is most affordable CDN provider. KeyCDN provides free SSL and HTTP2 support.

If you are new blogger and you are unable to bear the cost of these premium CDN’s then choose CloudFlare, it’s acts as a CDN and also provide security for your blog. Like, block bad bots and visitors from accessing your site and makes your site faster.

Don’t want to use Cloudflare in front of your websites and still wish to offload some assets to CDN without spending a dime on CDN.

👉 Check commonWP, commonWP is a plugin that enables usage of free, public CDN (jsDelivr) for open source JavaScript and CSS files, for more details check, 👉 New commonWP Plugin Enables WordPress Sites to Use the Free jsDelivr CDN.

I am using CloudFlare free tier[only DNS hosting] + WordOps at BLOGGYAANI.

#5. Enable Gzip Compression

Enable Gzip
Always served gzip version of website to your visitor, because its compress your overall web-page size and makes it faster.

Check Gzip Compression of your site with this tool.

If you host your website with cpanel, enable gzip from panel or you can use plugin like Check and Enable GZIP compression, W3 Total Cache, WP Super Cache or WPRocket.

Gzip also enable via .htaccess, for Apache

## BEGIN : Enable GZIP Compression (compress text, html, javascript, css, xml and so on) ##

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE image/svg+xml
SetOutputFilter DEFLATE

## END : Enable GZIP Compression ##

For Nginx,

gzip on;
gzip_comp_level 2;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

# Disable for IE < 6 because there are some known problems
gzip_disable "MSIE [1-6].(?!.*SV1)";

# Add a vary header for downstream proxies to avoid sending cached gzipped files to IE6
gzip_vary on;

🛑Please take a full backup of your website before playing with .htaccess file.🛑

#6. Add an Expires header

When someone visits your site, the visitor browser downloads all files from your server to the visitor’s device and renders your website. Expires header set an expiration time for your static content.

Mean If you enable expire header for static resources then at the second visit of the same visitor, browser, not downloads same content and display resources from the first visit if it does not expire.

Add these code in .htacess to enable expire header in WordPress.

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 month"
ExpiresByType image/jpeg "access 1 month"
ExpiresByType image/gif "access 1 month"
ExpiresByType image/png "access 1 month"
ExpiresByType text/css "access 14 days"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 14 days"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 14 days"

👉 Above numbers are changeable, change according to your needs.

#7. Use a Minified Resources

Websites use CSS and JS files to beautify, and these files are many in quantity. Every plugin or theme you add to your blog adds some CSS or JS files.

If browsers communicate with your websites with HTTP v1 Protocol, then they download only four files in a parallel manner. Imagine, your blog has 20+ CSS and JS files. How much time browsers spent to connect your hosts and fetch them to display your website to Visitor?

For this problem, you can use plugins like Autoptimize or WPRocket. They minify and combine your static resources in one or two files, then sends these files to the visitor. These help to speed up the overall process.

#8. Optimize Your Images

Images are heaviest and necessary elements of any web page; It increases engagement on your page. Due to heavy in storage, it’s loads your website slower, and sometimes your site still loading and visitor leaves your site. For this, I have some easy solutions for you.

A picture is worth a thousand words.

First, you must specify image dimension thumbnail, medium, and large-sized images. I always choose a medium and large size up to 2000 * 2000. Why?

Every theme comes with its own image size and that time medium, and large setting creates an image that is not used by posts. Then just make it higher than your possible image size.

Second, reduce your uploaded image size, don’t worry you have two great free plugin for this work.

  1. Imagify
  2. ShortPixel

I test both plugins on my personal website, where both compress the 7MB image folder in 3.5MB. Imagify perfect for JPG while ShortPixel great for PNG. Both are free for some quotas and newbie it’s sufficient. Install WordPress plugin for any of plugin and start compressing your image without leaving your WordPress dashboard.

#9. Lazy Load your Images

Lazy Load helps you to save bandwidth and speed up WordPress site. How?

Lazy Load displays images, videos, or iframes to a visitor when it’s visible. With the help of a lazyload, you can reduce HTTP requests to your server; you save your resources by not showing images to a visitor who not read your article or not scrolls down.

You can use WPRocket or Rocket Lazy Load or Flying Images to add lazy loading fuctionality in your blogs.

#10: Optimize Your Database

You can optimize your database through plugin or by PHPMyAdmin, plugin like WP Sweep or WP Optimize. WP Sweep is better than WP Optimize according to my experience. Or use WPRocket for database optimization.

These plugins delete pending spam comment(if you use default WordPress Comments), Post revision, Post draft and many things. WordPress works with database and optimizing database gives your website huge boost in WP speed up process.

🛑Please back up your website or publish your saved draft before making total cleanup because it is not reversible in many cases.🛑

#11. Only Install Well Coded Plugin

In the WordPress plugin directory, you can find thousands of plugins, and after analyzing their code, you find many plugins are not well coded, and some won’t follow the standard. Always install a plugin that updates from time to time.

There is one problem, How you could find a better plugin for the same job.

How to find Well Coded Plugin

First check plugin rating, if it’s three stars then try to find an alternative. But some plugin won’t get any star and still update to WordPress version, check those plugin on localhost or in a sandbox.

Why you won’t install a poorly coded plugin?

Because they insert lots of inappropriate hooks on your website, and it’s slow down your site.

Second, after installing your desired plugin, check performance and impact of plugin on your website using P3 Profiler. It’s not 100% accurate, but still, you find a problem on your website.

#12: Perform Routine Maintenance on Your Site

WordPress plugins are an easy target for hackers. Why?

Update WordPress Plugins and Themes

Many times we are not paying attention to our blog and not update it from time to time, when you check the internet you find the main reason for the hacked WordPress website is not updating plugins.

Always uninstall and delete plugins that are not required, because it’s slow down your site by calling not needed resources.

#13: Optimize your homepage to load quickly

Always optimize your blog front page, change the default settings of your theme. Don’t display too many posts or infinite scrolling pagination.

Keep this point in your mind while optimizing your front page,

  1. Display summery instead of full post
  2. Reduce the amount of post in front page(Mine is 4-5)
  3. Remove sharing widgets from front page
  4. Remove unnecessary widgets from your front page
  5. Don’t display too much ads, or won’t display it
  6. keep it simple

#14: Limit and Delete Old Post Revisions

Do you require 10s of post revision for your published posts? I think it’s not necessary.

You can use WP-Sweep or Revision Control to delete posts revisions from your WordPress database and make it smaller and faster.

But, sometimes while writing posts we need some revision if things goes wrong, add this code in your wp-config.php before /** Absolute path to the WordPress directory. */,

define('AUTOSAVE_INTERVAL', 600);
define('WP_POST_REVISIONS', 3);

You can change auto-post time 600 to your desired time, time in seconds, and change post revision 3 to whatever you want but keep it below 5. Otherwise no meaning for this code.

#15: Turn off pingbacks and trackbacks

WordPress uses Pingbacks and trackbacks for interacting with other WordPress blogs.

When someone mentions your blog or a site in their posts, it notifies your website, and most time this is used for getting a backlink. This could hurt your backlink profiles and also makes loads on your blog database.

Turn off Allow link notifications from other blogs (pingbacks and trackbacks) on new articles in your Discussion Setting.
WordPress pingbacks and trackbacks Setting

If you turn off this setting, it does not destroy your profile and also helps to save database from junks. Check How to Deal with Trackbacks and Pingbacks in WordPress for further explanations.

Add below code in your function.php or use Code Snippets plugin for avoiding any self-ping from your own post.

//Disable Self-Pingbacks
function bloggyaani_disable_self_pingbacks( &$links ) {
foreach ( $links as $l => $link )
if ( 0 === strpos( $link, get_option( 'home' ) ) )
add_action( 'pre_ping', 'bloggyaani_disable_self_pingbacks' );

#16: Reduce and Delete Spam Comments

Comments are an essential part of any posts, comments promote and give freedom of speech to visitors and readers of blog posts. Comments help you in SEO when Google see engagement on the page, then it’s considered as a vote of trust.

WordPress Comments Spam Problem and Plugins Solutions

But, some people use comments for spamming or link back to their website. Link back to commentator site encourages a visitor to leave a comment on your posts, but again we deal with lots of comments linking to spam sites.

You can activate Akismet plugin, it helps to catch spam comments, but all spam comments go into spam queue and make database size larger.

I use Forget Spam Comment, Its never show any spam comments in spam queue. You should use Zero Spam, its also protect your contact forms.

You can disable URL field from comment form using code.

/* Remove URL from WordPress Comment forms */
function bloggyaani_remove_website_field($fields) {
   return $fields;
add_filter('comment_form_default_fields', 'bloggyaani_remove_website_field', 9999);

or you can strip comment author website clickable link using the code.

// Disable comments author links
if( !function_exists("disable_comment_author_links")){
		function disable_comment_author_links( $author_link ){
			return strip_tags( $author_link );
		add_filter( 'get_comment_author_link', 'disable_comment_author_links' );

#17: Remove Query String

Whenever you run your website through website auditor tools, you found one common piece of advice in all of them. Remove Query Strings from your resources. What is this?

Query string are the file numbers attached with your CSS and JS files like this https://domain.com/file.min.css?ver=5.0.2. Some servers are unable to cache this, so removing the Query Strings helps to make caching more efficient.

You can use function.php or free Code Snippets to add following code in your WordPress site.

function remove_query_strings() {
if(!is_admin()) {
add_filter('script_loader_src', 'remove_query_strings_split', 15);
add_filter('style_loader_src', 'remove_query_strings_split', 15);
function remove_query_strings_split($src){
$output = preg_split("/(&ver|\?ver)/", $src);
return $output[0];
add_action('init', 'remove_query_strings')


You can use WPRocket to remove query strings and improve the caching functionalities of your WordPress websites.
Remove Query Strings from WordPress Static Resources with WPRocket

#18: Use Google CDN for JQuery

Almost every WordPress theme calls JQuery to animate things and its loads from your server when a visitor comes to your website. JQuery file loads from a server and it’s waste your 33KB bandwidth every time. Why?

Because Google hosts the latest JQuery on their servers and your server never beat Google. If you use the Google JQuery library, then it’s a chance this file already download on your visitor computer. If it’s present in the visitor’s computer, then the browser calls this file from the cache and not download it again. It saves bandwidth and time. Or use a 👉 commonWP plugin to offload your entire WordPress common file to JsDelivr CDN.

You can add this via Code Snippets or via function.php file,

add_action( 'wp_enqueue_scripts', 'register_jquery' );
function register_jquery() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', ( 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js' ), false, null, true );
wp_enqueue_script( 'jquery' );

#19: Remove Google Web Font

Typography helps in reading and make the blog beautiful. It makes a blog more appealing to a visitor. That’s why every theme developer adds in themes.

These fonts add 10 to 50KB extra weight to your CSS and also add 3 to 6 HTTP requests on your blog.

The visitor wants a clean and fast loading blog full of information; you can use Georgia, Thoma, or Verdana font on your blog.

Use Remove Google Fonts References to remove Google fonts from your themes.

#20: Disable hotlinking of images

When someone hotlink your blog image, its make your website load slower. To prevent your bandwidth stolen from your website, add this code in your .htaccess file or use this website to create custom .htaccess for your need.

## Disable hotlinking of images with forbidden or custom image option ##
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com/yourblogname [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

#21: Host your videos externally

If you are a video blogger, then this is for you.

Videos require lots of bandwidths to serve, and for different devices, you need a different size for video, and this is costing you lots of bandwidth and storage space.

Use Youtube or Vimeo for hosting your videos.

They serve videos according to visitor device size and also offer low and high resolution.

#22: Lazy Load your Videos

YouTube videos help to drive traffic, but it adds an additional 500Kb to 1Mb on that page.

Imagine, if you embed YouTube or any type of external video code on your homepage or on any page then you probably hit by Google slow loading website penalty.

How to avoid this?

Use LazyLoading techniques for Videos, There are many plugins available but I use A Better Method for Embedding YouTube Videos on your Website.

You can download plugin version of above solutions from here, LightTube. It place one yt button in your WordPress Code Editor.

👆 The video above is embedded using the same on-demand technique 👆


You can use Lazy Load for Videos


Site Speed Importance in Search Engines Eyes

Site speed is now the critical factor in search engine positioning algorithm. You can lose your potential visitor due to the slow pace of a website. Internet users close the site if it’s not loaded in three seconds and shift from desktop to the internet-enabled devices means if you are not fast then you’re not going to see.

This post helps you to make your WordPress blog or website faster, and I test all these tips on various sites.

Check BLOGGYAANI speed on Pingdom Tools,
BLOGGYAANI Speed Test Result

I think after reading and applying techniques at your site, you can make your WordPress website faster, aren’t you?

What other ways do you recommend to speed up WordPress sites and improve load times of WordPress websites?

This blog post updates immediately after I find any new ways to Speed UP WordPress Sites.

Thanks for reading! Please share this article if you enjoyed it.

11 thoughts on “Learn How To Speed Up WordPress Site Like A Pro [COMPLETE GUIDE][2021 Edition]”

  1. Hey Masood,
    It has been a great and useful post for me. I learned many new things from your post. My site was running slow and test my site speed for mobile and desktop version and found few problems. I solved those and find new terms on your post to learn. I bookmarked your post for future reference. Indeed, you have done a great work.

  2. Due to its simplicity to use features and a large library of easily available plugins, even a new or zero knowledge tech person like me can build the professional websites by using the WordPress. And following some new updates in Google’s ranking algorithm, site loading speed has become even more necessary for a ranking website.

    Thank you so much for sharing an excellent article about “Faster Loading WordPress Plugins”. These are the plugins which I feel everybody need to be used in their blogging life. Now as you explain superbly the use of plugins to us, I am going the practice those to my blog. Also, with my experience, I highly suggest you configure Cloudflare with your website. It’s free, easy to install & it offers free CDN & makes your blog fast and secure.

    One quick question; using too many plugins make the blog or website to load slowly. What do you say? Thanks in advance.

    • Shaikh Masood Alam

      I am using 15 to 35 plugins on any blog depends on my need. If you are using good plugins with clean code, no unnecessary resource calling and minimum effect on your loading speed. You can use as many plugins as you need. Always check the performance of the website, load on the server after activating any plugin on your site.

  3. Good article. Also several tips how to optimize homepage:

    1) Show excerpts instead of full posts
    2) Reduce the number of posts on the page (I like showing between 5-7)
    3) Remove unnecessary sharing widgets from the home page (include them only in posts)
    4) Remove inactive plugins and widgets that you don’t need

  4. A seriously good and comprehensive post, surely going to tweet it. Also, a video on this topic ( Aimed for beginners ) would be a great thing I believe.

  5. Instead of plugins, I can see some coding solutions to speed up the website.
    That’s the most authentic article to optimize the speed for a WordPress site.
    You’ve done a great job.

    • Shaikh Masood Alam

      Thanks, Samuel for your comment, I prefer low plugin count on my Plugins page.

  6. Thanks for sharing What I am looking to speed up after google update, I got Penalty for ranking down only because my site speed is low but now I try your suggestions.

  7. Great list you’ve curated here. My favorite is autoptimize. I’ve been using it for a year or two now. It’s the best tool I’ve found for doing the critical CSS. Also wanted to thank you for bringing WP Disable to my attention. Haven’t heard of that one before and it seems to have some great functionality, so thank you!

  8. Hey, Shaikh Masood Alam Nice thoughts that how to speed up WordPress site like a pro.

    Enhancing the performance of the existing website is perhaps the biggest challenge faced by many WordPress website owners in the recent times. As per google the latest recommendation, website performance is a key ranking factor.

    And the most important thing is that the techniques are very useful for my website…

    Thanks for sharing this Article it is such a knowledgeable for me…

  9. Proper cleaning makes the website user-friendly and easy to access. Thanks for the great tips.

Leave a Comment