How to Speed Up Your WordPress Website

This post may contain affiliate links. Please read my full Disclosure for more info.

WordPress is a great content management platform to use, but it can quite literally slow down your website if you’re not careful. For this reason, you need to do everything in your power to speed up your WordPress website.

The speed of your website is a big, but often neglected, indicator of how well your website performs. The speed of your website can dramatically improve user experience, increase your pageviews, and help your website rank higher in search engines.

A slow loading website may potentially cause your website visitors to leave your website before it even loads. According to some studies, the average attention span of a human being is around 8 seconds. For this reason, every second you can shave off from your load time matters.

Search engines have also begun penalizing slow loading websites by pushing them further down in search engine results. This means that slow loading websites will have a harder time getting as many pageviews or as much traffic from search engines as fast loading websites.

In this blog post, I’ll be sharing with you how you can speed up your WordPress website.

How-to-Speed-Up-Your-WordPress-Website How to Speed Up Your WordPress Website General

How to Test the Speed of Your Website?

Before you start the process of speeding up your WordPress website, you need to know how your website is performing. You can check this by using Pingdom’s website speed test tool.

This free tool can test the speed of your website from 4 different locations: Melbourne, Australia; San Jose, California, USA; New York, New York, USA; and Stockholm, Sweden.

You should focus most of your attention on the country closest to where the majority of your audience are browsing from. You can find the demographics of your website visitors with Google Analytics.

Pingdom’s tool will not only show you the load time of your website, but it will also analyze the performance of your website so that you know exactly which areas to focus on.

When I first ran a speed test on my website, I was shocked to see how slow my website was. I actually had a hard time believing the results because my website seemed pretty fast on my computer.

Most beginners make the mistake of thinking their website is fine just because it loads fast on their computer. This is a big mistake.

Since you probably visit your website more than any other person, many modern browsers will store your website in cache and automatically prefetch it as soon as you visit your website. This will make your website load instantly on your computer.

The experiences you have on your own computer may not be the same experiences other users have on their computers, especially if they are visiting your website for the first time.

Your website should ideally load within 3 seconds. The faster you can make your website, the better it is for your website visitors. With this in mind, let’s get going with discussing how to speed up your WordPress website.

How to Speed Up Your WordPress Website

There are a multitude of things you can do right now to speed up your WordPress website. Some of the methods discussed below are quick fixes, while others may require you to add code to certain files in the backend of your website. You can access your WordPress files to edit using an FTP Client, such as Filezilla Client. If you’re not sure how to use Filezilla Client, I’ve written a short tutorial on how to use Filezilla Client to upload/modify/edit WordPress files.

Please note that some of the files you will need to modify are located within your theme’s folder. You do not want to modify these files directly because every time your theme updates, your modifications will be lost. Instead, you want to install a child theme on your WordPress website. This child theme is what you should be editing. If you don’t know how to create a child theme, you can view this blog post here: How to Create a Child Theme and the Importance of Using One.

If you don’t feel comfortable modifying your WordPress files, there are two great WordPress plugins you can use to bring similar results without code: WP Rocket and Smart Cleanup Tools.

Now that we have the tech part covered, let’s start with the most obvious way to speed up your WordPress website.

Choose a Good Web Host

A good web host is the most obvious, yet overlooked, way to speed up your WordPress website. Your web host is probably the biggest factor to influence the speed of your website.

When I first started creating websites, I was cheap. Like many new bloggers, I made the mistake of choosing the wrong web host. Rather than looking at the quality of the web host, I chose to host my website on a cheap, affordable host.

After only a year, my website began experiencing downtime and slow servers. This, for me, was a sign that it was time to migrate my current web host to another.

I decided to switch my web host from Hostgator to SiteGround. The main reason I chose SiteGround is because they always have the latest speed technologies that can boost the performance of any website. You can read my last blog post to learn more about why I made the switch from Hostgator to SiteGround.

SiteGround comes with a Geeky SuperCacher WordPress plugin that makes your website lightning fast. The other speed technologies that make SiteGround a go-to web host are their Solid-State Drives, NGINX Web Server Technology, Free Cloudflare CDN, HTTP/2 Enabled Servers, PHP7, and HHVM.

Use a Premium WordPress Theme Optimized for Speed

When choosing a WordPress theme for your website, it is important to choose a theme that is optimized for speed.

There are many beautiful WordPress themes to choose from, but many of them are poorly coded that they actually slow down your website. Make sure that when you’re choosing a WordPress theme, you’re not just looking at the aesthetics but also the performance of the theme.

When purchasing WordPress themes, you want to be careful of marketplaces where any developer can develop and sell WordPress themes. Some popular marketplaces that allow developers to do this are Theme Forest and Creative Market. While these marketplaces have many great WordPress themes, the majority of the marketplace developers will just add unnecessary features to generate more sales.

You should be buying premium WordPress themes from shops that are known for selling speed optimized themes. Some premium WordPress theme shops I recommend are Elegant Themes and Thrive Themes. These shops offer WordPress themes that are not only well coded but optimized for speed.

Use Fewer WordPress Plugins

WordPress plugins are a necessary evil if you want to add extra features and functionality to your WordPress website. Without these plugins, WordPress would be a limited content management platform with very little customization power.

WordPress plugins are great and I honestly wouldn’t be able to do my job without them, but they don’t exactly come without their own set of problems.

Anybody with a ton of plugins on their website will inevitably experience issues that cause their website to malfunction. Too many WordPress plugins add a tremendous amount of code to your web server. This can also cause incompatibility issues among the installed plugins. These issues can cause your website to become slow.

For this reason, it is better to use fewer WordPress plugins. You should deactivate and uninstall any WordPress plugin you’re not using. It’s not enough to just deactivate the WordPress plugin. You MUST also uninstall the plugin.

Before you ask yourself if there is a WordPress plugin for whatever functionality you want to add to your website, you should do a quick Google search to see if there is a way you can add that functionality to your website without a plugin.

You could also purchase a WordPress theme that already has a lot of its functionality built into the theme. The themes offered by Thrive Themes has so much functionality already built into their themes that you will need fewer plugins to customize your website.

Use a Caching Plugin

If it’s one WordPress plugin I recommend you install to speed up your WordPress website, it would be a caching plugin.

There are many caching plugins to choose from to speed up your WordPress website. WP Super Cache, W3 Total Cache, and WP Rocket are just a few caching plugins you can choose from.

I currently use the Geeky SuperCacher WordPress plugin that comes with SiteGround hosting. The SuperCacher plugin allows you to enable the dynamic caching system, automatically flush the dynamic cache, and purge all of the data cached by the dynamic cache.

The WP Rocket WordPress plugin is also a really great caching plugin. WP Rocket is the best caching plugin I’ve come across and it will make your website load blazing fast. WP Rocket comes with the following speed optimization features: Page Caching, Cache Preloading, Sitemap Preloading, GZIP Compression, Browser Caching, Database Optimization, Google Fonts Optimization, Remove Query Strings From Static Resources, Lazyload, Minification/Concatenation, Defer JS Loading, and DNS Prefetching.

The WP Rocket WordPress plugin has it all and it is super affordable at a price of $39. Of course, you can always go with a free caching plugin from WordPress, but you won’t receive all the features you need to speed up your WordPress website. By investing in the WP Rocket plugin, you won’t need to learn how to use Filezilla Client because this plugin has everything already prebuilt into it.

Use a Content Delivery Network (CDN)

Your website visitors will visit your website from various locations around the world. For this reason, the speed of your website may differ based on how far away your website visitors are located from your web hosting servers.

For instance, if your web hosting company has its servers located in the United States, website visitors in Australia will experience slower loading times because your web hosting servers are located in the United States.

This is where a Content Delivery Network (CDN) comes in. A CDN consists of servers all around the world. When you use a CDN, the content on your website will be delivered much faster to your website visitors from the server closest to them. This results in a much faster loading time for your website visitors.

I personally use CloudFlare CDN to make my website load faster from anywhere in the world. CloudFlare CDN came as part of my web hosting plan with SiteGround. If you use SiteGround as your web host, you too can get CloudFlare CDN as part of your web hosting plan.

Optimize Your Website to Load Quickly

Reduce the number of posts shown on a single page

The first thing you can do to optimize your website’s load time is to reduce the number of posts shown on a single page. I recommend having between 5-10 posts on a single page. This can be done by going to Settings < Reading in the backend of your WordPress website and then changing the number of posts shown on your blog page to a number between 5-10.

Once you’ve set the number of posts to be shown on your blog page, your blog page will be divided into additional pages. For example, if you’ve set the number of posts to 5, your 6th post will be published on the second page of your blog page.

For easy navigation, I recommend using numbered pagination. This can be done by using a plugin called WP-PageNavi. Numbered paginations increase the user experience of your website visitors and provide them with better navigation.

In a previous tip on how to speed up your WordPress website, I mentioned how it is better to have fewer plugins on your website. An easy way to avoid downloading the WP-PageNavi plugin is to use a WordPress theme that already has numbered pagination built into their theme, such as the themes offered by Thrive Themes.

Show excerpts of your blog posts rather than your entire blog posts

Another very simple thing you can do to optimize your website’s load time is to show excerpts of your blog posts instead of showing your entire posts on your blog page. This can be done by going to Settings < Reading in the backend of your WordPress website and then changing show full text to show summary for each article in a feed.

Break comments into pages

A third thing you can do to optimize your website’s load time is to break the comments on your website into pages. This can be done by going to Settings < Discussion in the backend of your WordPress website and then checking the box that says, “Break comments into pages with [insert number of comments] top level comments per page and the [choose first or last] page displayed by default.”

If you are using a WordPress theme offered by Thrive Themes, it comes with an option to enable lazy load comments. This means the comments will only start loading onto your website once a website visitor scrolls down far enough to see the comment section.

On blog posts with many comments, breaking comments into pages or enabling lazy load comments can dramatically speed up the loading time of your website.

Remove unnecessary plugins and widgets

Lastly, you should remove any unnecessary plugins and widgets you don’t need on your website. Too many plugins and widgets only slow down your website and it’s best to keep these things to a minimal.

Limit the Number of Post Revisions Stored

Every time you save your blog post to draft, WordPress stores the draft as a post revision.

Before I learned about limiting the number of post revisions stored, some of my posts were saved to draft more than 40 times.

If you’re anything like me, limiting the number of post revisions stored in the backend of your website is a necessity.

After your blog posts are done and published on your website, you don’t really need this many post revisions. After all, post revisions are just unnecessary clutter that slows down your website.

Thankfully, there is an easy solution to limiting the number of post revisions stored in the backend of your website.

You can limit the number of post revisions by using the Smart Cleanup Tools WordPress plugin. This one plugin comes with 39 cleanup, reset, and removal tools. Smart Cleanup Tools plugin costs $30, but the price is worth what it can do.

You can also remove the number of post revisions stored in the backend of your website by simply adding this one line of code to your wp-config.php file:

define( 'WP_POST_REVISIONS', 2 );

This one line of code will store 2 revisions in the backend of your website and discard older revisions automatically. You can change the number 2 if you would like more revisions to be stored in the backend of your website. I recommend no more than 5 post revisions stored in the backend.

You want to have a few revisions stored in case you make a mistake and need something to fall back on. However, you don’t want this number to be too high that it clutters the backend of your website with unnecessary draft revisions.

Empty the Trash Often

Every time you delete something from your website, it is sent straight to trash. By sending your files to trash, you have the option to either restore the file at a later date or delete the file permanently.

The junk in your trash bin can accumulate and take up a significant amount of space within your WordPress database. This, in turn, can slow down your WordPress website.

The Smart Cleanup Tools WordPress plugin I mentioned earlier also comes with the ability to empty the trash.

You can also empty the trash by simply adding this one line of code to your wp-config.php file:

define ('EMPTY_TRASH_DAYS', 7);

This one line of code instructs WordPress to empty the trash every seven days. If you want to disable the trash feature entirely, you can change the number 7 to the number 0.

Of course, you can always empty the trash manually. However, if you’re anything like me, emptying the trash is probably the least of your concerns when you have a website to run.

Leverage Browser Caching

By leveraging browser caching, you can specify the amount of time web browsers keep CSS files, Javascript files, images, and other files.

The easiest way to enable browser caching is to download the WP Rocket WordPress plugin I mentioned earlier.

Another way to enable browser caching is to find and access your .htaccess file. Once you’ve accessed the file, you’ll need to add the following lines of code to enable it:

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
## EXPIRES CACHING

You can also modify the .htaccess file via the File Manager in cPanel.

Remove Query Strings from Static Resources

Removing query strings from static resources is yet another way to speed up your WordPress website. One of the features of the previously mentioned WP Rocket WordPress plugin is that it can remove query strings from static resources.

Another way to remove query strings from static resources is to add the following lines of code to the functions.php file of your theme.

function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );

Enable Gzip Compression

Enabling gzip compression will reduce the amount of data that is sent over from your web hosting server to your website visitor’s browser. Since compressed content is smaller, enabling gzip compression will speed up your WordPress website.

The WP Rocket WordPress plugin is also capable of enabling gzip compression.

The other way to enable gzip compression is to add the following lines of code into your .htaccess file.

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

After you’ve added and saved the code, you can check to see if it actually worked by using a gzip compression test tool. For this tool to work, please include your full URL starting with https.

Disable Hotlinking and Leeching of Your Content

Hotlinking is the practice of linking from one website to the files of another website.

An example of hotlinking is when someone finds an image on your website and directly links to that image from their blog instead of saving that image to their computer first.

Hotlinking can and should be prevented because the person hotlinking your content is practically stealing your website’s bandwidth. This can significantly slow down your website.

To disable hotlinking and leeching of your content, you need to access your .htaccess file and paste the code given below. This code will disable hotlinks for all other websites except for the websites listed in the code. In this block of code, I have included 7 of the most popular search engines because you want search engines to be able to directly link to your images.

#disable hotlinking
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourwebsite.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bing.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yahoo.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?aol.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?ask.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?duckduckgo.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?baidu.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?otherapprovedwebsite.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

Important Note: Remember to change yourwebsite.com with your own domain name. If you would like to give other websites permission to hotlink your content, you can grant them permission. To grant permission, just replace otherapprovedwebsite.com with the domain name you want to grant permission to.

Now it’s Your Turn to Speed Up Your WordPress Website

I hope the techniques in this blog post helped you learn about how you can speed up your WordPress website. The speed of your website has never been as important as it is today.

Not only will these techniques help give your website a boost in search engines, but they will also improve the experience users have on your website.

Now go ahead and implement the techniques you’ve learned in this blog post. Before you begin though, test the speed of your website with Pingdom’s website speed test tool. After you’ve implemented these techniques, test the speed of your website again. Leave a comment below and let me know if this blog post helped you speed up your WordPress website. I would love to see the results you’ve experienced by following the techniques in this blog post.

Click Here to Leave a Comment Below 5 comments
86 Shares
Pin77
Share9
Tweet
+1
Share