Faster WordPress site can provide users with a better user experience, increase website page views, and improve website SEO rankings, because speed has now become a ranking factor in Google search.
In this guide, I will show you how to speed up WordPress site.
The following website speed optimization measures are more biased towards Server Level.
1. Avoid bad servers and web hosting companies, Choose fast and optimized web hosting services
Your choice of hosting company and the server that it uses to store your website can have a significant impact on page speed. If you make the wrong choice, both your visitors and your business are likely to suffer.
When choosing a web hosting provider, you need to pay attention to some key features, including:
Equipment – Solid State Drives (SSDs) are much faster than mechanical drives.
Bandwidth – This is what affects how much data your web host can actually transfer. The more restricted it is, the longer it will take to transmit the data. With that in mind, you can calculate how much bandwidth you will need to help determine if a certain hosting plan will work for you.
2. Choose the right web server
Apache HTTP Server is an open-source cross-platform web server which is also known as “httpd” and Apache.
Nginx [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server, originally written by Igor Sysoev.
The main difference between Apache and Nginx lies in their design architecture. Apache uses a process-driven approach and creates a new thread for each request. Whereas Nginx uses an event-driven architecture to handle multiple requests within one thread.
Apache and Nginx share many qualities, they are also different in many areas. Each excels in its own way and has its own uses and scenarios.
Static: As far as Static content is concerned, Nginx overpasses Apache.
Dynamic: Both are great at processing Dynamic content.
LiteSpeed Web Server is often compared directly to Apache, as it was designed to be a drop-in-replacement. But LiteSpeed Web Server is not based on Apache code. In fact, it has more in common with nginx, when you look under the hood.
Like nginx, LSWS was built from the ground up to use an event-driven architecture, which is more efficient and better-performing than Apache’s process-based model. But unlike nginx, LSWS was designed to understand Apache’s configuration files, mod_security rules, and mod_rewrite rules. And it supports .htaccess natively, in a much more efficient way. Because of this compatibility, LiteSpeed Web Server may be used with any control panel that was written for Apache, including cPanel, Plesk, and DirectAdmin.
With LiteSpeed, you get the best of both worlds: event-driven scalability similar to nginx, and the ability to use familiar and ubiquitous Apache tools for all of your management tasks.
3. Use Nginx FastCGI Cache
If you use Nginx Web Server, you should enable FastCGI Cache, FastCGI Cache is server side page cache solution. Nginx comes with FastCGI caching built in, and no plugin based solution will ever match the performance of Nginx server based static asset and page caching. When using Nginx FastCGI, this built-in Nginx module will be in between Nginx and PHP-FPM and it is able to generate a cached HTML page from PHP-FPM. When another user visits the same WordPress page, your website will not perform the same PHP and database requests again because the page is already cached and served by FastCGI. I recommend making such edits using the staging feature and then pushing to live.
When you use Nginx FastCGI Cache, you can forget other WordPress Caching Plugins.
4. Use Memory Object Caching System-Such as Redis or Memcached
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It can be combined with other databases like MySQL to provide a mechanism to cache your queries.
Memcached is a free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.
Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
Memcached is simple yet powerful. Its simple design promotes quick deployment, ease of development, and solves many problems facing large data caches. Its API is available for most popular languages.
You can use Webinoly or WordOps to install Redis.
5. Use Redis Full-Page Cache
Redis Full-Page Cache use Redis to stores the page cache in memory. The ability to store the cache in memory makes it faster than all other page caching plugins.
6. Use PHP accelerators – Such as OPcache
OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request. Search for PHP optimization for more information.
You can use Webinoly or WordOps to install OPcache.
You can read these two articles for a detailed installation of Webinoly and WordOps
7. Use the Latest Version Of PHP and MySQL/MariaDB
It’s recommended that your server uses the most stable version of PHP. MySQL or MariaDB optimization is a black art in itself. A few simple changes to the query cache settings can have a dramatic effect on WordPress performance because WordPress repeats a lot of queries on every request. Nowadays, with InnoDB being the default storage engine for MySQL, you have to make sure to use that. InnoDB can be optimized and fine-tuned, search for “mysql optimization”, “mysql innodb performance” or “innodb optimization” for more information and examples. Search for “mysql convert myisam to innodb” for information on how to convert older MyISAM tables to InnoDB.
8. Use CDN (content delivery network)
A content delivery network (CDN) refers to a geographically distributed group of servers which work together to provide fast delivery of Internet content.
CDN does not host content and can’t replace the need for proper web hosting, it does help cache content at the network edge, which improves website performance.
9. Use a Fast DNS Provider
Domain name servers handling queries regarding domain names so that internet users can locate websites. When someone types a domain name into their browser, their computer contacts the domain’s nameservers, which send back the corresponding IP address in response.
Speed also plays a role in DNS. Using a fast DNS hosting provider can ensure that the delay between DNS lookups and TTFB is reduced.
10. Install SSL Certificates
HTTP stands for Hypertext Transfer Protocol. When you enter a URL in your address bar preceded by http:// it tells the browser to connect to the website via HTTP. In turn, HTTP uses the Transmission Control Protocol (TCP) to send and receive data packets over the web to load the site you want to access.
HTTPS stands for Hypertext Transfer Protocol Secure. When you enter a URL preceded by https:// it tells the browser to connect via HTTPS, which also uses TCP. But it does so within a connection encrypted by TLS.
11. Use ECC SSL (Elliptic Curve Cryptography)
Shorter keys in ECC encryption are as strong as long keys for RSA. This results in much less network overhead, allowing faster performance and a better customer or user experience. It also means that in the long term, there is more room for growth, because each additional bit gives more options than each additional bit in RSA. That also means a slower growth in bit size over time, which makes it more scalable, potentially, for the Internet of Things.
Smaller certificate size. Again, the amount of information necessary to exchange for validation is significantly less than RAS, lowering network overhead and increasing performance, which provides an improved user or customer experience. It also improves scalability by providing an environment in which increased traffic can be handled by the server because of the lower overhead, without changing the infrastructure.
Low on CPU consumption and memory usage. For both client and server, this is an improved experience, streamlining the connection and simplifying the process. ECC consumes less computing power and battery resource. RSA certificate can hold 450 requests per second with 150 millisecond average response time where ECC requires only 75 milliseconds for responding to the same amount of requests per second. ECC has great response time when it communicates for server to desktop.
12. Enable HTTP/2
HTTP/2 is the newest version of HTTP protocol released in 2015. HTTP/2 is optimized for the modern website, improving performance without complicated hacks like domain sharding and file concatenation. It reduces the latency to serve requested content faster by doing HTTP headers data compression, Server push.
HTTP/2 demo – where you can experience latency and how fast it loads over HTTP/2 vs HTTP1.1
When you use Webinoly or WordOps to install SSL, HTTP/2 is enabled. You can also use Cloudflare To Enable HTTP/2
13. Enable HTTP/3 (QUIC)
HTTP/3 is the next proposed version of the HTTP protocol. The key difference between HTTP/3 and previous versions of the protocol is that HTTP/3 runs over QUIC instead of TCP. QUIC is a faster and more secure transport layer protocol that is designed for the needs of the modern Internet.
The main difference between HTTP/3 and HTTP/2 is HTTP/3 uses QUIC, which is built on UDP, while HTTP/2 uses TCP. In addition, HTTP/3 uses QPACK to compress headers, while HTTP/2 uses HPACK to compress headers.
You can use Cloudflare To Enable HTTP/3 (Cloudflare Network option)
14. Enable Brotli Compression
Brotli is a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling, with a compression ratio comparable to the best currently available general-purpose compression methods. It is similar in speed with deflate but offers more dense compression.
Brotli is an open source data compression method that can outperform gzip in many situations.
You can use Cloudflare To Enable Brotli Compression.
You can also use WordPress Hosting that support Brotli Compression
15. Enable TLS 1.3
Transportation Layer Security (TLS) 1.3 protocol provides unparalleled privacy and performance compared to previous versions of TLS and non-secure HTTP. TLS 1.3 makes page load times significantly faster, improving the user experience for your visitors.
You can use Cloudflare To Enable TLS 1.3
TLS 1.3 Test
16. Enable OCSP Stapling
OCSP stapling improves the OCSP protocol by letting the webserver instead of the browser query the CA on the status of SSL certificate. When the webserver contacts the SSL vendor, the CA delivers a highly secure digitally time-stamped response. Now, when the webserver connects to a browser, it binds the signed time-stamp with the SSL certificate, making the verification quicker. Instead of reaching to the CA, the browser verifies the server’s time stamp, and since it forms a reliable CA, trusts the Certificate.
OCSP stapling significantly improves the loading time of secure content and guarantees security and privacy of user data. The majority of web browsers and server platforms support OCSP stapling.
17. Block Bad Bots
Bad Bots consume your server bandwidth, take up server resources, and steal your content, this will slow down your website. By Block Bad Bots, you will save bandwidth and resources.
WordOps supports Nginx-ultimate-bad-bot-blocker
18. Use Load Balancers
The capacity of a single server is limited. Once a website gains more and more attraction the instance serving the site comes to a point where it can not handle any more users. The website starts to slow down or even become unavailable as the server goes down from the traffic.
This is the point where a load balancer enters the game. Load balancer can sale your applications and improve availability, security, and performance.
19. Enable Pagespeed Module
The PageSpeed Modules, mod_pagespeed and ngx_pagespeed, are open-source webserver modules that optimize your site automatically. PageSpeed improves web page latency by changing the resources on that web page to implement web performance best practices.
20. Use External Database
It means that we are going to host WordPress files on one server (Application server). And we are going to host our WordPress database on another server (Database server).
Our goal is to execute MySQL queries on database-server and process and display data on application-server. You can Increase the speed and reliability of your site by giving your MySQL database its own virtual private server.
21. Use Serverless Computing
Serverless is an approach to computing that offloads responsibility for common infrastructure management tasks (e.g., scaling, scheduling, patching, provisioning, etc.) to cloud providers and tools, allowing engineers to focus their time and effort on the business logic specific to their applications or process.
The most useful way to define and understand serverless is focusing on the handful of core attributes that distinguish serverless computing from other compute models, namely:
The serverless model requires no management and operation of infrastructure, enabling developers to focus more narrowly on code/custom business logic.
Serverless computing runs code only on-demand on a per-request basis, scaling transparently with the number of requests being served.
Serverless computing enables end users to pay only for resources being used, never paying for idle capacity.
Serverless is fundamentally about spending more time on code, less on infrastructure.
22. Use Serverless WordPress Hosting
23. Use Static WordPress Hosting
You can also search for Headless WordPress, Jamstack WordPress for more information.
The following website speed optimization measures are more biased towards WordPress Site Level
24. Use Fast And Lightweight WordPress Theme
The theme you choose for your WordPress site can greatly affect page speed. Usually most website owners will not modify WordPress themes to improve performance, so when choosing a theme for your website, it is important to choose an efficient and fast-loading theme.
The website speed optimization suggestions in this article also apply to other WordPress themes, even if they are not Lightweight.
25. Use WordPress Page Cache
When a page is rendered, php and mysql are used. Therefore, system needs RAM and CPU.
If many visitors come to a site, system uses lots of RAM and CPU so page is rendered so slowly. In this case, you need a cache system not to render page again and again. Cache system generates a static html file and saves. Other users reach to static html page.
When you use page caching, there are several advantages. Speed up your website, improve Google and other search engine rankings, save a lot of server resource consumption, very useful for users who host their website in a shared hosting server.
1. When you use Nginx FastCGI Cache, you can forget other WordPress Caching Plugins.
2. When you use Nginx FastCGI Cache + Redis Object Cache, you can forget other WordPress Caching Plugins.
3. When you use Nginx FastCGI Cache + Memcached Object Cache, you can forget other WordPress Caching Plugins.
4. When you use Nginx Redis Page Cache, you can forget other WordPress Caching Plugins.
5. If you want to use other WordPress Caching Plugin, I recommend using WP Rocket + Rocket-Nginx
26. WordPress Database Optimize
The WordPress database is where all the data of your website is stored. The more unnecessary data a WordPress database has, the slower your website will be.
By optimizing the database, you can eliminate all unnecessary data, thereby reducing the size of the database. The end result is faster and better overall website performance.
27. Keep your WordPress and Theme updated
WordPress is a popular software under active development. Enhancements such as new features and performance improvements are often incorporated.
Therefore, WordPress and the theme you are using must be updated to the latest version to keep up with these enhancements.
Before you initiate an update, ensure that you back up the current version of your WordPress site.
You can update WordPress and Theme manually or use plugins to manage updates.
28. Keep your plugins updated
Usually, new plugin updates bring new improvements, provide new features and ensuring your website stays secure. The outdated plugins may encounter compatibility issues with WordPress core.
Therefore, when you update the plugin, the performance and speed of the website will be improved to a certain extent. Or at least not affect the current website performance and speed.
Before you initiate an update, ensure that you back up the current version of your WordPress site.
You can update manually or use plugins to manage updates.
29. Avoid Slow Loading WordPress Plugins
As a WordPress user, you may install a lot of plugins, some plugins will take up a lot of server CPU and other resources, which will greatly affect the speed and performance of the website, especially when you use shared hosting. So you need to avoid using these plugins.
You can use Query Monitor to find your slowest loading plugins.
These plugins slow down your WordPress:
Broken Link Checker
WP Broken Link Status Checker
Contact Form 7
Dynamic Related Posts
Yet Another Related Posts Plugin
30. Remove the plugins you don’t need
Usually, the WordPress plugin integrates with your website’s database to complete its work. Whenever you run the plugin, it will add its own tables to the database.
Compressing CSS code can save a lot of bytes of data and can speed up downloading, parsing, and execution time.
33. Leveraging Browser Caching
The main reason why browser caching is important is because it reduces the load on your web server, which ultimately reduces the load time for your users. It can also reduce bandwidth consumption because the browser does not need to download static content again.
How to Leverage Browser Caching:
To enable browser caching you need to edit your HTTP headers to set expiry times for certain types of files.
34. Avoid Hosting Videos on Your Own Site
Web hosting providers usually allocate a certain amount of bandwidth and other resources to each server on the network. Too many requests for a single large file will quickly exceed the limit of the web server hosting your website. Also will eventually affect the speed of your website.
So you should never upload video files to the same web server where your WordPress site is hosted.
35. Image Optimization
The pictures in the website can enrich the content of the website and attract the attention of visitors. But if the picture is not optimized, I am afraid it will do more harm than good. In fact, unoptimized images often slow down the running speed of your WordPress website.
Using image compression is one of the fastest ways to increase page speed and minimize the total page size.
Serving images in WebP format
WebP images are smaller than JPEG and PNG images, usually reducing file size by 25-35%. This can reduce page size and improve performance, speeding up the WordPress website.
36. Lazy load images and videos
Lazy loading is a technique that delays the loading of non-critical resources when the page loads. Instead, load these non-critical resources when needed.
Suppose you have a long blog post with 30 pictures. By default, when someone visits a post, the browser will try to load all 30 pictures. Even with optimized images, this may take a while, especially on mobile devices.
However, if you lazy load the images, it will only be loaded to the top of the page that the visitor can see in the browser.
37. DNS Prefetching
DNS prefetching is the operation of resolving the IP address of a website before the user clicks a link. It attempts to solve the latency problem associated with DNS resolution (ie, the time it takes to resolve the domain name of a site to an IP address).
If you have third-party content on your website, such as videos loaded from YouTube or fonts loaded from outside, the visitor’s browser must retrieve files from that domain. DNS prefetching tells the browser to perform this connection before the file is needed, so that the connection is completed when the file is requested.
Since DNS resolution has been processed when requesting external resources, it can make your website load faster.
38. Preload WordPress pages
Preloading is a method of preloading resources (such as style sheets, script files, images) by storing them in the browser’s local cache.
By loading the requested resources from the local cache instead of downloading them from a remote server, you can speed up subsequent page requests.
39. Disable Hotlinking
Hotlinking is a common problem. This happens when people link to files and images on another server but display them on their own website. This will consumes the bandwidth of the original owner and it reduces the performance of actual users visiting your website.
Cloudflare HotLink Protection
40. Disable or Limit WordPress Post Revisions
Every time you click the “Save Draft” button in the WordPress editor, WordPress saves a copy of the post, called WordPress Post revisions.
Although WordPress revisions can be nice to have, but each revision is a new entry in the WordPress website database. All these revisions will insert unnecessary bloat into the database, especially for old posts where you are unlikely to need access to these revisions. So if your WordPress website have a lot of revisions may slow down your website. By disabling them can help keep your website fast.
41. Disable Emojis in WordPress
There are many ways to optimize WordPress performance to make your WordPress website load faster. A simple optimization method is to disable the loading of emojis. Emojis are small icons used to express ideas or emotions. Although these icons are interesting, they are not necessary for WordPress all the time. On the contrary, these will only increase unnecessary additional loading time.
42. Disable Embeds in WordPress
43. Remove Query Strings from Static Resources
Query strings are the URLs that you see containing special characters such as ? and &. An example of a query string may resemble something like this: domain.com/wp-includes/css/ style.css?ver=3.2.7
If you keep these query strings, it may cause caching problems. Some proxy caching servers, and even some CDNs, cannot cache static assets with query strings, resulting in a lot of missed opportunities for speed. So it’s very important to remove query strings from static resources.
44. Use clean and minimal homepage design
Basically, the more elements on your homepage, the more time it takes to load them.
Always optimize your blog homepage, don’t display too many posts or infinite scrolling pagination. Remove unnecessary widgets from your homepage. Reduce the amount of post in homepage. Don’t display too much ads, keep your blog homepage simple.
45. Use System Font
System fonts are already preinstalled on your PC.
By default, setting the wordpress theme font as the system font of the operating system can improve performance and website speed, because the browser does not have to download any font files, but uses the font files already owned by the operating system.
The following WordPress theme Using system fonts:
46. Disable Google Fonts or Host Google Fonts Locally
Excessive use of Google fonts may cause a large number of external requests from Google servers. You can’t using plugin to compress, minify and optimize the external script. It will slow down your WordPress loading time.
By hosting Google Fonts locally, your website will have fewer external Http request and faster page loading time.
47. Host Google Analytics Locally
When you use Google Analytics on your WordPress site, there may be leverage browser caching issues in GTmetrix reports.
Hosting your Google Analytics tracking code locally should resolve this issue. Also can help speed up your site by reducing extra DNS lookups.
48. Disable Google Maps
Some WordPress themes and plugins have built-in Google Maps API, but unfortunately sometimes it cannot be turned off. even if the request is loaded asynchronously, Google Maps can severely disrupt the performance of your website. After disable Google Maps can help speed up your site by reducing extra DNS lookups.
49. Disable Gravatar images or Cache Gravatar images
Gravatar stands for “Globally Recognized Avatar” and is a popular service for displaying user profile photos.
When you publish a post and get a lot of comments, the visitor’s browser must load all relevant Gravatar images from Gravatar’s external server every time they view the post. They are very slow to load, This will slow down your website.
You can manually disable Gravatar images. log in to your WordPress site, go to Settings » Discussion, uncheck the box next to ‘Show Avatars’ option.
If you want to cache Gravatar images, you can use the following plugins.
50. Split Comments Into Pages
It is a good thing that blog posts have many comments. But the downside is that loading all these comments will affect the speed of your website.
WordPress comes with a built-in solution for split Comments Into Pages. Go to Settings » Discussion and check “Break comments into pages” option.
51. Set Up Comment Blacklist for WordPress
Copy the list of keywords found in the blacklist.txt file, paste it into the “Disallowed Comment Keys” field of your WordPress Discussion Settings panel, and click the “Save Changes” button. Repeat this procedure each time you want to install an updated version of the blacklist.
Automatic Updates Via Plugin
52. Disable WP-Cron
WP-Cron is a Cron Jobs management tool for WordPress that can handle time-based tasks for WordPress applications, such as checking for theme or plugin updates, publishing scheduled posts, etc.
WP-Cron depends on the user, so if there are ninety visitors on your site at the same time, it will cause WP-Cron to be executed ninety times. If thirty of your visitors click the same link, WP-Cron will execute thirty times again, which will increase the load time of the page and affect the performance of the website.
To disable WP-Cron, Open your wp-config.php file, add the following rule before the line where it says /* That’s all, stop editing! Happy publishing. */
53. Lazy Load Google Adsense
Google Adsense is the main and most trusted advertising program in the world. It can help you easily monetize your website and blog. But Google Adsense is very slow to load.
Lazy loading of Google Adsense is a method of loading Adsense ads only after users see them. This solves the problem of slow loading of Google Adsense.
54. Remove or replace WordPress default search
WordPress’s built-in search relies heavily on Mysql database queries, and it takes time if the database is large, eventually slow down the website. You can replace the built-in search in WordPress with ElasticPress or RediSearch or WP Serverless Search to solve this problem.
ElasticPress, a fast and flexible search and query engine for WordPress, enables WordPress to find or “query” relevant content extremely fast through a variety of highly customizable features.
Redisearch implements a search engine on top of Redis. Instantly find the content you’re looking for. The first time.
WP Serverless Search, a static search plugin for WordPress. Search through thousands of posts in milliseconds.
55. Use a fast and lightweight social sharing plugin
If your WordPress site needs a sharing plugin, it is very important to choose a performance-focused, fast, and lightweight social sharing plugin. You should ensure that this social sharing plugin will not slow down your website.
Scriptless Social Sharing
Scriptless Social Sharing is a wee plugin to add buttons to your posts/pages, to make it easier for your readers to share your content on social networks.
56. Remove sliders from your sites
57. Keep Your WordPress Site Secure
Keep your WordPress website always safe is an important prerequisite for speeding up your website, but this is sometimes overlooked.
You need to pay close attention to the access log to see if there are excessive attempts to brute force your website. For example, boring script kiddies like to see if they can break into a website, just for fun. Or, your competitor may launch a DoS attack to consume server resources and reduce website speed so that visitors can switch to their website.
58. Use WordPress Static Site Generation Plugin
A static site benefits from increased security, performance and portability.
59. Accelerated Mobile Pages
The Accelerated Mobile Pages (AMP) Project is an open source initiative that came out of discussions between publishers and technology companies about the need to improve the entire mobile content ecosystem for everyone — publishers, consumer platforms, advertisers, creators, and users.
Today, the expectation is that content should load super fast and be easy to explore. The reality is that content can take several seconds to load, or, because the user abandons the slow page, never fully loads at all. Accelerated Mobile Pages are web pages designed to load near instantaneously — they are a step towards a better mobile web for all.
AMP makes your website faster for Mobile visitors.
Speed Tests Results
Google PageSpeed Insights
Sucuri Load Time Tester
The above is my experience in optimizing and accelerating WordPress website, I hope it will be helpful to everyone.
If you like this article, please remember to share it with your friends, thank you.
If you have any questions about this article, you are welcome to leave a message below, and I will reply to you as soon as possible.
Marketing vector created by stories – www.freepik.com