Having a fast, high performing website is paramount to the success of your site. Without speed you might find yourself with lower rankings, or visitors getting impatient and leaving your site. However, there are plenty of ways to ensure your site is fast and gives its visitors the experience they expect. Keep reading for our top tips on how to speed up your WordPress blog.
1. Use decent website hosting
The quality of your website host will have a huge impact on the speed of your site. And not just for access time for your visitors, but also the reliability that your site won’t go down. For our site we started off using GoDaddy and our site would often go down. Since then we have switched to FastComet who we are now big fans of. We also find their customer service is fantastic should you have questions and want help. Another popular provider is BlueHost which we’ve heard good things about, although we haven’t used them personally.
2. Add a performance and caching plugin
A caching plugin is another essential part of speeding up your WordPress website. Good options include W3 Total Cache and WP Rocket, although after trying both we now prefer WP Rocket. W3 Total Cache has a free version and is what we used when starting our site. WP Rocket on the other hand is a paid-only plugin which offers fantastic caching of your content, resulting in lightning-fast load times.
Prior to us switching to WP Rocket our TTFB (an important speed metric) was over 1 second on many pages, but now it’s in the milliseconds. Note that sometime our website might still seem slow. This might be due to a major update and whilst the cache is rebuilding.
3. Use a CDN
We currently use Cloudflare and have been very happy with their service. They currently serve over 200gb of data every month for us. As well as this they provide added security and have protected us against DDoS attacks. As well as this we’ve found their support service great whenever we’ve reached out to them.
APO (Automatic Platform Optimisation)
Automatic Platform Optimisation is a new feature that Cloudflare offers. It allows static HTML to also be cached to the end-user and a much quicker experience for your visitors. Note that although this is a great feature of Cloudflare we are using a caching plugin to provide similar results (see above). We do this as we make large amounts of edits on our site and therefore prefer to keep a bit of the caching closer to home. The plugin we use (WP Rocket) provides good options for updating, clearing and rebuilding the cache.
4. Keep images light
Images are a vital part of most websites and are essential to make articles more appealing or to illustrate the content. However having images which are high resolution (lets say 1500px+ and multiple megabytes) will have a huge impact on the performance of your site, even if you use lazy loading or a CDN.
What we do for our site is resize images to around 800-1200 pixels wide for the main content and also reduce the quality so that the file size should only be around 100-200kb. Sometimes images might be larger than this, but this is what we aim for. Our images then get served through our CDN (Cloudflare) which also compresses them and sometimes serves them as WebP.
There are various plugins available that can compress your images and also convert them into special image formats such as WebP. Popular services include WP Smush and Imagify. We use our CDN for this process and also downsize our images before uploading so haven’t felt the need for these tools, however we can definitely see the benefits.
5. Use lazy loading
As well as compression and downsizing your images another way to keep your website fast is through lazy loading. This is where images that aren’t on the screen don’t get loaded until the user scrolls down the page, which then reduces the amount of data that is needed to be downloaded for the page to load. WordPress version 5.5 now has built-in lazy loading, which means you don’t even need an extra plugin for this. However, you could still use WP Rocket’s lazy loading functionality for some more advanced customisation should you wish.
6. Don’t add too many plugins
Nowadays you can find WordPress plugins for almost everything you’d want to do. However, the downside of having lots of plugins is that they will add extra load on your server, often lots more scripts to your site, and this results in more server requests for the end-user. So what we would suggest is that before adding any plugins to your website always have a good think about whether it is necessary and if it will impact your site speed. You could even do some before and after tests too (such as using GTMetrix) to see if it had an impact on performance.
7. Dequeue unnecessary scripts (Advanced)
It’s important to note that you should only dequeue scripts that you know aren’t necessary for the page. For example, we dequeue most of the WooCommerce scripts unless somebody is on the shop pages. You’ll find the code we used (as a base) on GitHub, although be sure to check it works for you, and adjust it if required. We then added this to our website using the Code Snippets plugin.
Warning: Make sure you understand a little about programming before you start adding custom scripts, as you can break things and possibly bring your site down. You can often disable code snippets if they aren’t working properly though. Also, note that backups are always a good idea!
8. Ensure any scripts are placed towards the footer
If you do manually add any scripts to your website then make sure you add these towards the end of your page. Such as after your </footer> tag. This helps ensure that the scripts will not interrupt the loading of the content should the script have an issue (and isn’t asynchronous). It’s important to note that you have to also be aware of dependencies. Such as for us we use Google Analytics and gtag events (a Google Analytics function) in our pages and other scripts, so as a result we add the analytics script in the header to ensure our dependent scripts definitely work.
Many scripts also have the async attribute too for external scripts which defers the loading of a script until it’s available and without holding up the rest of the page from loading. However, it’s generally a good practice when possible to place all you can towards the footer.
Your visitor’s user experience is one of the top things you should think about when setting up a WordPress website. This means that ensuring your site is as fast as possible, which is essential for it to be a success. Of course the quality of your content is another important factor too, but without speed then you’d be failing from the start.
Noticed a mistake? Let us know.