There is a lot that goes into the overall speed and performance of your WordPress website. First, there are the obvious things like image size and server resources. Most people can quickly grasp that sending a smaller image takes less time and using a faster server is, well, faster.
This guide will begin with the basic steps you can take on any server, even cheap shared hosting, to boost the speed of your site. Once the basics are covered, we will explore some advanced options you can consider.
The goal of site speed is simply to be faster than the competition in your niche.
Many people have unrealistic goals for their site speed. A photographer may have a site that is relatively slow because they are showcasing very large images. This is part of their business model and something they cannot remove from the site. Rather than attempting to make every page load in under 2 seconds, focus on simply making your site faster than the competition in your niche. Some sites may need to load in less than 2 seconds, and others may be fast if they load in under 7 seconds.
There are several tools available to test the speed of specific pages on your site. These are the three most popular:
- Google PageSpeed Insights
Additionally, you can track page speed within Google Analytics. This is a great way to understand how your site performs over time and when traffic spikes.
Location Based Speed Test
With Pingdom and GTmetrix, you can set a test location to see how quickly your site loads from various places around the world. Given that internet connection speed and traffic volume vary widely from one region to the next, it's a good idea to test your site speed from the location closest to your visitors.
Get a Baseline
Before you start working to improve the speed of your WordPress site, you need to collect some baseline data. Run a few speed tests using each of the tools listed above. Record those speed tests so you have an understanding of how fast your site is currently.
It's not uncommon to have a range of results showing your site loads in 7 - 10 seconds depending on the test tool used and the moment when the test is executed. This is because network traffic and testing location have a significant impact on the result. However, you can show that a page which was taking 8 seconds to load on average has improved because the average becomes 2 seconds after optimization.
Use Multiple Data Sources
While the Google PageSpeed Insights test is used as part of the algorithm in calculating your rank, it is not a good idea to over optimize or rely on one measure of page speed. Instead, you should strive for good results with all three speed test tools.
Plugins & Themes
One of the biggest problems with WordPress sites is that there is a plugin for everything and a theme for every design imaginable. Unfortunately, this leads many people to install plugins and themes that are not needed, outdated, or easily replaced with custom development.
As an example, there are plugins for setting up HTTPS, URL redirects, and many other things you could move to configuration files on the server. Sure, it takes some technical skill to make these changes to the configuration files. However, the investment in web development will pay dividends in site performance.
Review each and every plugin that is installed on your site.
- If there is a way to move that function into a server configuration file, make the change and remove the plugin.
- If you can use one plugin to complete several tasks, test the speed with each option and move to the plugin setup that is fastest.
- Be sure to consider the update history and schedule of each plugin and theme you are using. Outdated files on your server can leave gaps in your site security.
- Strive to use plugins from as few developers as possible. Differences in design style can lead to conflicts between plugins. One way to avoid this is to have fewer developers creating the plugins you use on your site.
- Use as few plugins as possible. 10 is better than 20, and 5 is better than 10. There is a strong connection between the number of plugins on a WordPress site and the speed of that site.
Themes are a little more straight forward than the plugins. While some sites have multiple themes installed, you do not need more than two themes. This is because you should have a parent theme for your site and a child theme. Anything more than this is unnecessary. Even if you plan to make seasonal changes to your site, you can install and remove the seasonal themes as they are needed throughout the year.
Report Speed Improvement
After cleaning up the plugins and themes on your site, run another set of speed tests. Record the results and calculate the average speed.
How are you doing so far? Join the WordPress Help & Support group on Facebook. Then, share your before and after figures for site speed simply from cleaning up your plugins and themes. The difference can be surprising.
Alright, you need to optimize the images on your site - and there is a plugin for that!
I know, I know. We just talked about avoiding plugins when possible. The thing about image optimization plugins is that you can run them once and remove them from the site. Here are a few of the most popular image optimization plugins:
In the future, you will want to be more careful with the images you upload to your site. Also, you may want to run an image optimization plugin on the site every few months just to catch anything that was not optimized before upload.
Simply install one of these image optimization plugins, run it, then uninstall it. If you regularly upload images that are not optimized, well, that's a habit your should break. Keeping an image optimization plugin on your site is going to slow the site down when you could simply upload optimized images.
How Fast Now?
Now that you have addressed plugins, themes, and image optimization - how fast is your site? Perform a series of speed tests and calculate the average load time. Add that to the conversation in the WordPress Help & Support group so you can see how your results compare with others.
Server, CDN, and Browser Cache
There are a few different areas where you can cache your website. First, there is the cache created on your server. This will boost the speed of the site a little bit, but there is more caching available. Next, you can cache your site on a CDN. Setting that up will be discussed in the next section. Last, you can cache your site in the browser.
The server cache is the copy of your website that is saved on your hosting server. This is what is eventually sent to the system accessing your website. If you have a CDN setup, that is the system which will access your hosting server directly. If you do not have a CDN in place, then visitors to your site will access this cache directly from your hosting server.
Without a server cache for WordPress, every request for a page on your site will require multiple calls to the database. The page is created in memory and sent to the computer requesting the page. Each time the page is requested, all this activity happens on your server.
When you have caching setup on your server, the first time a page is requested it is saved. The next request for that page will served the saved version and save the time it takes for multiple calls to the database.
The cache saved on your CDN reduces the number of requests that are sent to your hosting server. Instead, the faster CDN server delivers the requested files directly to the visitor on your site. One example of this is your company logo which may be at the top of each page. Rather than requesting that file from your hosting server, the CDN can send it from cache.
Continuing with the company logo example from above, browser caching reduces the number of requests to your site by saving common files on the local machine. The logo at the top of your page can be saved in the browser so it does not need to be requested from the server with each new page.
The point of caching is to improve the performance of your site and your server by reducing the number of requests made to the server. By saving files in the cache, they can be accessed locally or requested from a saved file rather than making a request from the database.
W3 Total Cache Setup
Since there are so many possible settings for different site and hosting configurations, here's a guide to getting setup with W3 Total Cache. If you need help with this process, that's just one of the many tasks we can complete for you through OptSus WordPress Management.
Reporting Speed Test Results
After you have caching setup on your site, it's time for another round of speed tests. Calculate your average speed test results as you did above and add them to the conversation in the WordPress Help & Support group. How much of a boost did your site receive from caching vs plugins & themes?
Now, we're getting into some of the big changes you can make to boost the performance of your site. If you're trying to squeeze just a little more speed out of the server you already have, using a CDN is a nice upgrade.
One of the free CDN options used by many sites is Cloudflare. You will need to make some changes to your DNS settings and install an optional extension for W3 Total Cache. However, this is one of those instances where you could use a plugin, but don't need one. The plugin for Cloudflare is unnecessary if you simply make some changes to your DNS settings.
If you need help setting up Cloudflare to work with your WordPress site, OptSus WordPress Management can take care of that for you.
Reporting CDN Results
Now that you have your CDN setup, run another set of speed tests and record the average load time. How much has your site improved since you started this process? Share your figures in the WordPress Help & Support group.
At this point, we have taken your shared hosting plan just as far as it can go. If you need to boost your site speed further, you will need to upgrade your server. The options below are ranked with the slowest hosting at the top, and the fastest options down the list. Simply look at where you are at and consider making the move to the next hosting option up from there.
$1 - $20 Monthly Shared Hosting
There are a range of shared hosting providers that are priced between $1 up to $20 per month. Generally speaking, the more you pay the more resources that are made available to your site. This is not always true, but you will need to test each host to see which is faster with your site.
Part of the reason for this lack of direct comparison is that it depends on which server your site is actually installed on. You can often boost the speed of your site with theses budget hosting providers simply by contacting their support team and asking to be move to a server that is less crowded.
Eventually, you will need to upgrade to better hosting as your site gets more traffic.
$25+ Monthly Hosting
The next step above the budget shared hosting options is managed hosting focused on WordPress. There are several providers in this group and their pricing tends to be $25 per month and up. As your site gets more traffic, you will need to move into higher priced service tiers.
Given the amount of work that goes into managing a server, these are still budget friendly options for a small and growing business.
Virtual Private Server (VPS)
The price of a VPS can be a little misleading. That is because you can get a low-end VPS for around $5 per month. At first glance, that seems like a very cheap hosting option. Until you realize that you only have a server running Linux. For the typical WordPress site, this means you will need to install the remaining components to build a LAMP stack and migrate your site to the new server.
If that sounds confusing, then a VPS is probably not a good option for you at this point. However, if you have the budget to assign this project to a developer - a VPS is a good step toward managing your own server. Expect the real cost to add up to somewhere around $50+ per month with an occasional bill from the developer for upgrades, migrations, and maintenance.
You get the most control over the speed of your website when you move it to a dedicated server. At this point, you will be spending hundreds of dollars per month on hosting and development services. When your business can afford these bills - move to a dedicated server and never look back.
For comparison, shared hosting providers will have hundreds or even thousands of sites on a single dedicated server. Now, your entire site can take full advantage of all those resources to make it faster.
The WordPress Codex has a guide to help you migrate your site from one server to the next. If you need some help with this, OptSus WordPress Management can take care of your site migration.
Have you made the switch to a different hosting provider? Who did you go with and how has that impacted your site speed? Run your speed tests and report the results in the WordPress Help & Support group to help others find fast hosting providers.
As a special bonus, if you chose to upgrade your hosting and use a VPS or dedicated server - install the PageSpeed Module. There is a version for Apache or NGINX and it will take care of a collection of server settings that relate to page speed. The easiest way to get 100/100 for desktop and mobile with Google PageSpeed is to install this module ad perform the basic optimizations listed above.
LAMP to LEMP with NGINX
Moving from the traditional LAMP stack to run WordPress on a LEMP stack with NGINX replacing Apache can offer a slight boost in speed. This is particularly true for sites that receive a fair amount of traffic. New sites that don't have an audience yet will notice little difference between LAMP and LEMP. However, it would be easier to start a new site on a LEMP stack rather than migrate it over after building an audience.
LAMP, LEMP, and NGINX are well documented now. This makes it easier to migrate your site if you need to take this extra step. Refer back to the speed of your competitors and consider making the switch to NGINX if you have already implemented everything else from above and still need to shave a few seconds. Again, keep in mind that this speed boost will mostly apply to times when your site has hundreds of simultaneous visitors.
If your site is already performing well with HTTPS, you may want to put off this migration. The added headache of moving to HTTP/2, for site speed, is only worth the effort if you can realize significant gains. Referring to the above statements about your competition - postpone your HTTP/2 migration for after you have implemented everything from above and you still need an edge on the competition.