Web page speed is now a ranking factor. If your site is slow and takes a longer time to load then you may lose traffic and revenue. That’s why you need WordPress speed optimization to make your WordPress site load faster. In this tutorial, I will show you the Top 11 ways to speed up WordPress website.
Why Speed is so Important for a Website?
From June 2021, Google use Page Experience as a ranking factor. If your site’s webpage fails in Core Web Vital, especially on mobile phones, then you might be seen some down in your search engine ranking.
Some years ago, the average speed is slow on mobile devices and users prefer computers for internet browsing. Many sites are optimized for computers and take longer on mobile phones device.
These days, most people use mobile phones and do daily searches on them. 70% of my traffic is from mobile devices. My site PageSpeed Score is also good for Desktop and low for mobile phones. That means my website is slower compared to my desktop. So we need to optimize the WordPress site for mobile users and increase WordPress website speed for that user too.
So Google made this update to push people to optimize their site for mobile phones.
Why websites are slow?
There are many bad things behind a slow website e.g. slow web hosting, heavy traffic, heavy page builder, many unwanted plugins, unoptimized or poorly coded theme and plugins, slowed PHP version, not use of a good cache plugin etc. but here we talked about some most common things about slow WordPress website.
#1. Slow Web Hosting
Every web hosting company tell them the best but only a few are good. Slow and poor resources websites will never give you a better and fast loading experience. I tried many hosting companies in my starting days like Ho**Gator, Bl**host etc and found that they all are slow, very slow.
Many web hosting companies still use HDD which is completely outdated. Hosting like shared hosting have very low resources to run a website. Starting with shared hosting is good but you will never get the best result with them. You can check the TTFB of your shared hosting using the KeyCDN Performance Test tool.
I recommend Cloudways that I used before and it is fast, reliable and managed so you don’t need to worry about your hosting.
#2 Server location
The far your server is from your user, the more time your website takes to load. Maybe this is the most ignored reason by website owners when they think about speeding up their site. If your server is far from your user then it takes longer to communicate and receive a response from the server, so this will take more time to load.
To solve this issue, people try to use a CDN. But using CDN only serve assets file through their server edge, not HTML files. Hence, only CSS, JS, Images, fonts etc will be loaded fast. But what about HTML? This will load from your server, so the distance of your server really matters here.
💡Hint: Modern CDN like Cloudflare(paid plan) and Quick.cloud CDN has full-page caching to solve this problem.
#3 Poor Coded Theme and Plugin
Poorly coded themes and plugins can significantly impact the loading speed of a WordPress website. Loading speed is crucial for user experience, SEO, and overall website performance. Here’s how poorly coded themes and plugins can affect loading speed:
- Excessive Server Requests: Poorly coded themes and plugins might make unnecessary or excessive requests to the server. This can lead to a higher server load and longer loading times.
- Bloated Code: If the code of a theme or plugin is bloated with unnecessary elements, functions, or styles, it can slow down the rendering process. The browser has to process more code than necessary, leading to slower loading times.
- Large File Sizes: Themes and plugins with poorly optimized assets such as images, scripts, and stylesheets can result in larger file sizes. Large files take more time to download, especially for users with slower internet connections or on mobile devices.
- Inefficient Database Queries: Plugins might execute inefficient database queries, causing the database to work harder than necessary. This can slow down the retrieval of content and other data required for the page.
- Lack of Caching and Minification: Poorly coded themes and plugins might not support caching or minification, essential techniques for optimizing loading speed. Caching stores frequently accessed data, while minification reduces the size of code files.
- Compatibility Issues: Themes and plugins that aren’t well-coded might not be compatible with other components of the website, leading to conflicts and errors. These conflicts can further slow down the loading process.
- Memory Consumption: Poorly coded plugins or themes can consume more server memory than necessary, causing performance issues and potential crashes, which in turn affects loading speed.
- Security Vulnerabilities: Badly coded themes and plugins could contain security vulnerabilities that could be exploited by malicious actors. While this doesn’t directly impact loading speed, security breaches can lead to downtime or data breaches, indirectly affecting user experience.
#4 Unoptimised Images
We all use images on our site that are heavies part of a webpage. Unoptimised images will add unnecessary load time.
- Increased Page Size: Large and unoptimized images contribute to the overall size of your webpage. When a user visits your site, their browser needs to download all the page’s assets, including images. Larger images result in more data being transferred, leading to slower loading times, especially on slower internet connections or mobile devices.
- Slower Download Times: Unoptimized images take longer to download, which can result in a slower overall page load time. Users might lose patience and leave the site before it fully loads, leading to a poor user experience.
- Higher Bandwidth Usage: Websites with unoptimized images use more bandwidth, not only affecting your visitors but also potentially incurring additional hosting costs, especially if you’re charged based on data usage.
- Delayed Rendering: Browsers load web pages from top to bottom. If a large unoptimized image is placed near the top of the page, it can delay the rendering of other page elements, making the page appear slower to users.
- Mobile Experience: Mobile devices often have slower internet connections and smaller screens. Unoptimized images can be particularly problematic on mobile, as they increase data usage and can cause content to load improperly, negatively impacting user experience.
- SEO Impact: Page loading speed is a factor in search engine rankings. Search engines like Google consider user experience important, and slow-loading pages might be ranked lower in search results.
I always recommend using WebP image format because it is smaller in size and the quality is almost the same as JPG and PNG. You can convert any JPG and PNG image to a WebP image using WebP Converter Tool.
#5 Not Using Caching
Without caching, the browser has to download all of the resources every time the user visits your website. This can significantly slow down the loading speed of your website, especially for pages that contain a lot of static resources.
In addition to slowing down the loading speed of your website, not using caching can also increase the load on your server. This is because the server has to send the same resources to the user every time they visit your website, even if they have already visited your website before.
There are mainly three types of caching that are helpful in fast page-loading sites –
- Page Cache – Generate an HTML copy and store it on the disk
- Server-side cache – Storing website data on the server to speed up loading times for users.
- Object Cache – Object-side caching is a technique that stores specific website elements to enhance loading speed and performance. Redis Object Cache and Memcached are good examples of it.
- CDN Caching – Create a copy of the webpage, CSS, images, videos, font etc, store it on the CDN edge server, and directly deliver it to visitors. Hence, it reduces requests from a web server and speeds up your site worldwide. I also improve Time to First Byte (TTFB). Cloudflare APO and Quic.cloud full page caching are two good examples of it.
#6 Use of Large CSS and JS
Unoptimized and large CSS and JS files can significantly slow down a website’s loading speed and overall performance. These files contain instructions for styling (CSS) and functionality (JS) of a webpage. When they’re unoptimized and large, they take longer to download, increasing the time it takes for the page to fully load.
This delay can frustrate users, lead to higher bounce rates, and negatively affect SEO rankings. Optimizing CSS and JS by minifying (removing unnecessary spaces and characters) and compressing them reduces file sizes and helps improve loading speed, providing a smoother and more efficient user experience.
These are some methods to solve CSS and JS issues –
- Minify CSS and JS
- Combine CSS and JS, if the size is smaller than 10KB.
- Remove unused CSS
- Load JS as defer
- Generate Critical CSS code and use it inline.
#7 Lake of CDN
A CDN (Content Delivery Network) is a network of servers that are distributed across the globe. When you use a CDN, your website’s content is delivered from servers that are closest to your users. This can significantly improve the loading speed of your website, especially for users who are located far away from your server.
If you do not use a CDN, your website’s content will be delivered from your server. This means that the user’s browser will have to connect to your server, which can take a long time if the user is located far away from your server.
The impact of not using a CDN on the speed of your website will depend on the following factors:
- The location of your users. If your users are located all over the world, not using a CDN can have a significant impact on the speed of your website.
- The size of your website. If your website is large, not using a CDN can also have a significant impact on the speed of your website.
- The type of content on your website. If your website contains a lot of static resources, such as images and CSS files, not using a CDN can have a significant impact on the speed of your website.
In general, not using a CDN can have a significant impact on the speed of your website. If you want to improve the speed of your website, you should consider using a CDN. BunnyCDN and Quic Cloud CDN are the two best CDN at the cheapest price. Cloudflare is the best free CDN but sometimes it lows down website because of its routing issues.
How to Speed Up WordPress Website and Boost Site Performance?
Here, I shared A-to-Z complete guidance to optimize your WordPress site.
1. Switch to a Good Web Hosting
Low-quality, cheap web hosting provides insufficient resources to run smoothly. Migrate your website to a powerful web host like Cloudways, Kinsta and WPEngine to get higher performance. Here are some good web hosting for super fast page loading and providing high performance to your site.
Cloudways is a managed cloud hosting platform that helps you host your websites on top of cloud providers like DigitalOcean, Linode, Vultr, Amazon Web Services, and Google Cloud Platform.
Cloudways is the most recommended choice by many peoples in the WP Speed Matters Facebook group. Many people got good results after moving to Cloudways. Check these comments on Facebook group.
There are a lot of alternatives to Cloudways like SiteGround, A2hosting, Hostinger etc but there is no match to Cloudways in terms of performance. Cloudways provides better TTFB than all of these. Also, you can choose your nearest server location and also choose cloud hosting providers like DigitalOcean, Vultr, Google Cloud and AWS.
Sign Up using the below link and Get $50 Hosting Credits.
Disclaimer: If you use the above link, we will get some affiliate money with no extra charge to you. You also get a free $50 hosting credit 😊
2. Implement a CDN
CDN or Content Delivery Network improve significantly in page loading time. A CDN like Cloudflare and BunnyCDN cache assets files and deliver through its global network. It also reduces server load. Here are my three recommended best CDN to get fast page load time.
BunnyCDN is a content delivery network (CDN) that helps to improve the performance and security of websites. It is a popular choice for businesses of all sizes, as it offers a wide range of features and services at an affordable price.
According to cdnperf, BunnyCDN is the fastest CDN and lowest response time. It has a 25.61 ms query speed which is lower than many expansive CDN networks.
You can sign up using the below link and Get FREE for 14 days. No need to pay anything and no card is required.
Some of the key features of BunnyCDN include:
- The global network of servers: BunnyCDN has a global network of servers, which means that your website’s content will be delivered from the server that is closest to your visitors. This can help to improve the loading speed of your website, especially for visitors who are located far away from your server.
- High performance: BunnyCDN is designed to deliver high-performance content. It uses a variety of techniques to improve loading speeds, such as caching, compression, and optimization.
- Security: BunnyCDN takes security seriously. It offers a variety of security features, such as firewalls, intrusion detection, and malware scanning.
- Affordable pricing: BunnyCDN offers a variety of pricing plans to fit the needs of businesses of all sizes.
3. Use Premium DNS
Premium DNS reduces FID timing. I suggest you use Cloudflare even if you don’t want to use its CDN service. Cloudflare DNS is one of the fastest DNS in the world. By DNSPerf.com, Cloudflare has a 13.25 ms response time which is the fastest in the world.
4. Use a Cache Plugin
Never expect faster page load time without using a cache plugin. The cache plugin generates static HTML page and directly serve them to the user. Hence, it avoids running PHP queries every time when a user comes to your site. Here are some best Cache plugins for WordPress websites.
LiteSpeed Cache Plugin
LiteSpeed Cache plugin is one of the most popular cache and website optimization plugins. If you have a LiteSpeed or OpenLiteSpeed Web server then you will get the server-level caching advantage. It also works with Apache and NGINX web servers but you won’t get server-level caching advantage. In case of NGINX server, I suggest you use WP Rocket or FlyingPress.
Features of LiteSpeed Cache Plugin:
- Page Caching: LiteSpeed Cache Plugin offers powerful page caching that stores static HTML versions of your pages, drastically reducing server load and improving website loading times.
- Browser Cache: It enables efficient caching on users’ browsers, allowing returning visitors to experience even faster load times by retrieving resources from their local cache.
- Object Cache: This feature stores database queries and PHP objects in memory, reducing the need to fetch data from the database, resulting in faster data retrieval and processing.
- Remove Unused CSS: Removing unwanted CSS that is not used by the webpage will significantly improve webpage load time. This will give you a better score in page speed insight and fix your core web vitals.
- Image Optimization: LiteSpeed Cache Plugin optimizes images by automatically compressing and resizing them, leading to reduced page sizes and faster loading without sacrificing image quality.
- Content Delivery Network (CDN) Integration: The plugin seamlessly integrates with various CDNs, enabling efficient content distribution across a global network of servers for faster delivery to users around the world.
- Lazy Load Images: Images are loaded only when they come into the user’s viewport, saving bandwidth and improving initial page load times.
- Database Optimization: LiteSpeed Cache Plugin offers database cleanup and optimization tools, improving the efficiency and speed of database queries.
- Mobile Optimization: It provides features like Mobile Device Detection and Mobile Viewport Optimization to ensure an optimized experience for mobile users.
FyingPress is a premium WordPress Caching and Optimization plugin by Gijo Varghese. It comes with the most advanced WordPress speed option and works with any kind of web server like NGINX, Apache, LiteSpeed and OpenLiteSpeed.
If you have a low Core Web Vitals score, then you should try this plugin. You will fix most of the issues related to your WordPress website.
Features of FlyingPress Plugin:
- Performance Optimization: FlyingPress offers comprehensive performance optimization features, including page caching, preloading, and advanced techniques like critical CSS generation, resulting in significantly improved website loading times.
- Automatic Preloading: The plugin intelligently preloads pages, ensuring that visitors experience minimal wait times when navigating your site, enhancing user experience.
- Gzip Compression: FlyingPress enables Gzip compression for your website’s resources, reducing file sizes and accelerating content delivery to users’ browsers.
- Image Optimization: The plugin optimizes images by compressing and resizing them, reducing their impact on page load times while maintaining visual quality.
- Database Cleanup: FlyingPress offers tools for cleaning and optimizing your WordPress database, reducing clutter and improving query performance.
- Browser Caching: This feature allows browsers to store static assets locally, leading to faster subsequent visits as the browser retrieves resources from the cache.
- Lazy Loading: FlyingPress implements lazy loading for images and iframes, ensuring that off-screen elements are only loaded when they become visible, saving bandwidth and improving speed.
- CDN Integration: The plugin integrates seamlessly with Content Delivery Networks (CDNs), enhancing global content distribution and reducing latency for users around the world.
- Object caching: WP Rocket can also cache objects, such as WordPress posts, pages, and comments. This can further improve the loading speed of your website by reducing the number of queries that need to be made to your database.
- Gzip compression: WP Rocket can compress static resources using Gzip compression. This can further reduce the size of your website’s files, which can improve the loading speed.
- CDN integration: WP Rocket can integrate with popular CDNs, such as CloudFlare and MaxCDN. This can help to improve the performance of your website by delivering static resources from servers that are closer to your visitors.
- Mobile caching: WP Rocket can serve different cached versions of your website to mobile devices. This can help to improve the loading speed of your website for mobile users.
- Lazy loading: WP Rocket can lazy load images and other resources. This means that they will only be loaded when they are needed, which can improve the loading speed of your website.
- Optimization: WP Rocket can optimize your database. This means that it will remove unnecessary data and improve the performance of your website.
- Cloudflare APO Compatibility: WP Rocket is compatible with Cloudflare APO which means it will purge Cloudflare cache when you clear the WP Rocket cache.
WP Rocket is a powerful caching plugin that can help to improve the performance of your WordPress website. It is easy to use and configure, and it offers a variety of features that can help to improve the loading speed of your website.
5. Optimise Images and use WebP Format
Images are the heaviest part of a web page. Many people use images as it is that cause website speed. Compressing images is a solution to it. This will save up to 70% in size without losing image quality.
reSmush.it, Shortpixle and WebP Express are some good free plugins to compress the image files of your site. If you are using the LiteSpeed plugin then use its image optimization service that optimizes the image.
Resize images: Properly resizing images and serving them will cut some size and improve web page loading. Many plugins like Shortpixle automatically resize images and serve them but I recommend you to manually do it before uploading.
Serve image in WebP: WebP is the next-gen image format made by Google. It is almost half of a PNG image in terms of size and almost the same in terms of quality. That means if your convert and serve a PNG image in WebP format, then this will cut down half of the image file size without losing image quality.
Many image optimization plugins like Shortpixle automatically convert and serve WebP images. But if you are looking for a free plugin then WebP Express is a good choice. LiteSpeed plugin users use the Image Optimization option to convert WebP files.
Lazy Load images
Lazy loading images only loads the images that are visible on the screen, This can improve the loading speed of your website by preventing the browser from having to load all of the images on the page at once.
From WordPress 5.5 version, it will add loading=”lazy” to all img tags that have width and height attributes present. So you do not need to use any external plugin to lazy load images. LiteSpeed plugin, WP Rocket, FlyingPress etc also have this feature in it.
Make sure you exclude the images that are present in above the fold area. For example, your website’s logo doesn’t need a lazy load so you exclude it otherwise this will increase the LCP score of your website.
How to exclude images from lazy load in LiteSpeed cache: Go to LiteSpeed Cache > Page Optimization > Media Excludes and add your logo URL in Lazy Load Image Excludes section. Also, enable Viewport Images and Viewport Images Cron option in VIP section.
How to disable lazy-load on specific images: Read this official documentation.
Lazy Load Iframe
It is super useful if you embed YouTube videos on your WordPress website. Iframe starts loading if the user scrolls down and visits it. This will significantly save website loading time. You can
6. Minify CSS and JS Files
In LiteSpeed Cache Plugin, Go to LiteSpeed Cache > Page Optimization and enable CSS Minify, JS Minify, and HTML Minify.
Disable jQuery Migrate
jQuery Migrate is a JS library that ensures older jQuery code remains compatible with newer versions. But it became less necessary these days. If you are using latest theme and plugin then you don’t need jQuery Migrate. So, you will get better performance by disabling jQuery Migrate. Check this post How to Disable jQuery Migrate in WordPress.
7. Remove Unused CSS
Removing unwanted CSS is the process of removing CSS code from your website that is not being used. This can help to improve the loading speed of your website by reducing the size of your CSS files.
- Faster Loading Times: By removing unused CSS, you reduce the amount of code that browsers need to process. This results in quicker loading times and improved page speed.
- Reduced File Size: Eliminating unused CSS reduces the size of CSS files, leading to reduced bandwidth usage and faster downloads for users.
- Optimized Rendering: Browsers render pages faster when they don’t have to parse through unnecessary styles, contributing to a smoother user experience.
- Savings on Resources: Websites load more efficiently, consuming fewer resources on both the server and client side. This is especially beneficial for users on slower connections or devices.
How to remove unused CSS on a WordPress site:
Method 1: Enable Generate UCSS in LiteSpeed Cache Plugin
Go to your LiteSpeed Cache plugin, choose the Page Optimization option and enable Generate UCSS in CSS Settings tab. This will automatically process and remove unwanted CSS from your site.
Method 2: Remove Unused CSS in WP Rocket
If you are using WP Rocket on your site then it is easy to remove UCSS from your site. Go to Settings > WP Rocket > File Optimization and turn on Optimize CSS Delivery. You must choose to Remove Unused CSS option.
8. Preconnect and Prefetch Domain
DNS prefetching is a technique used by web browsers to improve the performance of a web page by resolving domain names in the background before they are actually needed. These methods resolved DNS before they were requested.
Pre-connect and prefetching DNS will help you to save some milliseconds while loading your website. These days, most good speed optimization plugin like LiteSpeed Cache, and WP Rocket has an option to easily add domains to prefetch.
In WP Rocket, go to Preload settings. In LiteSpeed Cache Plugin, you can find this setting in Page Optimization > HTML Settings > DNS Prefetch.
To add pre-fetching domains manually, you can add this code manually in your website’s header.
<link rel="dns-prefetch" href="https://actualpost.com">
<link rel="preconnect" href="https://cdn.actualpost.com">
Note: Please use preconnect for your subdomain only.
You should add all domains used by your site in pre-fetch settings. You can add AdSense and Advertising network’s domain names so they can load faster.
9. Disable WordPress Cron Job and Use Real cron job
A WordPress cron job is a scheduled task system within the WordPress framework that automates various actions, such as publishing scheduled posts, checking for updates, sending email notifications, and running various maintenance tasks.
WordPress cron jobs work by checking the current time every time a user visits a page on your website. If a scheduled task is due, the cron job triggers the associated action. While this system is convenient and user-friendly, it can impact the performance of your WordPress website.
To disable the WordPress cron job, you can follow these steps:
1. Edit wp-config.php:
wp-config.php file in the root directory of your WordPress installation using a text editor or an FTP client. Add the following line of code just before the “That’s all, stop editing!” comment:
2. Setup a real cron job:
Since you’ve disabled the default WordPress cron, you’ll need to set up a server cron job to replace it. Access your server’s control panel or use SSH to edit the crontab.
If you’re using cPanel or a similar control panel, find cron job section, choose every 15 min and add following command:
wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
NOTE: Replace yourdomain.com with your actual domain.
If you’re using SSH:
crontab -eto edit your user’s cron jobs.
- Add a line like the one below to run the WordPress cron at your desired interval (e.g. every 15 minutes):
*/15 * * * * wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Note: Please replace
yourdomain.com with your actual domain and press
Ctrl+O to save it. Now press
Ctrl+X to exit.
10. Use System Font
When you use system fonts in WordPress, you’re essentially utilizing fonts that are already present on users’ computers, smartphones, or tablets. This can be beneficial for website performance because it reduces the need to download additional font files from external servers, which can slow down the loading time of a web page.
Themes like Kadence and GeneratePress have the option to choose a system font. You can select System font in the Typography settings available in Customize option.
Use Swap for Display Font:
When a web page is loaded and uses custom fonts(or Google Font), browsers might initially display a fallback font until the custom font is downloaded. With font-display: swap, the browser quickly displays the fallback font and then swaps it out for the custom font once it’s ready. This speeds up the rendering of text, providing a more seamless experience.
You can use Swap Google Fonts Display WordPress plugin to Swap Google fonts. LiteSpeed Cache has a similar option in Page Optimization > CSS Settings. WP Rocket also has a similar feature.
11. Use Good coded themes and plugins
Poorly coded themes and plugins will always be a concern for WordPress speed. Many plugins come with bloated that slow down websites. Always do the study before installing any plugin on your site. Here is a list of themes and plugins that I recommend using. They are fast and bloat-free(or less bloated):
- Kadence (I use)
- Genesis Framework
- Rank Math for SEO
- LiteSpeed or FlyingPress or WP Rocket for Caching and Optimization
- Updraft for backups
- Advanced Ads for Ads Placements
- Forgot Spam Comment or Akismet for Spam Protection
Best WordPress plugins to speed up website
Here are the best WordPress speed optimization plugins and tools that we recommend to use on your site –
- LiteSpeed Cache Plugin if you have LiteSpeed or OpenLiteSpeed webserver
- WP Rocket – Premium Caching and WordPress Site Optimization Plugin
- FlyingPress – The most advanced Caching Plugin by Gijo Varghese
- BunnyCDN – Best CDN at a Very Affordable price
- Super Page Cache for Cloudflare – Cache your website at Cloudflare’s CDN Edge for Free
- WebP Express – Automatically convert images to WebP Format
- Free WebP Converter – Convert image to WebP before uploading to WordPress
- WP-Optimize – Clean and Optimize Database (Uninstall after use)
- Swap Google Fonts Display – A plugin to Ensure text remains visible during webfont load(don’t need if your WordPress speed optimization plugin already has this feature)
Website loading speed is important for a good user experience and better SEO ranking. Using the above guide, you can achieve maximum loading speed for your website. We covered almost every parameter that will fix a slow website and Speed Up WordPress Website. If you have any problems or any questions regarding WordPress Speed Optimization, you can ask them below.