If you use WordPress, you may want to know how you can make your website run like greased lightning. Check out our WordPress guide for speed to find some top tips about enhancing performance – and the many benefits of doing so.
Businesses swarm to WordPress when they need a website. That’s because WordPress is by far the most convenient, extensible, and robust blogging platform. It helps people build great websites with little knowledge of coding or other geeky tech stuff.
Why do you need a fast WordPress website?
If your website is slow, you’re likely to frustrate potential customers or buyers who may get sufficiently annoyed that they click that ‘close’ button and never return.
In fact, studies show that if your average website load time increases from 1 to 3 seconds, you’ll see a 32% increase in the number of your visitors that will bounce. If this load speed increases from 1 to 5 seconds, the bounce rate will increase up to 90%. That’s a considerable loss!
In addition to losing visitors and customers (as well as revenue) to slow websites, Google and other search engines also effectively penalize slower websites by raising the rankings of faster websites – which reduces website traffic for slower websites.
It doesn’t matter whether you are an authoritative site or just a web store: if your site fails to load fast, you won’t get enough search engine visibility, and you’ll be losing potential customers and visitors.
Google and other search engines frequently update their algorithms, which are used to rank sites according to search queries.
In 2021, Google rolled out its ‘Core Web Vitals’, focusing more on the user webpage experience. Core Web Vitals is now considered a ranking factor for Search Engine Optimization (SEO) and is based on what a typical web surfer would like to experience when they visit a website (like speed).
This is yet another reason to not focus solely on building a great-looking WordPress website – but also on having a fast-loading WordPress website. Otherwise, be prepared to be penalized by impatient users and powerful search engines like Google!
Optimize with Mobile-First in Mind
Before we dig in deep, it’s important to note where most of your website traffic comes from.
No matter how good your website and your content are, you need to make it mobile-friendly. This “mobile first” approach is vital, as most people nowadays have mobile devices and often use them to access websites.
In January 2021, it was found that there are a staggering 4.66 billion active internet users and the vast majority (4.32 billion users) use their mobile devices to access the internet. That represents 92.6 percent of total internet users. If these numbers don’t convince you to take a “mobile first” approach, then nothing will.
How To Speed Test Your WordPress Website
So how do you know if your website could be considered slow?
You must regularly check and see how your WordPress website is performing. Speed testing your WordPress website is essential to see whether your site is functioning optimally.
There are several tools and services that you can use to speed test and check the performance of your site. You should fix anything that negatively affects your website speed.
GTMetrix
GTMetrix is a handy tool that you can use when you need to test your website’s performance. The most important thing about GTMetrix is that it relies on real-world user experiences and uses real web browsers for all of its tests. That’s why it’s highly recommended that you address all the suggestions it provides, as it can help ensure that you have a lightning-fast, user-friendly website for real-world users.
GTMetrix is free to use, and there’s also a premium paid version. If you signup for the free account using your email address, you can use the following server locations:
- Vancouver, Canada
- Hong Kong, China
- London, UK
- Mumbai, India
- San Antonio, Texas, USA
- Sydney, Australia
- São Paulo, Brazil
For GTMetrix Pro users, there are even more server locations available for you to test. These locations are spread throughout North America, Europe, the Middle East, Asia Pacific and Africa.
You may wonder “Why do I need that many locations?”.
Assume you are in Texas and developing a website for a client that offers services in Africa. In this scenario, you have to check how the website you build will perform in Africa (assuming that the website will be hosted on a server located in Africa, not in Texas).
To do this, you go to the GTMetrix tool and select the server location you want to check your website for – then enter your website’s URL, and hit return. It will run the website through the selected location and provide you with an in-depth report on how it performed. Based on these results, you’ll be able to see the optimizations that are required to enhance speed.
This is what the interface looks like.
And these are some of the possible optimization recommendations which you could then implement to improve your site’s performance.
This tool is super convenient, provides lots of detail, and will save you lots of time. If you can address the issues it recommends, then you are guaranteed to have a faster WordPress website.
Google PageSpeed Insights
Another helpful and widely used performance optimization service is Google PageSpeed Insights (GPSI).
GPSI is all about analyzing the content of website pages and then making recommendations to enhance web page speed. Unlike GTmetrix, Google PageSpeed Insights tests web pages using both lab and field data.
While lab results are helpful when debugging performance errors, they may not reveal real-world user experiences as they rely on emulators. This is one of the biggest drawbacks of the GPSI.
To address this lack of real-world user experience using lab data, GPSI also includes field data tests which don’t rely on emulators. That’s why these are referred to as Real User Monitoring, or RUM. Field data, however, only uses a few metrics on RUM, which is considered another disadvantage of using GPSI.
Despite these drawbacks, Google is a global authority and we can’t ignore their suggestions if we want to enhance the speed of any WordPress website.
GPSI reports come with a performance score for your web pages. This score is the key to determining whether you have a high-performing webpage or not. But the score is not always about how fast your page loads – it’s also linked to how fast your website loads.
If your web page has a score of 90 or above, it is considered a good page. Pages that score between 50 and 90 need to be optimized. Anything below 50 is considered poor.
GPIS’s real-world field data tests also classify your web pages as “good”, “needs improvement” or “poor” – based on metric data related to:
- First Contentful Paint (FCP)
- First Input Delay (FID)
- Largest Contentful Paint (LCP)
- Cumulative Layout Shift (CLS).
Each of these values have their own thresholds for categorizing web pages.
Pingdom
Pingdom by SolarWinds is another handy tool to check your website’s page speed performance. Pingdom offers a 30-day free trial and monthly or annual subscription packages including a “synthetic monitoring” package and a “real user monitoring” package. Like GTMetrix, Pingdom also uses several data centres around the world to test websites.
Pingdom also presents excellent reports after testing your website which provide insightful optimizations that are needed to improve the performance of your site.
Their reports can help you to identify performance bottlenecks so you can see exactly what type of content is slowing down your site and what you can do to rectify that. In this way, Pingdom monitors more than just loading time – it gives you feedback on how to enhance website performance.
What Makes Your WordPress Website Slow?
There are many different tools and services that we can use to assess how WordPress websites perform. But not all of these tools will tell you why your WordPress website is slow.
The ability to pinpoint why your website is slow gives you the opportunity to avoid and address these issues, which will definitely help you to have a faster loading WordPress website.
Next, we’ll explore the various factors that could be slowing down your WordPress site.
Cheap Web Hosting
First on the list is cheap web hosting. Most of these cheap web hosting providers have a dedicated server that they partition into small chunks for groups of their clients. This is how they are able to offer such incredibly cheap prices.
However, sharing a partitioned server means you’ll be sharing the server’s resources with other users, which can affect your site’s speed.
In addition, some providers may use outdated technology with their servers. For example, Hard Disk Drives (HDD) are very outdated. We have better options nowadays like Solid State Drives (SSD) which are ten times faster than an HDD when it comes to reading and writing data.
And there’s more: Non-Volatile Memory Express (NVMe) Solid State Drives are 4 times faster than an SSD.
So if your cheap host still uses HDD on your shared server, you are guaranteed to have a slow performing website.
WordPress Configuration
The way you configure your WordPress installation is another critical factor that determines your website’s performance.
As of the dawn of 2024, the WordPress core version is 6.4.2 and WordPress developers are continuously updating both the core and maintenance versions of the product.
Updates come with different optimizations.
If you are still running your WordPress website on WordPress 5, you are missing out on critical optimizations. If you want to harness the true potential of WordPress, it is recommended that you always run the latest updates.
PHP Configuration
Once you have the latest version of WordPress, you need to consider the most compatible, or the latest version, of PHP, as that also affects website speed.
PHP is the scripting language that WordPress is built on. Most users are happy with PHP 7.4, but unfortunately, PHP 8.0 has created some difficulties with WordPress 5.8.1.
Eventually, they’ll get it working again, and these difficulties will be a distant memory. In general, you always want to be running the most recent, stable version of PHP.
This graph shows how the PHP version you’re using correlates with the number of requests (transactions) per second – with the more recent PHP versions being able to handle many more requests per second, which correlates positively to the speed of your website.
Page Size
Page size is another key factor that significantly affects your site’s speed. If your page has lots of images, videos, and animations, then the page requires more bytes to fully load for your visitor than may be necessary, and is considered “heavy”.
No matter how good your host is, they may not be able to improve your site’s speed if there are many heavy pages. And if a page is too heavy, then eventually, it may slow down the entire site.
It is therefore recommended that you optimize images and videos before adding them to your website, so limit page size.
Bad Plugins
As we all know, WordPress has a vast plugin repository, with a whopping 54,000 active plugins in its repository.
But, not all plugins are created equally. There are good plugins and bad plugins.
Bad plugins are ones that haven’t been updated in a while and are, therefore, probably not compatible with your version of WordPress or theme.
If you are using plugins, then it’s a good idea to check regularly for updates or simply select “Enable Updates” in the plugins list.
If there aren’t any updates for outdated and incompatible plugins, then it’s better to replace them with an alternative, rather than keeping those plugins active.
It’s also preferable to only use plugins if you really need to in order to ensure a fast WordPress website.
External Scripts
When a website uses third-party scripts such as Google Analytics, Facebook Pixel, or conversion tracking, then the server has to fetch these scripts each time the site loads. But because it takes time to cache these scripts before the site loads, external scripts always tend to slow down websites.
There are ways to host external scripts locally, but they still tend to drain a website’s loading speed.
Therefore it’s better to use as few external scripts as possible on a website’s front-end. This will help you to achieve a faster-loading WordPress website.
Overly Long Posts
Posts that are too long can also negatively affect the speed of your website. Posts typically consist of a mix of text and images, but if there’s too much content it will take much longer to load.
That’s why this post will never load very quickly(!)
In general, it’s best to keep posts to only as long as it takes to give value to the reader.
If your post is long, it is better to truncate or “excerpt” the post. That way, your website won’t have to load all the content all at once. Instead, the full content will only be loaded if a user clicks on a button to read the full post.
Truncating posts therefore helps to ensure that a post will load fast – particularly on mobile devices. In addition, Google likes to see the “activity” (the visitor’s click) as it indicates engagement.
How to Speed Up Your WordPress Website
Now that we’ve explored some of the factors that cause WordPress sites to perform slowly, let’s take a look at how to speed up a WordPress site.
Unfortunately, speeding up a WordPress website is not as simple as a push of a button.
Many people think that speed can be easily achieved with the right plugins. That is partially correct – but you still need to know the basics of speed optimization and how implementing optimization measures could impact the overall user experience.
In other words, optimizing your site for speed won’t really matter if your WordPress website breaks.
Optimization needs to be done in a way that balances website performance and the user experience. And it requires more than just loading plugins – you also need to know which buttons to push and which not to. And you also need to know exactly where you should intervene in the optimizations to manually make the necessary changes.
Decide Which External Scripts You Really Need
As discussed earlier, external scripts are one of the factors that can slow down a WordPress website. If these scripts aren’t handled properly, then they can severely impact the performance of a site.
Even though external scripts like Google Analytics and Facebook Pixel can slow down a website, they can also help us make strategic decisions based on a particular audience. So even though you may want a “100” score on Google PageSpeed Insights, you may not want to ditch all your external scripts.
The bottom line is you should keep the scripts that are most important to running a successful business. It probably goes without saying (but I’ll say it anyway) that you shouldn’t blindly use all the scripts you can find in the hopes that one magic script will help you make better business decisions.
Be strategic.
Remember to always balance user experience with performance optimization. There’s almost always some script running that you don’t need.
If you are going to be running external scripts, try to load them locally. That will help you address most of the speed-related issues from running external scripts.
An example of a plugin that can help you host Google Analytics locally is Complete Analytics Optimization Suite (or CAOS).
Decide Which Plugins You Really Need
If you check the WordPress plugin repository, you’ll find hundreds of plugins. You may find so many appealing that you end up installing several of them on your WordPress website.
This is where you need to be cautious and strategic. While plugins can be really useful, it’s better to only install the ones that are essential and strategically important for your business because too many plugins can really slow down your site. That’s because plugins add extra code to your site, and that translates into slower site loading times.
Always test your plugins first on a demo site or in a staging area rather than on your production site, as they could potentially break existing code and affect loading time – wreaking havoc on your site.
How to Find Bottlenecks and Slow Plugins
It’s not always true that having more plugins installed means your site will become very slow. As long as the plugins you use are properly coded and frequently updated, your site may indeed continue to perform well.
If you have a plugin that hasn’t been updated in a while and you have a slow website, then it is probable that the outdated plugin may be causing your website’s performance issues.
To decide on which plugins to keep and use, it’s best to check how they contribute to the site’s overall performance.
Query Monitor is a free WordPress plugin that lets you check the performance of plugins, database queries, and themes, etc.
What irony: using a plugin to check the performance of plugins.
Once you’re done testing, uninstall the Query Monitor plugin.
Using the example in the screenshot above, it was easy to find the PHP error caused by Slider Revolution using Query Monitor.
By figuring out the cause of a slow website, you can then opt to remove a pesky plugin like Slider Revolution and replace it with a less problematic slider such as SmartSlider or MetaSlider.
There’s also an old skool way of tracking plugins that are draining too much processing power from your WordPress website – you can use GTMetrix’s waterfall.
GTMetrix waterfall will show you the scripts that are taking the most time to load completely. Based on these observations, you can then make mission-critical decisions about your existing plugins.
It may be “old skool”, but it’s pretty darn valuable information.
Remember, it is always about keeping a balance between user experience and performance. It is not always about speed.
Last but not least, you can leverage a Chrome extension, WP-Hive, to check potential problems that are being caused by your WordPress plugins.
With the WP-Hive extension installed on your Google Chrome browser, go to your WordPress plugin repository and then go to any plugin you need to check. It will show you more information about particular plugins and their potential problems when in use.
You can use this extension before you install a plugin on your WordPress website to help you decide whether to install that plugin or not.
Choose High-Performance WordPress Hosting
Selecting a high performance website hosting service is a critical factor to ensure the optimal speed of your site. Some of these hosting packages can be expensive, but can be an important investment.
Our current go-to hosting service, SiteGround, as well as this site’s host, WPX, offer high-performance web hosting at reasonable prices, while Cloudways, Kinsta, and WPEngine offer truly superior high-performing hosting packages. WPX even offers a one-time optimization service when you migrate your site over to their hosting.
Most of these hosting companies use Apache or Nginx web servers, but LiteSpeed is even a bit faster than these.
Choose a Server Closest to Your Visitors
It’s important to choose a server that’s located as close to your visitors or users as possible, as server location affects speed.
Generally, local servers load faster for people accessing a website in that same country. Thus it’s generally advisable to select a server close to where most of your website users live.
Move to a Dedicated Server
Even though you may be using the best hosting provider, you’re likely to be assigned a shared hosting plan. If the provider is good enough, then this may not be a big issue.
But you’re always playing by your host’s rules. That could mean that you’re only allowed to host one website per package and that you’ll have to pay for adding any additional sites. You may also be limited to a certain amount of RAM, and you may have to pay for going over that limit.
Moving to a dedicated server could be an option for you if you want more control over your hosting and if you don’t want to be limited by hosting providers’ rules.
However, many dedicated servers are unmanaged, so unless you have the tech and server management skills to deal with this, then it’s best to stick to a managed, shared hosting service.
There are some managed dedicated service providers out there which can be expensive – like InMotion and A2. Even with basic packages, you’re quickly into the $150/month range and up (way up)
Your needs must be balanced with your budget.
If you move to a dedicated server, you can install cPanel or DirectAdmin and start hosting your websites, but these carry an extra licensing cost.
CyberPanel is a free alternative which is powered by OpenLiteSpeed – making it faster than Apache and Nginx.
You must take care when descending down the rabbit hole of web hosting. It requires a great deal of time and energy to move to a new server, and you need to be relatively certain (reviews from friends or colleagues can help!) that it will serve your needs.
An alternative to having an expensive dedicated server is to try a Virtual Private Server or VPS such as offered by DigitalOcean, Vultr, Linode, or UltaHost.
A VPS is a partitioned chunk of a dedicated server which may perform better than a shared web host although it won’t be as fast as a dedicated server. You can also install CyberPanel on a VPS.
Having an ultra-fast web server can often mean a speedier WordPress website with less emphasis on persnickity on-site optimizations.
Use a Fast WordPress Theme or Page Builder
There are loads of fancy WordPress themes you can choose from when building your website. But, if you use a theme that isn’t well optimized, it could hinder any other optimizations you install.
That’s why it’s important to ensure your theme is compatible with the latest WordPress core and that it has clean code.
These days, people frequently use page builders to design their websites. The very popular Elementor, WP Bakery Builder, and Oxygen Builder are three of the biggest. All these page builders come with optimization tradeoffs and may require you to do extra work to make your website load fast.
That’s not to say you can’t build a lightning-fast WordPress site with a Page Builder – you can if you follow best practices like flipping the right switches (such as turning on “Optimized DOM Output” in Elementor), using clean code, optimizing images (we like squoosh.app for this), and using the least number of plugins.
Choosing a well-optimized theme before building your website will save you time and effort – especially if you can select a theme that is designed to work with WordPress’ Gutenberg block editor like Blocksy and Kadence.
With Elementor, we typically work with their “Hello Elementor” theme, because it stays out of the way of their very nice page builder.
These themes are stable and lightweight:
- GeneratePress
- Genesis Framework
- Astra
- Hello Elementor
Use Optimal WordPress Settings
By selecting the optimal WordPress settings, you can help to ensure a faster website. Even though you may use a high-performing web host, a lightweight theme, and fewer plugins, you still won’t achieve optimal website performance if you don’t fine-tune your settings.
The following settings can help you achieve a high-performing WordPress site.
Eliminate Render-Blocking JavaScript and CSS
Most WordPress sites have lots of external scripts like JavaScript and CSS, which are called “render-blocking” scripts. When scripts block rendering, your website will not display until these scripts complete.
In many instances you won’t need to fully load all your render-blocking scripts to have a functioning site. Therefore it’s best to eliminate the scripts you don’t really need (are you sensing a theme here?)
You can use Google PageSpeed Insights to see which scripts are render-blocking and make the decisions about which ones to eliminate.
You can either manually eliminate these scripts, or you can use a plugin to do it for you.
Combine External CSS and JavaScript in WordPress
Combining external scripts is a way to increase website speed. You can use tools like GTMetrix or GPSI to test the performance of your website. Often these tools will suggest that you combine external CSS and JavaScript.
Because external scripts load individually, multiple requests to do so can really slow down your website’s speed. By combining scripts into a single request, you can dramatically increase loading speed.
You can use speed optimization plugins like WP Rocket to combine all your external CSS or JavaScript scripts into one file. SiteGround also offers their pretty decent SG Optimizer for free, which includes this functionality. Autoptimize is another option that is free.
Use Minification on HTML, CSS, and JavaScript
Minification is the process of removing unwanted codes from your HTML, CSS, or JavaScript. There’s always room for improvement when it comes to cleaning code. Things like spaces and line breaks can slow down a site, so removing these instances can help to speed up loading times.
Below is a good example of how CSS minification works. On the left is the ‘unminified’ CSS code, and on the right is the ‘minified’ version of the same code. When a computer executes the code, it’s probably obvious that the minified version will be executed faster than the unminified version.
HTML, CSS, and JavaScript minification isn’t going to significantly increase your site’s speed, but every millisecond counts.
Again, you can use minification tools such as Topal’s CSS minifier, Dan’s Tool’s CSS minifier, WP Rocket, SG Optimizer (free) or Autoptimize (also free).
Add an Expires Header to Static Resources
Your site may have many assets (e.g. images) that you won’t change frequently. Instead of having those assets load from the server each time they’re accessed, you can add an expires header to these static resources.
An expires header instructs the browser to save these assets in a cache for a specific amount of time, preventing re-loading from the server.
Now the browser will present the cached files directly from the browser’s cache. This can drastically improve your site’s performance, as the files are already on the visitor’s machine.
Add LazyLoad to Your Images
If your site has several images on the homepage or elsewhere, it’s best to have them lazy-loaded. That means they will only load when they need to be viewed, rather than loading all images automatically when your site is accessed. As you might imagine, deferring this type of work will speed up your site.
Use Cookie-Free Domains
Cookies are integral to any WordPress website, but they can cause bottlenecks when delivering static content which can slow down loading speed.
You don’t actually need cookies to be loaded for every browser request to access static assets as that process can slow loading time.
If you have a separate domain (e.g. static.yourdomain.com) to host all your static assets, then you can avoid these additional server requests which helps to speed up your site.
Disable Embeds in WordPress
WordPress 4.4 introduced the ability to embed media like videos and Tweets on WordPress pages. Even though this functionality is exciting, it comes with lots of JavaScript code which ultimately slows down loading speed.
Thus, if you’re more into speed than “excitement”, it’s recommended that you disable embedded media across your website.
Disable Emojis in WordPress
WordPress 4.2 introduced the ability for users to use emojis with their content. The downside to this is that Emojis load code on your frontend which can slow down your site.
It’s best to disable Emojis on your site.
Disable User Gravatars
Globally Recognized Avatars, or gravatars, are attractive because they help you have an identifiable profile across the internet where gravatars are supported.
But, if you have enabled a gravatar on your WordPress site, then your site will send an external request to Gravatar to fetch your account information. And because this is an external request, it creates caching issues which affect your website’s overall performance.
That’s why it is better to keep gravatars disabled if you want to have a fast-loading WordPress website.
Disable WordPress RSS Feeds
RSS feeds can also slow down the performance of your WordPress site. Even though they are useful at getting people to subscribe to your updates, it’s best to disable them – particularly if you have a small, fairly static site.
RSS can be disabled in 2 ways:
- Disabling RSS Feeds Using a Plugin
You can use a premium plugin like Perfmatters to disable RSS feeds from your site.
- Disabling RSS Feeds Using Custom Code
If you’re comfortable using a text editor you can disable RSS feeds using code. Add the following code to your theme’s functions.php file to disable RSS.
function itsme_disable_feed() {
wp_die( __( ‘No feed available, please visit the <a href=”‘. esc_url( home_url( ‘/’ ) ) .'”>homepage</a>!’ ) );
}
add_action(‘do_feed’, ‘itsme_disable_feed’, 1);
add_action(‘do_feed_rdf’, ‘itsme_disable_feed’, 1);
add_action(‘do_feed_rss’, ‘itsme_disable_feed’, 1);
add_action(‘do_feed_rss2’, ‘itsme_disable_feed’, 1);
add_action(‘do_feed_atom’, ‘itsme_disable_feed’, 1);
add_action(‘do_feed_rss2_comments’, ‘itsme_disable_feed’, 1);
add_action(‘do_feed_atom_comments’, ‘itsme_disable_feed’, 1);
Turn off Pingbacks and Trackbacks
When your content gets linked to another blog, you get notified via pingbacks. Trackbacks are hard to explain.
Spammers often try to exploit this by sending massive amounts of pingbacks and trackbacks your way, which can be crippling. To keep things simple and fast, it’s best to disable pingbacks and trackbacks.
To disable pingbacks and trackbacks, go to your WordPress settings and then under ‘discussions’, you can untick ‘allow link notifications from other blogs (pingbacks and trackbacks) on new posts’.
Pre-fetch and Pre-connect Data
Pre-connecting and pre-fetching content can also improve the overall loading speed of a site.
By getting browsers to pre-connect to the server and pre-fetch content before that content gets requested by a user, you can reduce the time-consuming steps involved in a round trip.
A round trip starts when a browser requests content from a server, then connects to that server. That triggers the IP address to be resolved, a secure connection gets established and the connection gets encrypted.
Caching Plugins – Use With Caution
Caching plugins are recommended for most WordPress sites – particularly for high-traffic sites. However, use caching plugins with caution, as many optimizations can break your site.
There are many caching plugins available such as WP Rocket and WP Super Cache (the latter being free). Some web hosts will also automatically take care of caching plugins for you, like SiteGround hosting’s SiteGround’s SG Optimizer.
We’ve had good luck with standard cache settings with WP Rocket and SG Optimizer, with Perfmatters for maximal tweaking.
Use Compatible, Locally-Hosted Fonts
Fonts play a crucial role in website design, but some fonts can create optimization issues.
Google Fonts
Google offers a wide variety of amazing fonts and this can save web designers a fortune as fonts can be expensive. But the downside is you can’t minify, combine or optimize these fonts.
Host Fonts Locally
To overcome the problem of not being able to optimize third party font scripts, you can host Google fonts locally by using a plugin like Optimize My Google Fonts (OMGF) .
Enable Preloading of Google Fonts
If you aren’t keen on optimizing Google fonts using a plugin, then you can try preloading your Google fonts. This helps speed up your site, because it saves on-site loading. With preloading, fonts are retrieved from the Google font server before they are retrieved from your website’s front end.
Optimize Your Images for Size and Speed
When designers create websites, they focus on quality images rather than optimizations. The downside is that large image sizes can severely slow down your site, which you’ll notice when you run GTMetrix or other page speed testing services.
Therefore rather use JPEGs instead of PNGs or TIFFs, as they are usually smaller files.
Below are 2 ways to optimize images for size and speed, namely: specifying image dimensions and automatically optimizing image uploads using plugins like Squoosh.app.
Always Specify Image Dimensions
Use the correct image sizes on your site and specify maximum image dimensions for placeholders (e.g. 400px by 400px). Even if a larger image would fit that placeholder, using bigger images will slow your page’s loading time.
Auto-optimizing Image Uploads
The aim of optimizing images is to reduce file sizes as much as possible without affecting the quality of the image. Smaller file sizes require less data to be downloaded, which speeds up loading times on websites.
There are lots of tools you can use to automatically optimize and compress images when you upload them (and to compress all existing images on your site). This saves you time in having to optimize each image individually before uploading them. However, you won’t know the actual results until you view the site. Often, automatic compression leaves artifacts (pixelation, etc.) that you would never have allowed on to your site had you seen it beforehand.
Shortpixel and Smush are two popular freemium plugins that you can use to optimize images on the fly.
The Squoosh.app website also optimizes images and lets you preview the original versus the optimized images before going ahead with an optimization. That gives you added visual control over the image file size compression process.
Clean Your Database and Media Library
WordPress revisions allow you to undo changes – but these can also clutter your database space and increase your databases’ size.
To keep your site’s database running optimally, it’s best to keep it cleaned – which you can either do manually (but that requires pro-level WordPres skills), or by using a plugin like WP Rocket. The SG Optimizer also has a switch for this as of this writing.
The same principles apply to your Media Library. Unused images stored in your library take up lots of drive space which can mean your site won’t perform optimally.
To declutter your media library, you can either manually delete unused images or you can use a plugin like Media Cleaner to do it for you.
Server-Side Optimization
Server-side optimization is another crucial aspect of enhancing your WordPress website’s overall performance.
Below are a few major tweaks that you should consider implementing on your server:
Update WordPress and PHP to the Latest, or Most Compatible Versions
While it’s usually recommended that you update WordPress and PHP to the latest versions, sometimes older versions are more compatible.
Many users, for example, found that WordPress 5.8.1 works seamlessly with PHP 7.4 in terms of streamlining the server’s performance – which also affects website performance.
Create a Light 404 Page
404 pages provide users with error messages when a file or page is not available and sometimes give a redirect link. Unfortunately many of these pages can be heavy, which can slow down your site. And if your site has many 404 pages, that can also affect your site’s SEO.
It’s wise to create a light 404 page using a minimalistic template. And you should fix any 404 page errors on your site.
Enable HTTPS and HTTP/2
Security is a major concern for WordPress websites. That’s why an SSL certificate should always be installed to secure your website and its content.
To do this you can use HTTPS or HTTP/2 – with HTTP/2 being the most stable version of HTTP that will also give you a faster performing site.
Change the WordPress Memory Limit in wp-config.php
Servers need enough memory to run processes efficiently and effectively. PHP is a server-side language that also requires enough memory to run operations on the server.
You can change the PHP memory limit by altering the wp-config.php file in your default WordPress installation. Make a backup before you make any changes.
If you open the file using a text editor, you’ll find the following line of code:
define( ‘WP_MEMORY_LIMIT’, ’64M’ );
Here 64M means 64MB. You can increase this limit to suit your particular needs.
Add a Vary: Accept-Encoding Header
To speed up a WordPress website, you should present the compressed version of the website to all web browsers.
By adding an accept-encoding request HTTP header, you let modern browsers know that the client can handle a compressed version of the WordPress website. That in turn makes the site load faster.
Add Cache-Control and Expires Headers (Determine Cache Length)
You can control how long a browser keeps caching your static assets by using a cache-control header for your WordPress website.
By doing this, the browser keeps static files cached – so whenever a user re-visits the site, the browser doesn’t need to request the files from the server again. Instead the browser presents what’s already in its cache – and that makes the website load faster.
Minimize Redirects and Add Them at the Server-Level
Redirects (where one URL redirects to another URL) always take extra milliseconds to complete. That makes users wait in the process. Therefore it’s best to minimize redirects at all costs.
Use GZIP Compression
GNU Zip, or GZIP, is a lossless data compression method that helps you to reduce the size of a webpage by compressing its assets such as HTML, CSS, and JavaScript codes.
When you use GZIP it provides a compressed version of your website – and that helps to make your site load faster.
Increase PHP Workers
PHP workers determine how many parallel uncached versions of your site are being presented at any given time. The more PHP workers, the more parallel user requests will be handled – which reduces how long users have to wait when they request a page from your website.
Increasing the number of PHP workers therefore helps your WordPress website become more responsive and faster in terms of fulfilling parallel user requests.
Use a Content Delivery Network (CDN)
A Content Delivery Network (CDN) can help you dramatically reduce network traffic to your site, which in turn enhances speed. That’s why CDNs are essential for high-traffic sites.
CDNs help you to distribute your site’s content globally via local CDN nodes so that all requests for static content are directed to these local CDN nodes rather than the origin server – presenting the most recent cached version of the requested page.
Cloudflare is one of the best CDNs out there and it’s free version is sufficient for most users. .
Configuring a domain to work with a CDN can get a little tricky. For example, if you use Cloudflare then you’ll have to update your domain DNS records and replace your default nameservers with Cloudflare’s nameservers.
If you’re not familiar with DNS updates, connecting your domain to a CDN like Cloudflare could be challenging. In addition, moving your site to a new server can be even more challenging. But if you can manage the extra admin overhead, a CDN is really worth the time and effort for its benefits of speed.
Hyper-Tweaking
We tweak and tweak monthly, but there are always opportunities for further tiny improvements in website speed.
Hyper-tweaking can cut extra milliseconds from your site’s load time and provide an even smoother user experience.
Use the Perfmatters Plugin for Page-Level Optimizations
Perfmatters is a lightweight premium plugin that’s designed to do page-level optimizations. Its ‘script manager’ can disable CSS and JavaScript files at either page or post level.
For example, if you’re using Contact Form 7 on your contact page it will load CSS and JavaScript (JS) files throughout the website. Or you can disable Contact Form 7’s CSS and JS files from being loaded sitewide and restrict it to just the contact page. In other words, it’s a powerful tool to help you selectively enable or disable CSS, JS or plugins on a post basis.
Enable HTTP Keep-alive Connections
An HTTP persistent connection, also known as an ‘HTTP Keep-alive’, is a command that makes a Transmission Control Protocol (TCP) connection keep itself open for new HTTP requests.
This is quite useful because HTTP connections are configured by default to close after each HTTP request. So by keeping the connection to the server open, you save time and avoid constant reconnections – making the site operate more efficiently.
Disable Hotlinking of Your Content
Hotlinking is where other websites embed and link to images from your site. This can really drain your server’s resources without you even knowing it. That’s because each time the image is viewed on the external site, the browser requests it from your server, not theirs.
If you discover that someone is hotlinking your content, the simplest thing you can do is to rename that image and change the image URL so that the hotlink no longer works. If it continues to happen, you can add the following lines of code to your .htaccess file.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)example.com/.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|xml|php|png|css|pdf)$ – [F]
NOTE: Replace example.com with your domain name
Frequently-Asked Questions About Speeding up WordPress Websites
How Do I Speed Up a WordPress Website?
Here is a condensed version of our Top Tips for speeding up your WordPress website:
- Use a reliable, high-performing web host that’s close to where your website users are located.
- Use a dedicated server to host your WordPress website, especially if it’s a high-traffic site.
- Use a lightweight theme.
- Optimize images.
- Don’t use plugins unless absolutely necessary. Test and off old plugins if no one remembers why they’re still on!
- Use a caching plugin like WP Rocket to minify, combine and optimize CSS and JS.
- Add expiry headers.
- Always use the latest WordPress core.
- Update your server’s PHP version to be most compatible with your version of WordPress.
- Use a CDN.
- Make use of GZIP compression.
What is the Best Plugin to Speed up WordPress?
This really depends on your exact requirements, but if you’re looking for a free plugin, then the LiteSpeed Cache plugin (LSCP) works well – but you’ll need a LiteSpeed web server.
For Apache and Nginx servers, WP Fastest Cache and Autoptimize are good options. WP Rocket is probably the best, but unfortunately, it’s not free.
Why is My WordPress Site so Slow?
There are many reasons you might have a slow WordPress website.
The first thing to check is your hosting: if you are using a cheap, shared hosting plan, that’s where you should invest in change. If your host is reliable, then make sure you run GTMetrix and Google PageSpeed Insights to see what they recommend.
Based on these recommendations, you can then decide how to address the speed bottlenecks.
A tool that can address many of the factors that affect speed and optimization for WordPress sites is W3 Total Cache. It’s a holistic Web Performance Optimization (WPO) framework with a wide range of benefits and features for speed optimization.
Final Thoughts on How To Enhance Your WordPress Site’s Performance
It can be a minefield of hit-and-miss trying to figure out ways to make your WordPress website perform optimally and speedily.
Depending on your exact goals and budget, there are many tools to help you achieve a fast website. We hope this WordPress guide to speed will inspire and enable you to enhance your site’s performance and make your site visitors keep coming back for more.