In this article, we are going to cover the most effective ways to optimize the speed of your WordPress website.
The King of the Web
Last year’s data indicates that one-third of the 10 million most popular websites were using WordPress as their primary engine. That’s more than 3 million websites – and it’s just the tip of the iceberg.
The open-source platform has evolved from a simple system to publish blog posts into a behemoth tool used by anyone from lone enthusiasts to large corporations. From forums and mailing lists to online shops and landing pages, WordPress has become the go-to choice for anything that isn’t highly specialized.
Unfortunately, WordPress isn't exactly minimalist.
In order to simplify the process, the platform chooses to sacrifice efficiency. Everything is designed to work in tandem towards the goal of stellar user-friendliness and being highly customizable – but it’s not designed to be lightning-fast.
WordPress is bloated and inefficient, which is why you have to configure and optimize the system if your website aspires to any kind of growth.
Why Should You Optimize?
You might be skeptical of performance improvements, especially if your website doesn’t get a lot of traffic, but that’s mostly due to a common misconception. See, the purpose of optimization is not to decrease the load on your server. The primary goal is to make sure your target audience finds you and stays with you.
There are two main things to consider. First, Google is using page speed as one of the core metrics for SEO, which directly affects your discoverability. Poor SEO leads to less organic visitors - it’s as simple as that.
Secondly, in the era of an absurdly low attention span, websites that take more than two seconds to load are losing ~40% of visitors. People are impatient to the point of simply abandoning the website if it doesn’t load in less than two seconds.
Testing the Speed of Your WordPress Website
To start off, you need to know what you’re working with. These days, testing your page speed is a matter of finding a free online tool and pasting your URL into the form.
If you’re not sure which one to pick, we recommend isitwp. Not only will it provide comprehensive analytics, but it will include tips and pointers regarding problematic areas.
Effective Ways to Optimize a WordPress Website
1. Convert and Compress Your Images
Images make up the lion’s share of your web page’s data, and when their size is not optimized, the loading time skyrockets.
There are two most common image formats: PNG (bigger size, better quality) and JPG (smaller size, reduced quality). Serving PNG images is inefficient, which is why it is crucial to convert them into JPG. Converted (and then compressed) images become 70+% smaller, all while retaining most of the quality.
The simplest way to convert your images is to use TinyPNG, which is a free online service. Alternatively, you could use Adobe Photoshop to compress the images with even better efficiency, but that might be a hassle if you have a lot of pictures.
A different approach would be to use WordPress plugins, like WP Smush or EWWW Image Optimizer. Image compression plugins usually offer sub-optimal compression (compared to Photoshop at least), but the bulk-conversion is a nice feature.
2. Utilize Server-Side Caching
Caching is one of the most important aspects of website performance: both for speed and server load.
Let's say you own a blog. When a user opens a blog post, WordPress fetches the text from the database, generates the HTML, adds all the necessary CSS and JS files, and then sends that package to the visitor.
With caching, the whole package (or certain parts of it) are temporarily stored in a place where it's easily accessible (e.g. in your server’s memory). That way, there's no need to assemble the web page again - it’s ready to be reused.
Caching allows you to dramatically improve your website’s speed: up to 80% in some cases, if not more.
WordPress ecosystem has a number of caching plugins, but W3 Total Cache is one of the best ones. It’s configurable and effective, but most importantly autonomous (does not rely on your web host).
Speaking of hosting providers, they often use tools such as Varnish for advanced cache configuration that can be integrated with your website.
3. Use a CDN
Normally, your visitors connect to one specific server and download your web page from it. Here’s a problem with that: users from distant locations experience a significant delay (the further from the server, the bigger the delay) that increases the time it takes to load the page.
The solution is to use a CDN, which stands for Content Delivery Network. In a nutshell, it is a set of servers spread out throughout the world. Each server temporarily stores a copy of your web page, thus allowing your visitors to download the page from the closest location.
If you have a good WordPress hosting plan, a CDN is usually included in the package.
4. Configure Browser Side Caching
You are in control of how long a browser stores your website’s data. That way, visitors won't need to download the same content over and over again when navigating through different pages of your WordPress website.
You can set a specific expiry date for each asset. Pages are normally set to expire in ten minutes. Images, .css files, and .js files (all static assets, basically) are often stored for 30 days on a visitor’s computer. This is because they rarely change and don’t need to be re-downloaded.
In order to set-up browser-side caching, you’ll need to make changes to your server’s .htaccess file. Alternatively, if you’re on a managed web hosting plan, you should ask your hosting company to set it up for you.
5. Minify Your Files
Whenever the page is opened, it needs to load a bunch of files to properly display the content. The files take up a fair chunk of bandwidth, thus increasing the time to load the page.
But there’s good news. The files with the following extensions can be “compressed” as well:
- .css (CSS stylesheets)
- .html (Page markup).
The structure and functionality of the files will stay the same, but the content will be reformatted.
Although not as drastic of a speed improvement in comparison to, say, image optimization, it's still an important step.
If you know what you're doing, use Google’s guide on how to minify your resources.
You could also use WordPress plugins that do it for you, e.g. Autoptimize or WP Super Minify.
6. Enable GZIP Compression
Using the GZIP compression technology, it is possible to compress the website's assets and let the visitor unpack the content when they receive it - all automatically in their browser.
Unlike with file minification, we are not reducing the file size by removing unnecessary symbols and making the files less readable. With GZIP, the files (either minified or not) are compressed, similarly to how you archive your folders on PC.
The goal, however, is the same - to save bandwidth. The smaller the files, the quicker a visitor will download the page.
You can use a dedicated plugin like PageSpeed Ninja to enable GZIP compression, or you could manually configure it in your .htaccess file.
7. Pick a Lightweight Theme
Finding a beautiful theme is easy. Finding a beautiful theme that isn’t bloated is difficult.
Theme developers tend to prioritize aesthetics and functionality, but not the performance. Most of the themes are not optimized, and it significantly slows down your website.
When you’re looking for a theme, look for speed. It's always better to use two optimized components (theme + plugin) than one giant mess of a theme.
We recommend GeneratePress, OceanWP, and Astra as good-looking themes with the focus on performance. For those who need to install page-builder plugins, Elementor and Beaver Builder are decent options - but try to avoid that category if you can.
If you don’t manage to find a free simplistic theme that fits your needs, check out the Premium selection. They might be costly, but the quality product is usually worth the investment in the long run.
8. Choose a Better Hosting Provider
You can have the fastest car in the world, but it won’t make any difference if you’re driving on a dirt road with potholes. Similarly, web hosting can make it or break it for your WordPress website.
Cheap plans result in poor website performance while unreliable providers lead to extremely high response times. Both will scare away most of your visitors.
Ideally, you'd want a VPS/Dedicated server hosting plan that is optimized for WordPress. A good plan includes the infrastructure tailored specifically for WordPress, with every detail configured in a way to make you the platform performant and fast.
Soladrive offers Managed WordPress Hosting plans that come with the latest version of PHP, a Cloudflare CDN, and a set of advanced system tools. It’s a professional solution that takes care of the complex stuff for you.
9. Utilize Lazy Loading
Traditionally, all of the assets from a page are loaded as soon as the page is opened. Lazy loading takes a different, dynamic approach. It is the process of loading images, videos, and other media only when necessary.
For example, if there is an image at the beginning of a blog post and an image at the end of it, only the first one will be loaded when the page is opened – because a visitor will need to see that image right away. The second image, however, is only going to be loaded when the visitor scrolls down to the bottom of the page.
That way, you don't waste bandwidth on things that aren’t immediately necessary.
There are a bunch of plugins to configure lazy loading on WordPress. Notable examples are Lazy Load by WP Rocket or BJ Lazy Load.
10. Don’t Load Full Articles on the Homepage
Some websites benefit from displaying full blog posts in an endless feed, but most do not. Loading all of the content at once is a big contributor to high loading time. Avoid it when you can.
In order to configure your homepage to only show small excerpts of the articles, go to Settings -> Reading and set the "For each article in a feed, show" setting to "Summary".
11. Limit Your Blog’s Feed
Don’t include 40 articles on one page. A more slim way to do that would be to reduce the number to 10 or 15. It will drastically reduce the loading time and thus improve the user experience.
Go to Settings -> Reading and set a desired value to the "Blog pages show at most" setting.
12. Paginate the Comments
Similarly, loading all of the comments in one go is unnecessary. Save some bandwidth by loading just the first page.
You can configure your display settings for comments by going to Settings -> Discussion and selecting the "Break comments into pages with" checkbox (you’ll also need to specify the number of comments per page).
13. Lazy Load the Comments
If you don't like the idea of paginating comments, you can lazy load them. The following plugins will be of help: Lazy Load for Comments (basic WP comments) and Disqus Conditional Load (for the Disqus instance).
14. Choose Fast Plugins
There is a myriad of plugins in the WordPress ecosystem, but most of them are coded really poorly. If you need a plugin for a certain feature, make sure it's fast and efficient. Ideally, a plugin should only focus on one singular thing.
Don’t know which plugins are fast? Just test your website's performance before and after installing a plugin.
Here are some examples of well-coded plugins:
- WPForms (Contact forms)
- Soliloquy (Sliders)
- Envira Gallery (Photo gallery).
15. Avoid ‘Popular’ and ‘Related’ Plugins
There are very few things that increase the database load more than the plugins that display related posts. If your website has a lot of content and is moving at a snail’s pace, remove such plugins from your WordPress instance.
16. Avoid Loading External Scripts
External scripts are resources that you load on every page load from a place other than your own server. You should keep the useful ones, like Disqus or Google Analytics, but definitely get rid of everything else that you don’t need, like AdSense (major speed bump) and Gravatars.
Autoptimize is a plugin that makes it very easy to do that, although a more minimalistic approach would be to do that from the core WordPress dashboard.
18. Remember to Update Your Website
This should go without saying, but it's surprising how many people don’t do it. Always update your website, which not only includes the WordPress engine but also your themes and plugins. Minor bug fixes and new features might not be particularly relevant, but things like security patches and performance improvements are crucial for the integrity of your site.
19. Optimize Your Backups
WordPress performs backups on a regular basis. In order for the process not to intervene with your website's performance, schedule your backup plugin to run at a time when the website's traffic is low. If you don’t, the increased server load might slow down your website’s speed, which will negatively affect your visitors’ experience.
20. Don’t Serve Audio or Video From Your Server
Unless absolutely necessary, just embed your audio and video files into your page by linking to external resources. Big companies have figured out how to efficiently deliver media content to users, so take advantage of that.
Use Youtube or Vimeo for video files. Use SoundCloud for audio.
21. Offload the Media to Another Server
If you're serving a lot of media files, it might be reasonable to offload it all to a place like AWS or Google Cloud. That way, you will reduce the number of resource-heavy requests to your website’s server. The downside of this method is, of course, the cost of cloud bandwidth.
22. Update the PHP Version
PHP is the programming language that WordPress is written with. Each new version of PHP brings new improvements - performance included - so keeping the version fresh is a must for a stable and speedy website.
Good web hosting providers ship their plans with the latest versions of PHP, but it's still useful to keep an eye on it.
23. Change Your Website’s Login URL
WordPress is open-source, which means that you're not the only one who knows the login URL of your website. Bots and crawlers are constantly trying to check such URLs for exploits, and the more requests such bots perform, the more server resources you have to dedicate to serve them.
To remedy that, change the login URL of your website to something less common.
The simplest way is to use a plugin like WPS Hide Login.
24. Disable Pingback
Useful and exciting on paper, pingbacks, and trackbacks are not the most performance-friendly WordPress tools. Getting notified when someone posts a link to your article is great, but there are many more efficient ways of keeping track of such data.
You can disable link notifications in Settings -> Discussion.
25. Check the Error Logs
Your website might be slowed down by unresolved errors, so be sure to keep an eye on those.
If you don’t have a way of checking your errors, add the text below to wp-config.php.
define( 'WP_DEBUG', true );
define( 'WB_DEBUG_LOG', true );
Errors will be accessible in the /wp-content/debug.log file.
26. Disable Unused Default Options
WordPress has rich functionality, but you don’t need most of it. Disabling all of the unused options will lead to better performance.
Use the Perfmatters plugin to do that.
27. Clean up the database
If you've accumulated a lot of unwanted data in your database, it can add up and slow down your WordPress instance. In order to make the system run smoother, you must delete all the spam, deprecated content, and other junk.
The most common tool for this is the WP-Sweep plugin.
28. Remove Unused Plugins
If you don't use it - get rid of it. Unused plugins increase the size of your backups (and the time it takes to make them), as well as negatively impact the performance of your WordPress instance.
Go through the list of your installed plugins and delete everything that you don’t absolutely need.
29. Use a Premium Network
Your hosting provider's network matters. Depending on whether or not they rely on a public ISP network or a private solution from Google or Microsoft, your response time will be affected accordingly.
For instance, Google offers its premium network access for a substantial cost, but the advantage is significant: an 8% speed increase in transactions within the continent and a whopping 40% improvement for data transfers between different continents.
If you're working with a worldwide audience, you might consider switching to a premium network. But that might require you to host your own website as well - not to mention a hit to your wallet.
30. Use a Premium DNS
The internet is a complex system. You can’t just type in the URL and get the web page. In order to know where to download the files from, you need to know the actual IP address of a server that stores them.
DNS stands for Domain Name System, and it receives the URL from a user and finds an IP address associated with it. That system connects domain names with IP addresses, and the process is incredibly fast.
Your ISP has a DNS, Google has a DNS - all of these are free. But there are also premium DNS providers, and such options are usually ~30% faster at performing the lookups.
Although a few milliseconds might not save your website, it might be a good trade for some companies.
Good premium DNS solutions are DNS Made Easy, Amazon Route, and Cloudflare. The latter is often used as a CDN by many web hosting companies, and premium DNS is a nice addition.