Speed up WordPress: The Best Guide for WordPress Speed Optimization

Speed up WordPress: The Best Guide for WordPress Speed Optimization

Should you speed up WordPress? In all cases, the answer is always yes – and here is why.

WordPress speed optimization has a huge influence on your website because it starts a huge chain reaction. What starts as simple WordPress performance tuning ultimately influences everything; from traffic to user satisfaction – which eventually leads to bigger profits for the site owners.

However, if you don’t speed up WordPress site, things will only get worse with time. Why is WordPress so slow? It is actually quite simple. As the sites accumulate more and more data, the performance only gets slower. WordPress slow loading can be pretty frustrating for the users so the user satisfaction will also get significantly lower the slower the site gets. Basically, nobody likes their WordPress slow.

Table of contents

Luckily, it can all be avoided – and pretty easily, too. If you optimize WordPress site on a regular basis, WordPress speed should not be an issue anymore. If you want to learn how to speed up WordPress, stay with us for a little longer because we have collected the best techniques and tools to help you make WordPress faster.

How to Test Site Speed

The tricky part about your website is that you don’t have the clearest idea of how fast or slow it exactly is. It is quite possible that it loads fast on your computer, but that doesn’t have to be the case with all users’ computers.

Since you spend more time on your website than any of your users, your browser caches its static elements on your hard drive which eliminates the need of loading them every single time. Unfortunately, the first time visitors of your site cannot say the same. Also, the speed can be influenced by different types of internet connections as well as by locations.

Basically, if you want to have a clearer picture of the actual speed of your website, you need to test it by speed-testing tools such as GTmetrix and Pingdom. The second one even gives you the option to test your site from different server locations.

Is your WordPress running slow?

Is your WordPress site loading slow? To know the answer to that question, we first need to know what speeds are considered optimal. The shortest answer is that you should aim for loading time under 2 seconds.

The research has shown that an average user expects the site to load in under 2 seconds. On top of that, two seconds is also the cutoff point Google stated for e-commerce sites in 2010.

How to speed up WordPress Site

There is a number of different things that influence your website’s speed. In order to understand how to speed up WordPress efficiently, we need to understand all these different elements that have an effect on the page loading.

Hosting is Important

This might sound like something that goes without saying, but we often focus on the big things and forget about the basics. One of the basic things is choosing a good host to house your website.

You will find a number of cheap hosts out there but keep in mind that this is not one of those things where saving money pay off. Invest in a quality host because it will definitely pay off.

How do I choose my Host?

Apart from avoiding the cheapest hosts out there, there are several other things to keep in mind when choosing a host for your website.

First of all, try to avoid shared hosting if possible because the “neighbors” on your server can dramatically slow down your site. If there is no need for you to run your own server, a dedicated server should suffice. Think about VPS as it provides a good balance of speed, comfort, and cost.

You could also go with one of the growing offers of managed WordPress hosting. One of the biggest advantages here is the fact that those servers were specially optimized for WordPress. Check out the prices and see which option better fits your budget.

Update your Web Technology

Your core technology has to be up to date if you want to speed up WordPress website. There is a reason why the web technologies including HTMP, PHP etc. get newer versions. The reason is – they are constantly improving, getting new features, and becoming faster.

With a good host, you won’t have to think about this too often because the web technologies will be updating automatically. However, make it a habit to check them from time to time just to be sure that you are using the right version.

One thing to keep in mind, however, is the fact that some older versions of WordPress and older code aren’t compatible with some of the latest web technologies. For every case, whenever you are updating, just make sure that you can go back in case something doesn’t go as planned.

Use the Latest Versions of WordPress

The update rule applies to WordPress itself as well so make sure you are using the latest version of WordPress and all its components. Every new version includes new features, bug fixes, and other elements that will help you speed up your site.

However, in this case, it is not only about the speed. In fact, keeping your website up to date is a security issue as well. WordPress fixed new vulnerabilities as soon as they become known so make sure your website is always safe and secure.

Choose Your Framework and Theme Smartly

If you choose a framework that is full of all kinds of features that you will probably never use anyway, it will only drag you down and make your WordPress site slow.

If you don’t know which framework to choose, you could always go with the default WP theme known as the Twenty Fifteen framework. It is quite simple and pretty speedy.

Perform Regular Database Maintenance

If you want to keep your database lean and usable, you have to maintain it regularly. The thing with the database is that it easily gets bogged over time if you don’t clean all the unused data and other unnecessary things that only slow it down.

There is a number of useful tools to help you with the database maintenance, for example, WP-Optimize, and WP-Sweep.

Plus, while you are at it, reduce the number of your post revisions.

You can just add the following code in your wp-config.php

define('WP_POST_REVISIONS', false);

Set Up Monitoring

We mentioned before that sometimes you aren’t even aware how slow your site actually is. If you don’t monitor the speed regularly, you can’t know it is time to fix it.

Set up monitoring and measure your site speed frequently in order to take the necessary action whenever needed. Use tools like Pingdom which offers automatic monitoring and notifies you via email whenever your site gets slower than recommended.

Decrease your Server Requests

WordPress slow load can also partially be improved by reducing server requests. When you think about it, it is quite logical: The more server requests necessary to load a site – the longer the loading takes.

You can reduce server requests to a minimum by doing this:

  • Lower the number of posts shown on a page
  • Only show post excerpts, no full posts on your archive pages (find the option under Settings > Reading)
  • Split longer posts into pages – it’s easy
  • If you get a lot of comments, break them up into several pages (Settings > Discussion)
  • Reduce the number of images and other elements on your page
  • Uninstall unnecessary plugins, especially slower ones (find them with this plugin)
  • Deactivate plugins you are not using permanently
  • Enable lazy loading to delay loading images until they are actually visible on the page
  • Reduce external resources such as fonts if they aren’t necessary

You can check the detailed list of server requests with the tools like Pingdom and GTmetrix. Once you see the requests that could be eliminated, make sure to get their number to a minimum.

Optimize Images

Image source

Since images take up more space than text and CSS, they have to be made as small as possible if you aim to speed up WordPress website. However, they also have to be optimized in a way that doesn’t compromise the quality – and that’s where the compression comes in.

If you want to compress the images, the smartest thing to do would be to do it before you upload them to the website. You can use services such as TinyPNG, or you can simply compress them in Photoshop with the option “Save for web”.

You can also automate the process with image optimization plugins such as WP Smush or EWWW Image Optimization. Both plugins will compress any image you upload to your site.

Keep in mind that WordPress creates several sizes of the images you are using in your content and you can choose the one you prefer. However, uploading a full-size image and then shrinking it is something that should be avoided because it will slow down your site.

Avoid Hosting Videos on Your Website

Let’s start off by saying that WordPress is entirely capable of playing and hosting videos but just because you can do something, it doesn’t mean that you actually should. Especially if you have a limited hosting account because it will cost you bandwidth.

In addition to that, videos make your website a lot larger which also means it becomes harder to back up. And with all that in mind, why would you even host your own videos when there are so many great hosting sites that can do it for you?

In addition to that, with auto embeds, all you have to do to include videos in your content is to simply copy the YouTube, Vimeo, DailyMotion, or other links and paste them into the WordPress editor.

Enable Caching

Image source

Whenever someone requests to see your web pages, WordPress dynamically creates HTML version of them. Of course, that is also a process that takes some time and slows down the site.

With that in mind, it would be useful to have the finished HTML pages at hand all time – and you can achieve that by enabling caching. There are several useful caching plugins you can use, including WP Super Cache, or W3 Total Cache. If you wish to do have a bit more control, you can also implement caching yourself via .htaccess.

You could also check with your host whether or not they provide their own catching solutions. Server caching is also a good way to go simply because it is the easiest way to enable caching since you actually don’t have to do anything.

Concatenate Your Files

When you ask yourself: “Why is my WordPress site so slow?”, always keep in mind that you need to have as few server requests as possible. So how to make speed? Well, when it comes to the files, you should combine them into fewer and larger files to reduce the number of files that need to be downloaded. This process is called concatenation.

Downloading one large file is faster than downloading multiple smaller files, especially if you have to download them one by one. Luckily, there are some useful concatenation tools that could help you with that.

For developers, one of the best tools to check out is Gulp, while for everyone else there is Autoptimize. The plugin automatically combines all your HTML, CSS and JavaScript files into one.

Once you install the plugin of your choice and activate it, it will automatically do all the heavy lifting for you.

Minify Your Files

Minifying is a simple yet brilliant concept that will also help you speed up WordPress. Let’s try to explain it in the simplest way possible.

When you take a glance at a code file, for example, CSS sheet, you will see that the code is organized in a way to make it readable. Or at least, it should look like that. Formatting and comments make code easier to understand. However, that does not apply to computer and browsers.

While a developer who takes a look at the formatted code will be able to read it easily, computers and browsers don’t need all that to execute the code. In fact, formatting will make the file larger and the larger the file – the longer the download time.

To avoid that, you will have to minify the files. You can easily do that with Autoptimize or W3 Total Cache, while the developers will probably prefer plugins such as Gulp and/or Grunt.

Enable Gzip Compression

You probably already know that one of the easiest ways to make your files smaller is by compressing them. We already mentioned the image compression but you can actually compress all of your WordPress files.

Every website is basically made up from a number of files, but that is not the only reason why websites are great candidates for compression. The truth is that repetitive data are the easiest data to compress and the code is nothing if not repetitive.

Once you compress all your WordPress files, they will become smaller hence faster to download, thus helping you speed up WordPress. In addition to that, WordPress data compression is no longer an issue because all modern browsers are perfectly capable or interpreting compressed data.

Disable Hotlinking

If you are not familiar with the term “hotlinking”, it simply means using links from another site for the images in your content instead of hosting them on your own site. The problem with this practice is the fact that it can take away from your bandwidth and it won’t help you with your traffic either.

To stop hotlinking from happening, simply add the following 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]

In the example above, change ‘example.com’ to your website URL. This causes any hotlinked image to fail to load.

Avoid using Sliders

Sliders are definitely one of the things you want to avoid using if you want to speed up WordPress. What they do is:

You should simply delete all the sliders because there is no real value to them. Also, pick a theme that doesn’t require the sliders usage on your homepage.

Choose a good Social Sharing Plugin 

The problem with social sharing plugins starts with their usage of JavaScript – they use a LOT of it which can significantly slower your site.

To speed up WordPress, just display social sharing icons without the counts. However, if you think that it is worth it to compromise a bit of speed for the sake of increasing traffic, you could decide to display social counts anyway.

Content Delivery Network (CDN)

While there are numerous useful plugins to speed up WordPress, you might want to consider taking things one step further and using the content delivery network.

This type of network lets your visitors download all your static files from the servers as close to them as possible. This also means downloading them as fast as they can.

Let’s try to explain how it works.

What is a CDN?

CDN aka content delivery network or content distribution network is basically a network of servers that deliver the content to the users based on their location. The main purpose is to provide high availability and high performance.

A CDN is not a WordPress hosting service. You will still need a WordPress hosting service to build your website.

How CDN speeds up WordPress?

With WordPress hosting service, all your website visitors access the same server. The higher the traffic on your website, the slower the site. If the traffic gets even bigger, there is also a chance your website will crash and become temporarily unavailable.

According to a study by Strangeloop, a single second delay in website speed causes 11% fewer page views and 7% fewer conversions.

However, with CDN, you can stop that from happening because it will cache your server’s static resources like stylesheets, JavaScript, and images and serve them to the users from the server that is closest to their location.

Not only does that reduce the load on your hosting server, but it also really speeds up the whole process.

Popular WordPress CDN Services

Now that we know what content delivery network is, let’s take a look at some of the best CDN services.

MaxCDN

MaxCDN is one of the best WordPress CDNs out there. Not only are the servers spread all around the globe, but they are also equipped with the super fast SSD drives for maximum speed.

It is pretty simple to install and setup MaxCDN in WordPress. In addition to that, if you are using some of the WordPress caching plugins such as W3 Total Cache and WP Super Cache, you don’t have to worry because MaxCDN works great with them.

You don’t have to worry about managing your CDN either because MaxCDN comes with a very easy-to-use control panel that will allow you to purge cache, view setup locations, stay up to date with the latest reports etc.

MaxCDN also allows you to add SSL certificate or use a shared SSL certificate to make sure that your cached content is served through SSL/HTTPS. If you want to give it a try, you can sign up for 1-month free service before committing to the subscription plan that will cost you $9 per month.

Sucuri

Sucuri is a popular website security company. They offer both a really good WordPress firewall and CDN, which protects your website against all kinds of attacks, including DDOS attacks, malware, and other WordPress security threats.

All user requests will be scanned by the firewall even before they reach your hosting server. This way, all kinds of threats and spam will be blocked right from the start before any damage is done.

Another great thing about Sucuri is the fact that the servers are strategically spread all around the globe so your users are always close to at least one of them. With that in mind, not only will your network be secure but it will also be as fast as it gets.

Sucuri works with all popular CDNs on this list. This way, server loads is significantly reduced as Sucuri firewall blocks all bad requests before requesting cached content from MaxCDN.

Cloudflare

If you are running a small website, Cloudflare might be just the thing you are looking for. One thing to keep in mind though is the fact that the free plan comes with limited DDoS protection and even the paid plans don’t include all of the features some of the competitors do.

The pros, on the other hand, are the facts that t is easy to setup Cloudflare CDN in WordPress and that it comes with a huge number of globally distributed servers. It also automatically caches static content.

Thanks to an easy-to-use control panel, setting Cloudflare up, cleaning up the cache, and monitoring performance shouldn’t be a problem for any user.

Another feature that stands out with this service is their so-called “I am under attack” mode. Before Cloudflare sends the users to your website, it shows them a security page for a brief moment while analyzing the traffic.

See our comparison of Cloudflare vs Sucuri to see how they protect your website against DDoS attacks and traffic spikes.

StackPath

StackPath comes with a secure CDN that not only has a large network of servers across the world, but it also protects your website from DDoS attacks thanks to the great load balancing and blocking features.

All plans come with a website firewall that further reduces server load on your site and helps you speed up your website. StackPath is easy enough to set up as it offers many developer-friendly tools and APIs.

KeyCDN

If you aren’t sure how to speed up WordPress site with the right CDN service, KeyCDN is also one of the options worth considering. Especially if the majority of your users come from North America, Europe, and Asia Pacific regions where the KeyCDN servers are located.

KeyCDN is easy to set up, it includes DDoS mitigation, as well as free and custom SSL, HTTP/2 support, Restful API support, SSD servers, and easy-to-use control panel.

As far as the costs go, this system doesn’t come with the classic subscription plans with a fixed price. Instead, you pay as you go. This is great for smaller websites but as your traffic grows, the costs will grow as well.

Rackspace

Rackspace is known for their powerful cloud infrastructure – and their great CDN solution is just the cherry on the top.

Although the setup is a bit more complicated with this one, it is actually worth it because Rackspace comes with a wide variety of amazing features which make it a bit more complex but also great for even the most advanced users.

Rackspace pairs great with WordPress and can be easily used with popular WordPress plugins. Unfortunately, it does not offer any DDoS mitigation at all. For DDoS protection, you’ll need to use Sucuri or Cloudflare.

Incapsula

Incapsula is the CDN solution with the servers located all over the world and with the data center in South America. It works great with WordPress and it is also quite easy to set up. It pairs well with caching and other plugins so it shouldn’t cause any trouble on that front either.

It comes with website application firewall, SSL, 24/7 support, and DDoS mitigation as part of the paid CDN plans. The free CDN plan is also available but it does not include the mentioned features.

Inactive Plugins and what to do with them

Why is my WordPress site slow? Do inactive plugins slow it down even more? – Those are some pretty common questions and we have to say that there are some misconceptions when it comes to inactive or deactivated plugins.

The truth is that they do not slow down WordPress at all. You can take a look at how WordPress works behind the scenes to understand it a bit better.

Whenever somebody requests a page from your site, WordPress begins with the loading process during which only active plugins are loaded. WordPress simply ignores all the inactive ones so they, in fact, do not slow it down at all.

You could have hundreds of deactivated plugins on your WordPress site and it still wouldn’t affect the site’s performance in any particular way because WordPress simply wouldn’t load them.

So if you are looking for the reasons why your WordPress loads slowly, it is not because of the inactive plugins. Instead of focusing on them, you should check out our ultimate step by step guide to speed up WordPress and boost performance.

Should I Delete Inactive Plugins in WordPress?

So if the inactive plugins don’t slow down your WordPress, the next logical question is what to do with them. Should you delete them?

We believe that the better option than deleting your plugins would be to simply deactivate them. Deactivated plugins are not why WordPress is slow so there is no damage caused by having a bunch of deactivated plugins on your site.

On the other hand, maybe there will be a time when certain plugins will come in handy so it smart to have them there ready to be reactivated.

However, if you are sure that you will never need certain plugins, there is no reason to keep them on your site. Instead of getting notifications about your deactivated plugins’ updates, and similar, you could simply delete them and be done with them.

Another thing to keep in mind is the fact that the inactive plugins are mostly harmless, but they are still executable files. For example, in the case of a hacking attack, those files could be infected or used to install malware on your website.

As a WordPress security precaution, you should delete any inactive plugins that you don’t have any use for anymore.

Ending thoughts on how to speed up WordPress

There are many reasons why we should speed up WordPress. Lowering your website’s loading time means more satisfied users which indirectly means more profit.

If you own a WordPress website, you should test its speed regularly and improve it if it gets below the 2-second mark. This can be done easily by cleaning, compressing, and optimizing certain files, as well as by installing at least one useful WordPress speed plugin.

In this article, we went over basic techniques and steps that should help you understand how to speed up WordPress website quickly and easily.

If you enjoyed reading this articles about how to speed up WordPress, you should also read these:


Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /var/www/wpdatatables.com/wp-content/themes/tabor/components/post/content.php on line 60
Up Next:

WordPress image optimizer: What to use for your site

WordPress image optimizer: What to use for your site