WordPress Speed

A fast loading website is important for getting and keeping steady traffic. WordPress speed is thus a concern for everyone who wants to grow their WP website, increase their traffic, and increase revenue.

However, there are several factors that could slow down your WP website, ranging from your host and theme, to the images you use.

And even if your website isn’t particularly slow, it still makes sense to optimize your speed. When it comes to website loading time, it cannot be too fast.

In this post, we will help you identify issues that can slow down your site and show you practical steps to improve your WordPress Speed. Ultimately, your aim should be to get your website to load in less than 1.5 seconds, and this guide will show you how to achieve this result.

Table of Content

Where should you start?

How page loading speed affects your website

Case Study

How to make your WordPress Website lightning fast

Optimization steps for regular WordPress users

  1. Use a Caching plugin
  2. Minify and combine WordPress code
  3. Enable Gzip Compression
  4. Optimize images
  5. Enable lazy loading
  6. Use a Content Delivery Network
  7. Use Excerpts in your homepage
  8. Limit Comments per page
  9. Clean up database
  10. Turn off pingbacks and trackbacks

Case study result after optimizations steps for regular users

WordPress Speed optimization Steps for advanced users

  1. Enable Keepalive for transfer connections
  2. Disable hot linking of your content
  3. Set Expires header for static content

Core optimizations to improve WordPress speed

  1. Hosting
  2. DNS Provider
  3. Themes
  4. Plugins

How can you use this information?

Where should you start?

To begin, it is good to get a benchmark of your current site speed. To do this, you can use Pingdom Website Speedtest Tool.

WordPress speed test tool

Have you ran your test? What is your load time? If it is consistently less than 2 seconds, that’s fair, but it can still be optimized. If it is more than 2 seconds, you should be concerned, and here’s why.

How page loading speed affects your website

A slow loading site will negatively affect your site traffic and revenue. Traffic is affected for at least 2 reasons:

1. Search Engines give low ranking to slow sites – In 2010, the search giant Google announced that they would begin considering site speed as a ranking factor. This means that no matter how great your SEO, and how many good articles and resources you offer, if your site loads slowly, you will get less traffic from Google, and the same goes for Bing and other search engines.

2. Users dislike slow loading websites – Have you clicked on a result in Google Search only to find that the page wouldn’t open for the next few seconds, what did you do? A recent survey conducted by Akamai and Gomez reveals that nearly half of internet users expect a page to load in less than 2 seconds. Anything more than that and they would hit the back button and click on another result.

If you run an eCommerce website, you should be doubly concerned about your WordPress speed. In the same survey quoted above, 79% of online shoppers said they would not return to buy from a site if it has performance issues, and 44% said they would tell a friend if they had a poor experience shopping in a site.

With both your traffic and revenue at stake, you certainly have to take steps to ensure your site is lightning fast. We recommend that you aim for a less than 1.5 second loading time, and this guide will show you how to achieve this speed.

Case Study

We will be testing and illustrating how the steps covered in this guide can improve your speed using a sample WordPress website.

This test website uses the Linear WordPress theme and has some plugins installed and activated. Here’s an initial benchmark of the page load speed for our test site.

WordPress Speed - Case study

As you can see, it loads in 1.87seconds. After implementing the steps below, we will redo this test to see what speed improvements we gained.

 

HOW TO MAKE YOUR WORDPRESS WEBSITE LIGHTNING FAST

In the rest of this article, we will be walking you through steps you can take to increase your WordPress Speed. If you want to skip all the work, we can have one of our WordPress experts take care of your speed optimizations and make your site lightning fast. You can request our service here.

Optimization steps for regular WordPress users

The optimization steps in this section are simple to perform and can be done by a regular WordPress user. Each one is also very important to your WordPress Speed. After going through the steps in this section, you may run a page load test again to see how your speed has improved.

1. Use a Caching plugin

When a request is made to your site, WordPress processes php scripts and generates html, and other content. With a caching plugin, the processed html content from a previous request can be saved and sent on the next request without running any php scripts, thus cutting page load time.

We recommend you use the WP Fastest Cache plugin to cache your content.

To do this, login to your WordPress Dashboard and go to Plugins > Add New. Search for WP Fastest Cache and install it.

WordPress Speed - WP Fastest Cache

After installation, click Activate to enable this plugin.

Next, click on WP Fastest Cache on the left side menu. This will open the settings page for this plugin. Enable the options as seen in the picture below:

WordPress Speed - Configure cache plugin

Lastly, click Submit to activate caching on your site.

You should also set your cache timeout, which is the amount of time after which the cache will be cleared and refreshed. To do this, switch to the “Cache Timeout” tab and click Add New Rule.

WordPress speed - Cache deletion cycle

In “If REQUEST_URI”, select “All”. In “Then”, select your duration after which cache is cleared. This duration should be determined by the amount of traffic you get to your site. If you get a lot (500 hits per minute for example), you can select a short time like 5 minutes. Next, click Save to activate this clearing schedule.

WordPress Speed - Set cache deletion cycle

If your site doesn’t get much traffic and you select a short time, by the time the next user browses to your site, the cache is already cleared, which means content has to be loaded through PHP, and this plugin will have no effect on your speed.

One thing you should keep in mind about caching is that if it is enabled, changes you make to your site may not immediately be seen, as WordPress may still be serving cached pages. If you encounter this issue, simply use the “Delete Cache” tab to clear your cache and you will be able to see your changes.

2. Minify and combine WordPress code

To minify your code means to remove unnecessary characters, spaces, and lines, to make the file smaller. The resulting smaller size would also mean the code loads faster and your WordPress speed improves.

To combine your code means to join all the Javascript and CSS files needed to display a page. After combining, you end up with one Javascript and one CSS file, and this reduces the number of http requests needed to load the page, which in turn will also make the page load faster.

You can minify and combine WP code using the WP Fastest Cache plugin we installed in step 1. To do this, click on WP Fastest Cache on the main menu on your Dashboard. Next, tick the four options to enable minifying and combining of code (see picture below).

WordPress Speed - Minify and combine scripts

In addition to minifying and combining the files, you can also reduce their size using Gzip compression.

3. Enable Gzip Compression

With Gzip Compression, your web pages will be compressed to a much smaller size before being sent to a browser. This reduction in size means the pages are downloaded a lot quicker, and your WordPress speed improves.

You can enable Gzip Compression using the WP Fastest Cache plugin. On the settings page of this plugin, tick “Gzip”.

WordPress Speed - Enable Gzip compression

Click Submit to save your changes.

4. Optimize images

Images are important to every website. You cannot write captivating content, showcase items for sale, or tell a story on your travel or news blog without using good images.

However, images are usually larger in size than most other content on your webpage, and can slow your site down.

There are a two major things you can do to make your images load quickly:

–  First, you should save your images using jpeg format. This format stores good quality images in smaller sizes than png does. We recommend you only use png format when you want to preserve transparency in an image.

– Secondly, you can use image compression to reduce the size of your images.

For example, below are two pictures.

Picture 1

WordPress Speed - Large image

Picture 2

WordPress Speed - Sample image small

Both pictures look exactly the same, but what you may not realize is that the first picture is 3.57mb in size, while the second is 960kb. Using compression tools, I was able to reduce the size of the second picture by more than 74%. A page containing the optimized image will load a lot quicker than the first one.

The good news is, you can install a plugin in WordPress to help you automatically compress your images. A very good plugin for this purpose is “Smush Image Optimizations and Compression”. Please install and activate this plugin.

After activation, you would be taken to the plugin page. Click Bulk Smush Now to begin optimizing all your images.

WordPress Speed - Smushing images

Also, whenever you upload a new image, this plugin will automatically compress it.

Note however that on the free version of this plugin, only images less than 1mb would be optimized. To optimize all images, use the premium version, or consider using reSmush.it plugin which is free to use.

5. Enable lazy loading

This is another way to handle images so they do not slow down pages. With Lazy Loading, images only get loaded onscreen when the user scrolls to the part of the page where that image appears.

This way, the page is displayed much quicker since users don’t have to wait for all images to be loaded.

You can enable lazy loading by installing and activating the BJ Lazy Load plugin.

WordPress Speed - Lazy loading

This plugin starts working after it is activated. However, you can customize the options by going to Settings > BJ Lazy Load on your dashboard.

6. Use a Content Delivery Network

A content delivery network (CDN) is like a cache, but instead of storing the static files in your server, CDNs have servers in many different regions.

When a request is made to your site, your CDN takes a copy of the static files served to the client and sends it to all its servers in different locations. The next time a user makes the same request, the CDN serves the stored files using the server closest to the location of the person who requested the page, and this improves your WordPress speed.

We recommend MaxCDN for WordPress. This CDN can be configured using the WP Fastest Cache plugin we already installed.

WordPress Speed - Content delivery network

MaxCDN has a step by step tutorial on how to do this integration. Please start from step 6 as we have already done 1 to 5 in this guide.

7. Use Excerpts in your homepage

The performance of your website homepage is very important. It is likely the first page many users will see, and with which they will form an opinion about your site.

By default, WordPress sets this page to load the full contents of several of your posts. This can seriously slowdown your homepage.

To fix this, change the setting to display only excerpts of your post:

Go to Setting > Reading.

WordPress Speed - Show excerpts

Change the feed setting to “Summary” and save the changes.

WordPress Speed - Show excerpts

8. Limit Comments per page

If you have a really busy website which gets a lot of comments, you can reduce the size of your pages by limiting the number of comments loaded, with the option for the user to expand to view more comments. This reduction in page size will help you page load faster.

To control how many comments are displayed, go to Settings > Discussion on your WordPress Dashboard.

Under “Other comments settings”, tick the “Break comments” option and set the number of comments to 15 (or any other number you choose).

WordPress Speed - Limit comments displayed

Lastly, scroll down and click Save Changes.

9. Clean up database

Over time, your database becomes filled with data that you probably don’t use anymore. This could lead to database overhead, which in the simplest terms, means your database is no longer working optimally. To fix this, your database needs to be optimized from time to time.

With the paid version of WP Fastest Cache, you can optimize your database by going to the DB tab. Alternatively, you can use the “Optimize Database After Deleting Revisions” Plugin.

Install and activate this plugin in your WordPress site. After activating it, you would be taken to the page displaying all plugins. Search for this plugin and click Settings. Next, set it up as follows.

WordPress Speed - Setup database cleaning

Scroll to the bottom and click Save Settings. Next, click Go To Optimizer.

WordPress Speed - Database optimizer

In the optimizer page, click Start Optimization.

WordPress Speed - DB Optimization

After a few moments, you would see the optimization results.

WordPress Speed - DB optimization report

Now you have a high performing, optimal database. Another great thing about this plugin is that, according to the schedule we set, your database will be optimized each month without you lifting a finger.

 10. Turn off pingbacks and trackbacks

Trackbacks and Pingbacks are a nice way for WordPress Bloggers to communicate with their site. However, these features can eat up resources and slow down your site. Add to that the fact that most pingbacks and trackbacks are SPAM, then it makes sense to disable them.

To do this, go to Settings > Discussion in your dashboard. In the “Default article settings” section, uncheck “Allow notifications from other websites”.

WordPress Speed - Disable pingbacks and trackbacks

Scroll down and click Save Changes.

 

Case study result after optimization steps for regular users

Earlier, we measured the page load speed of our test site and got 1.87seconds. After applying some of the steps above, we ran the test again using Pingdom, and here are the results:

WordPress Speed - Optimized case study result

As you can see, we went down from 1.87seconds to 0.65 seconds. By using these WordPress Speed steps, we were able to reduce the page load time by 1.22seconds. That is quite impressive!

 

WordPress speed optimization steps for advanced users

If you are a more advanced WordPress user, with experience tweaking hosting settings and configuration files, then you can further increase your page load speed with the steps covered in this section.

1. Enable Keepalive for transfer connections

With keepalive, several files can be transferred using the same connection. If this is disabled, a new connection will need to be created for each transfer, and this can greatly slow down your site.

To enable keepalive, you would need to add an instruction to your .htaccess file. Follow these steps:

Access your WordPress host using ftp.

Next, find your .htaccess file, right click on it, and select View/Edit.WordPress Speed - Enable keepalive

Add the following code to the file:

<ifModule mod_headers.c>

Header set Connection keep-alive

</ifModule>

Save the file and allow Filezilla to upload the new file when prompted.

2. Disable hot linking of your content

Hotlinking means a site owner getting the url of images, video, or other resources on your site, and using this url to display the content on their site. So each time the resource is displayed on their site, it is actually served up by your web server, thus consuming bandwidth. This can make your site load slower.

You can disable hotlinking using your .htaccess file. Here’s how:

Access your WordPress host using ftp.

Next, find your .htaccess file, right click on it, and select View/Edit.

WordPress Speed - Disable hotlinking

Add the following code to the file (replace fixrunner.com with your domain):

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http://(www\.)?fixrunner.com/.*$ [NC]

RewriteCond %{HTTP_REFERER} !^http://(www\.)?google.com/.*$ [NC]

RewriteRule \.(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|xml|php|png|css|pdf)$ – [F]

Save the file and allow Filezilla upload the updated file when prompted.

3. Set Expires header for static content

Using expires header, you can allow browsers to cache static files for the time you specify. For example, if you specify 1 month, static files will be stores in user browsers for a month. After that time passes, they would be requested once again and stored for another month.

This greatly reduces the requests to your server, and thus speeds up your Website. You can set expires header using your .htaccess file. Follow these steps:

Access your WordPress host using ftp.

Next, find your .htaccess file, right click on it, and select View/Edit.

WordPress Speed - Set expires header

Add the following code to the file:

<FilesMatch “(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css|woff)$”>

ExpiresActive On

ExpiresDefault A2592000

</FilesMatch>

The filesMatch line specifies the filetypes that would be cached.

ExpiresDefault specifies the duration in seconds for which the files would be stored – in this case, 1 month.

Lastly, save the file and allow Filezilla upload the updated file when prompted.

Core Optimizations To Improve WordPress Speed

If you have tried the steps above and observed that your page Speed is still not as fast as you wish, then there is likely an issue with one of the following core aspects of your site:

– Hosting

– DNS provider

– Themes

– Plugins.

These core aspects can be compared to the engine of a car. If a car engine is bad, reducing the car weight, adding body kits, and renewing suspension parts will hardly do any good for your speed.

Similarly, these core aspects of your WordPress site need to be good first, before other optimizations can help improve your WordPress Speed.

1. Hosting

If your website loads really slow, and you can hardly get it to improve, then it is time for a new host. Your Webhost is one of the greatest factors that affects your speed. If their servers are slow, your site will be slow.

We generally recommend WPEngine for clients who want lightning fast loading speed. WPEngine is a managed hosting platform for WordPress and it comes prepared with speed optimization features. You can get WPEngine hosting as well as WordPress technical support using our Rocket plan. This all in one plan gives you both performance and reliable WordPress development, fixing, and ongoing support.

The fact about hosting is, most people aim for a bargain deal on a shared hosting plan. But the downside to this is the servers may be slow.

If you are doing anything serious with your blog (not just tossing in an article every once in a while), then you need a hosting plan that can support your traffic growth and your business, and most importantly, appeal to the mostly impatient people on the internet. For this, we recommend you check out WP Engine on our Rocket Plan.

2. DNS Provider

When a user attempts to open your site, the very first communication is with your DNS provider. Now if their servers take 200miliseconds to respond, that’s already too much delay and you are going to have WordPress speed issues.

The solution to this is to choose DNS providers with fast response times. You can see the comparison of response times among the most popular providers at DNS Performance.

WordPress Speed - DNS Optimization

If your provider is ranked well, great, you can skip to the next item. If not, then it’s time to move your domain to a faster provider.

3. Themes

Many modern themes come with a ton of features that you do not need and may never get to use. These bloat of features can reduce your WordPress Speed.

Instead of using a theme with a ton of features, choose a lighter theme and add only the features you need using plugins.

Also, many free themes (and some premium) are poorly coded and not optimized for speed. For example, where a single query to the database would do fine for an experienced, clean programmer, another who is simply shooting out a free theme may make several calls to the database and not bother about how this would affect speed.

Thus, you want to use a cleanly coded, lightweight theme for your blog.

4. Plugins

There is the general belief that having many plugins slows down your site. While there is slight truth to this, the fact is, if you have 60 efficient, well coded plugins, your site will run well. But if you have 10 plugins, and 1 of them is poorly coded, that one alone can ruin your WordPress Speed.

Gladly, you can scan your plugins to see those that are slowing down your site. To do this, you would need to install the P3 (Plugin Performance Profiler) plugin.

Follow these steps to install and use P3 plugin:

In your dashboard, go to Plugins > Add New.

WordPress Speed - Add new plugin

Search for p3 and click Install Now on the plugin.

WordPress Speed - Install p3 plugin

After the install completes, click Activate.

WordPress Speed - Activate p3 plugin

After activation, you will be taken to the general plugins page. Search for the P3 plugin and click Scan Now.

Next, click Start Scan in the scan page.

WordPress Speed - Scan plugins

Set the scan name and select “Auto Scan” to begin scanning.

WordPress Speed - Scan plugins

When the scan completes, click View Results.

WordPress Speed - Plugin scan resutls

A pie chart is used to display the performance of all your plugins.

WordPress Speed - Plugin scan report

As you can see, the report shows that WordFence security plugin has the most impact on the page load time. In fact, it consumes half the time it takes to load all plugins.

If I want to further optimize speed, I can uninstall the WordFence plugin and install another security plugin in its place. After installing, I can run the performance audit once again to see how the new plugin performs.

 

How Can You Use This Information

If you are serious about making a living out of your WordPress site, you certainly want to ensure you can get and keep steady traffic and loyal readership. For this to be possible, your site absolutely has to load quickly. As we considered in the second section of this article, a slow site will kill your SEO ratings, and harm your ability to monetize.

Also, from our case study, we were able to get our test site to load in just 653miliseconds by using some of the steps covered in this guide.

If you want your WordPress site to load really fast, go through all the steps in this guide and try to implement them on your site. You will achieve blazing fast results!

Have you tried these steps? Do you have other suggestions for optimizing speed? If yes, we would love to hear them in the comments section below.