Want to speed up your WordPress site & reduce load time? Well, I will show you how to optimize your WordPress website speed using plugins & get 100/100 on Gtmetrix, PageSpeed Insights & Pingdom speed test report With 26 WordPress speed optimization tips including Woocommerce (2021).
Optimizing your WordPress speed will improve user experience, reduces bounce rate, increase your page views & also improves your ranking in search results. People will leave your website if it takes too much time to load & you will lose customers and subscribers.
So, are you ready to optimize your WordPress site? Then keep reading.
Table of Contents
- 1.Choose a Better Web Hosting Provider
- 2. Use The Latest Version Of WordPress & PHP
- 3. Use Cache Plugin
- 4. Clean Your WordPress Database
- 5. Disable Heartbeat Control
- 6. Video Optimization
- 7. Host Google Fonts Locally
- 8. Host Google Analytics Locally
- 9. Cloudflare
- 10.Use CDN (Content Delivery Network)
- 11. Serve Scaled Images
- 12. Specify Image Dimensions
- 13. Image Compression
- 14. Remove Unnecessary Themes & Plugins
- 15. Enable Gzip Compression
- 16. Gravatars
- 17. WooCommerce Optimization
- 19. Add Expires Headers
- 20. Remove Query Strings
- 21. Minimize Redirects
- 22. Use Light Weight Themes
- 23. Block Bad Bots
- 24. Disable Plugin On Specific Page
- 25. External Resources
Why Speed Matters?
Website speed is an important ranking factor in search results. Google, Bing & Yahoo is now ranking only those websites that load quickly and decrease the ranking of slow websites which ultimately reduce traffic.
According to a study, a page load slowdown of just 1 second could cost Amazon $1.6 billion in sales each year. Even Mozilla has reduced its page load time to 2.2 seconds, which added an additional 60 million Firefox downloads per year. If your site also takes too much to load then you are losing your visitors.
How to Check Your WordPress Website Speed?
A good web page time should be under 3 seconds for desktop & for mobile, it should be under 2 seconds. The speed may differ from pages to pages, as it depends on mainly two factors:
- The size of the web page,
- The number of requests it generates.
Just run a speed test using the following speed testing tools.
Now, take a screenshot of the speed test result & compare it later with the final result.
Before you start optimizing your site please backup your WordPress site.
In this post, I have shared mostly the plugins to make your WordPress website load faster instead of codes because when you update WordPress or theme all the codes that you have applied in order to speed up your WordPress site will get removed & you have to apply those changes again & again which ultimately is a waste of time.
You can also watch my video, where I have covered almost everything on how to speed up WordPress website 2021 for free with timestamps in the video description.
1.Choose a Better Web Hosting Provider
One of the biggest reasons for the slow WordPress sites is using poor quality web hosting. They store too many websites on the same server which results in increasing server response time. Just run a speed test on Google page speed. If you see reduce server response time in needs improvement section, then its time to change your hosting provider.
All these web hosting offer fast web hosting experience and choose you can choose any of them based on your budget.
Best Shared Hosting
Cloudways (Use Coupon: DIGIROCK20)
Best Cloud Hosting
Best Managed WordPress Hosting
Best Premium Hosting
Disclamier: Since I don’t recommend ‘not good’ hosting like various different affiliates out there, you could really help me out by signing up for any web hosting mentioned above using my affiliate link. Also, let it be known that I base my reviews not only from my own experience but also from other trusted sources.
I am Using Cloudways as they offer cloud hosting at an affordable price & offer faster web hosting experience. Cloudways has partnered with top Cloud hosting provider top cloud hosting providers like – Digital Ocean, Amazon Web Services (AWS), Google Cloud, Linode, Vultr. Unlike other hosting providers, there is no yearly plan in Cloudways. You can either choose a monthly or hourly plan. The lowest monthly plan starts from $10/month whereas the lowest hourly plan starts from $0.0139/hr.
My website is also hosted on Cloudways with Digital Ocean & I am really happy their server speed. Even this post which has more than 52 images with a page size of 2.9 MB is loading under 1.5 seconds.
WordPress Recommend Digital Ocean
Cloudways offers high-speed cloud hosting with 99.9% uptime. Here are some reviews of Cloudways customer taken from Various Facebook groups, Sub Reddits & Twitter.
Join these groups to learn more – WordPress Hosting Group.
One of the best parts of Cloudways is their “pay-as-you-go” pricing model which means you have a pay monthly & if you are not happy with their service, you can cancel your account.
You can choose your cloud hosting plan from any of the five different partners – Digital Ocean, Linode, Vultr, AWS & Google Cloud.
The starting plan is $10/month under the Digital Ocean. If your site traffic increases then you can easily upgrade your plan.
All the Cloudways hosting plans include 24/7 support, Free SSL (Lets Encrypt), free website migration (only for 1 website, if you have more than one website, then you to pay).
Cloudways also offer a 3-day FREE TRIAL, If you want to try out their service, then you can take their 3-day FREE TRIAL offer (no credit card required).
Top Reasons why I like Cloudways:
- Speed UP Your WordPress Site.
- Pay-as-You-Go Pricing.
- Free Cache Plugin.
- 5 Cloud Hosting Provider To Choose From.
- Free website Migration plugin.
Use Promo Code – DIGIROCK20 & Get 20% OFF
WPX is a managed WordPress hosting provider known for its Speed & Super fast support. You will get a fast loading time for all your sites hosted on the WPX server. I have got almost the same speed with Cloudways & WPX hosting. But if I compare Cloudways support with WPX hosting support, then WPX hosting wins the race as they reply in less than a minute. If you want good support, then go with WPX hosting.
WPX also offers high-speed custom CDN with 26 Global edge locations, unlimited website migration, daily malware scanning & removal, a free SSL certificate for all the websites, DDoS Protection, etc. on all plans.
Their plan starts from $24.99/month but if you choose the yearly plan then the price reduces to $20.83/month. Yes, I agree that WPX hosting plans are expensive but their super fast support & speed justify their pricing.
2. Use The Latest Version Of WordPress & PHP
Update your site to the latest version of WordPress & PHP version (at least PHP 7.0) which will make your WordPress site load faster.
By default, most of the web hosting provider gives PHP 5 or PHP 5.6. They support PHP 7 but you have to upgrade it manually.
You can check your PHP version by installing Display PHP Version Plugin.
You can also check & update your PHP version using Cpanel.
The next step is to check your themes & plugins if they are compatible with the latest PHP version. Use PHP Compatibility Checker plugins to check the compatibility.
3. Use Cache Plugin
The second most important factor after hosting is using the best cache plugins for WordPress. WP Rocket is the best all in one cache plugin to speed up your WordPress site. SiteGround users can use SG Optimizer plugin for WordPress speed optimization. Wp Fastest Cache, Asset Clean Up & Swift are some of the free cache plugins. W3 total cache is also a nice plugin but it is too complex.
With WP Rocket, you don’t need to install any other plugin. But with other cache plugins, you have to install at least 6 extra plugins, which will also increase your page sizes.
- For lazy load images & videos, you can use WP Youtube Lyte.
- To Clean your Database you can use WP-Optimize.
- Host Google Analytics locally, you can use CAOS For Analytics.
- Host Google Fonts locally, you can use OMGF.
- For Heatbeat control, you can use the Heartbeat Control plugin.
- Prefetch DNS Request you can use Pre* Party Resource Hints plugin.
WP Rocket Plugin includes all these features in One plugin, easy to use & don’t need to install any other plugins.
Best Free Alternative Of WP Rocket:
Improve WordPress Speed Using WP Fastest Cache.
This is one of the best alternatives to WP Rocket. It offers most of the setting that are required for WordPress Speed Optimization. You need to install some additional plugins for cleaning your database (WP-Optimize plugin), Lazy Load For Videos & CAOS plugin to host Google Analytics Locally.
How to optimize your WordPress site speed With WP Fastest Cache?
Install & activate the WP Fastest Cache plugin.
Go to the WP Fastest Cache Setting.
Under the setting tab:
- Cache system: Enable
- Widget cache: Turn ON (Premium)
- Preload: Enable. A pop up will appear, check all the tab, Set the pages per minute between 4-6 for shared hosting, 8-12 for VPS hosting & click OK.
- Logged-IN Users: Enable.
- Mobile: Enable.
- Mobile Theme: Turn ON. It caches the mobile theme. (premium)
- New Post: Enable. A pop up will appear & select Clear all cache.
- Update Post: Enable. A pop up will appear & select clear all cache.
- Minify HTML: Turn On.
- Minify HTML Plus: Turn On (Premium).
- Minify CSS: On.
- Minify CSS Plus: On (premium).
- Combine CSS: Enable.
- Minify Js: Enable (premium).
- Combine Js: Enable. Uncheck this if you are using the premium version.
- Combine Js Plus: Enable. (premium)
- Gzip: Check this box.
- Browser caching: On.
- Disable Emojis: Turn On.
Finally, Click on the Submit button.
Step 2: Delete Cache Tab
- Click on Delete Cache & Minify CSS/Js.
Step 3: Cache Timeout
- Set timeout Rule to clear all cache – Once a Day.
Step 4: Image Optimization
This is a premium feature to optimize your images and improve your WordPress website loading time. If you are using any image optimization plugin like WP Smush, Short Pixel or Imagify then uninstall these plugin & only use WP fastest cache plugin image optimization. Using 2 or more plugins for the same work might break your site.
Step 5: Exclude
In this tab, you can exclude pages from being cached. For Woocommerce users, exclude checkout pages.
Step 6: CDN
Connect your CDN with WP Fastest Cache. Content Delivery Network (CDN) makes your WordPress site load faster & also adds additional security to your site like protecting from a DDOS attack, Blocking bat bots, etc.
Reduce WordPress load Time Using Autoptimize Plugin
Install & activate Autoptimize plugin.
Go to Setting> Autoptimize
- Optimize JavaScipt Code = Turn On.
- Aggregate JS- files = Turn On.
- Also Aggregate inline JS = Turn On.
Under CSS Options:
- Optimize CSS Code = Enable.
- Aggregate CSS files = Enable.
- Also aggregate inline CSS = Enable.
- Generate data: URLs for images = Enable.
- Inline and Defer CSS – Enable this. Run a speed test in Gtmetrix. If any CSS file is still showing, then you can line and defer the CSS file. The best tool to inline and defer CSS is criticalpathcssgenerator.
First, enter your website URL.
Next copy the entire codes from the CSS file and paste that code in the full CSS box.
Now, click on the create critical path CSS button to generate the file.
Next, copy the newly CSS file codes and paste that in the inline and defer CSS box.
If you have more than one CSS file then you can generate separate codes, just give some space in the inline and defer CSS box and paste those codes.
- Inline all CSS = disable.
- Exclude CSS from autoptimize = same as the exclude JS files, you can exclude certain CSS files.
- Optimize HTML Code = Check this option.
Experimental: Enable 404 Fallbacks: Disable this.
Also Optimize For Logged In Editors/ Administrators : This option is up to you. You can either enable or disable this for your editors/administrators.
Finally check on save setting & empty cache.
Check Out my complete blog post on Autoptimize Plugin Settings.
You can also use W3 Total Cache (but it is too complicated).
4. Clean Your WordPress Database
Post revision, trash folders, drafts, spam & trash comments, deleted WordPress plugins increase your database size which ultimately affects your WordPress website speed. These file unwanted files that WordPress stores automatically.
You can also clean your database with WP-Rocket plugins & you can schedule database cleanup. Before you start cleaning your database please backup your WordPress site.
WP-Optimize plugin is the free alternative of WP Rocket to clean your database.
How to Cleanup WordPress Database?
Install & activate WP optimize plugin.
- Click on the WP-Optimize tab on the left.
- Select the files that you want to delete by checking the box
- Then Click on the run optimization button.
Next, click the Table Tab at the top which will take you to your WordPress database Page.
If there are any Remove buttons on the right of any database folder then you can remove that. Because most of these folders are created by plugins & even after you delete those plugins their folder will be there which unnecessary increases your database size & affect your website speed. (Don’t delete any folder, if you are not sure. It may affect your website & your website can go down).
5. Disable Heartbeat Control
Disabling Heart Control of your WordPress site can help you reduce your WordPress website loading time. You can disable it With WP Rocket.
The best free alternative of Disable Heartbeat is by Heartbeat Control plugin.
6. Video Optimization
Videos can also slow down your WordPress site. So, it’s better to optimize the videos by lazy loading the videos. Again you can use WP-Rocket to video optimization.
If you are not using WP-Rocket, No Problem use WP Youtube Lyte Plugin which also does the same things.
7. Host Google Fonts Locally
8. Host Google Analytics Locally
Everyone uses Google Analytics to track their website visitor. But it also affects your WordPress site speed. So, it’s better to host Google Analytics locally. WP-Rocket Users can fix this via Add-ons status.
According to Google, a website should load within 3 seconds and the page size should not exceed 500KB. With the use of Cloudflare CDN, you can reduce your website loading time for free. If a WordPress website takes time to load then it will also increase bounce and will affect search engine ranking. Check out my complete blog on how to set up Cloudflare CDN to boost your WordPress speed & performance.
10.Use CDN (Content Delivery Network)
WordPress recommends using CDN for your site. They recommend Cloudflare, Amazon Cloudfront, MAXCDN to improve your WordPress website speed.
Wait, you might be thinking that you use Cloudflare, so is it required to use any other CDN?
Yes, there are some other CDN providers that have more data centers which result in more speed.
11. Serve Scaled Images
You might be getting this warning in your speed test to serve scaled images. It means you have resized those images that are appearing in a smaller size. Gtmetrix tells you the correct image dimension.
How to Fix Serve Scaled Images In WordPress?
To fix this, You have to download those images, resize it according to the dimension given in Gtmetrix and replace it.
12. Specify Image Dimensions
Specify image dimensions means that the width & height of the images is blanked in HTML. This mainly happens in the Widgets. Gtmetrix will provide you the correct dimension for that image & you just need to insert it.
How to Fix Specify Image Dimensions?
Go to the widget area, find the widget where width & height are missing. You just insert the correct width & height (see the example below).
13. Image Compression
Images play an important role in your website speed. If you are using heavy images then it will slow down your WordPress site.
Optimize your images with the WP Smush plugin. This plugin has both free & paid version. I use WP Smush over any other image compression plugin. You can also use Imagify or ShortPixel plugin (both are free but they monthly limit).
Note: Use JPG format images instead of PNG or any other format. You might be thinking what’s the difference?
Well, The JPG format images files are smaller in size although it slightly reduces the image quality. But PNG format images are a little bit heavier as compared to JPG Images.
You can easily convert any PNG images into JPG by using an image converter tool. There are many online image converter sites are available where you can upload your PNG images & the site will convert those PNG images into JPG format in a smaller size. The online image converter tool that I use is PNG2JPG.com.
All the images In Digirockstar are JPG images.
Best Image Optimization Plugin For WordPress:
Optimize your images With WP Smush
Install & activate the plugin.
Click on the WP Smush tab.
Step 1: Bulk Smush tab setting:
- Image sizes: All
- Automatic compression: ON
- Metadata: OFF
Image Resizing: On (choose max width = 2048 & max height = 2048)
Then click on the Update setting.
Step 2: Directory Smush
Choose the folder from the web directory that you want to optimize. You can also compress themes images which is one of the best features of this plugin.
Step 3: Integrations
- Gutenberg Support: OFF
- WPBakery Page Builder: Enable it if you are using the WPBakery page builder editor. Note that this feature is currently in BETA.
Click on the update setting.
Step 4: Lazy Load
- Media Types: Check ALL
- Output Locations: Check ALL
- Display & Animation: None
- Include/ Exclude : Check ALL
- Scripts: Footer
Finally, update these settings.
Step 5: CDN
This feature is available in the PRO version. You can connect your CDN with WP smush.
Step 6: Tools
- Image Resize Detection: ON
Click Update setting.
Step 7: Setting
- Color Accessibility: OFF
- Data: Keep
Finally, click on the Update setting.
If you have any unsmush images then it will appear in the WP Smush Dashboard. For the free version, this plugin compresses 50 images & it will stop after 50 images. You have again click the Smush button to start the image compression process.
For PRO version it compresses even more without any limit.
14. Remove Unnecessary Themes & Plugins
Delete unnecessary themes & plugins that you don’t use anymore. Even for Google Analytics don’t use a plugin to insert the Analytics code directly in the footer or host it locally.
15. Enable Gzip Compression
Most of the cache plugin supports Gzip compression. But still, if you are getting this warning in the Gtmerix speed test then use this plugin called check and enable gzip compression.
Gravatars takes too much time to load if you have blog comments. The best way to fix this by hosting it locally using the WP User Avatar plugin.
Go to Setting> Discussion & you can define the number of comments per page by check the break comments into pages with say 20 top-level comments per page.
17. WooCommerce Optimization
WooCommerce is one of the best plugins to start your E-commerce business using WordPress. Woocommerce is a heavy plugin with a lot of style, scripts, cart fragments & here choosing good hosting will make your work a little bit easier.
How to Speed Up Woo-Commerce Website?
The easiest way to optimize is by using Perfmatters Plugin by kinsta.
Go to the option & disable scripts, cart fragmentation, status meta box & widgets.
- Disable cart fragment using a plugin called Disable Cart Fragments by Optimocha.
Install & activate the plugin.
- Choose defer in all the options & click on save changes. (If any part of your site breaks then choose exclude under Jquery)
19. Add Expires Headers
Most cache plugins come with enable browser caching. This feature is available in WP Rocket & W3 Total cache plugin. If still “add expire header” appears in your Gtmetrix Y slow tab then use Add Expires Header plugins. Just install & activate the plugin & the work is done. This WordPress plugin doesn’t require any setting.
20. Remove Query Strings
Remove Query strings in WordPress are mainly cause by plugins & it took me too much time to fix this. With WP Rocket you can fix this by going to file optimization & checking the remove query strings from static resources option.
With W3 total cache, you can also fix this by clicking on performance > Browser cache & check to Remove query strings from static resources.
Autoptimize plugin also has the option to remove the query string.
21. Minimize Redirects
If you are getting this warning in your Gtmetrix speed test, then the main reason can be SSL certificate issue (redirecting Http:// to Https), WWW & non-WWW version of your site. The easiest way to solve this with Better Search Replace plugin.
22. Use Light Weight Themes
Choosing the best theme for your WordPress site is also an important task. If your WordPress site is slow since the beginning, then there can be two things that are responsible for slowing your WordPress site one can be your hosting and second might be your theme.
Here are some of the light-weighted themes that you can try:
GeneratePress theme is one of the best lightweight themes that focus on speed & usability. This theme has 929 reviews & all these reviews are 5 stars. You can build a blog, eCommerce store, a business website or any type of website.
GeneratePress has both free & paid version. The paid version has many additional features including access to the site-library. Check out our complete list of best fastest loading themes for WordPress.
OceanWp is another lightweight theme with a faster page load time. This theme has almost 3000 plus 5-star reviews. Similar to GeneratePress, OceanWp is all in one theme & you can build all types of websites. They have both free & paid plans to choose from.
23. Block Bad Bots
Search engines use bots to crawl your website. But some fake bots crawl your site consume the most CPU power which also affects your WordPress website speed.
How to Block Bad Bots in WordPress?
To solve this, use the Wordfence plugin that has a feature to limit crawler & it block spammers.
Install & activate the Wordfence plugin.
- Go to the wordfence setting & click on all options.
- Scroll down to the Rate Limiting option.
- Change the following setting:
- Enable rate limiting & advanced blocking: ON.
- If anyone’s requests exceed: 30 per minute.
- If a crawler’s page views exceed: 240 per minute.
The next thing is to block spammy bots. The wordfence live traffic report will help you. The live report shows 4 colors. Green colors for human, grey for the bot, yellow for warning & red for blocked. Block those sites that if it appears in red color. Do a google search if you think any crawl site can be a bad bot.
Here is an example for you. I was checking my live report & saw bot is from China is crawling my site. The hostname is Bytedance (the parent company of Tiktok) is crawling my site. So, I block this bot.
You can also use Block bad queries plugin which also block bad bots. Just install & activate the plugin. The best part of this plugin is you don’t need any configuration.
24. Disable Plugin On Specific Page
Some WordPress plugins loads on all the pages but they are not required. Here is an example, if you use contact form 7 plugin, it loads in all the posts & pages which is not required. You can solve this by using the Asset Cleanup plugin.
This plugin is also another WordPress speed optimization plugin & makes your site faster & lighter.
Steps to Disable plugin on Specific page:
- Step 1: Install & activate asset clean up plugin.
- Step 2: Go to the asset clean up setting. Under the setting tab, click on general & file management.
- Step 3: Turn on manage in the dashboard option. This will show all the files that are loading on that page.
- Step 4: Open each page, posts & disable those scripts that are not required on that page. You can set contact form 7 to load only in the contact page, social sharing is not required in pages, it only requires in the blog post to content in social media, Google Maps should load only contact page, etc. You can disable these scripts which ultimately helps your WordPress website to reduce page load time.
25. External Resources
External Resources means pulling information from any external website. The best example is Google Analytics, Google fonts & Youtube videos. You can solve these by hosting it locally as mentioned above.
But there are some external scripts that badly affect your WordPress website speed & are very difficult to optimize especially Google Adsense, Chatbots, etc. But with the Flying Script plugin, you can optimize your 3rd party JS scripts. This plugin loads the external JS scripts after the web page loads completely. You can even set the timing of the loading of 3rd party scripts.
All you have to do I add a keyword of that script for example – use the keyword “gtag” for Google Tag Manager”, Fbevents.js for Facebook Pixel, etc.
You can also join their Facebook group – WP Speed Matters.
26. Convert All Images In WEBP
WEBP is a new image format that lighter than JPG images. Now, almost all the browsers are supporting.WEBP images. Convert all your images in WEBP format to improve your WordPress website speed.
You can use the WEBP Express plugin to convert all your images.
WEBP Express Plugin Settings:
Operation Mode: Choose Varied Image Responses.
Scope: All content.
Image types to work on: Both jpegs and pngs.
Destination folder: Mingled.
File Extension: Append”.webp”.
Destination structure: Document root.
Cache-control header: Do not set.
Enable Direct redirection to exist converted images? : Check this box.
Jpeg Options: Let it be default.
Png options: let it be default.
Metadata: No metadata in webp.
Convert on Upload: check this box
Bulk convert: Convert all your images in webp from here.
Alter HTML: Check this box.
What To Replace: Choose Replace Image URLs & check the box of only do the replacements in webp enabled browsers.
How to relace: Choose the complete page option.
Finally Click On Save Settings.
Apply only those techniques that are required in your WordPress website. You don’t need all the speed optimization tips to reduce page load time.
As I mentioned above that speeding up your WordPress site will improve user experience, increases traffic, boost ranking in search results & uses less bandwidth.
Apply these WordPress speed optimization tips in your site & you’ll be surprised when you compare the speed test report before & after implementing these tips. Please share your GTmetrix, page speed insight or Pingdom score in the comments.
Did I miss anything? If so, please mention in the comment box, I will try to add those. If you have any queries regarding how to speed up your WordPress site then fill free to comment below.
STARTING AT $2.99/MONTH
STARTING AT $10/MONTH
STARTING AT $20.83/MONTH