21 Expert Tips to an Ultra-Fast WordPress Website
WHY DOES SITE SPEED MATTER?
There is much research that indisputably shows that the loading speed of a website is really important. In an age where new tech- nologies appear every day, where the speed of computers and the Internet increases greatly with each new innovation that becomes widely used, the attention span of the visitor is much shorter than it used to be a few years ago.
As a webmaster, you have only a few precious seconds to grab and retain your visitor’s attention and you shouldn’t waste those seconds on loading.It doesn’t matter if you sell goods, oﬀer services or have a simple blog. If your website is slow, you will be losing traﬃc, visitors and possibly money. Generally, if your website takes more than a second to load – it’s slow and needs optimising.
At Digitalberging, we have spent a lot of time developing a platform that optimises speed and applies performance enhancing technologies speciﬁcally for our WordPress customers. Although having a web host that uses the latest hardware and speed-enhancing tech-nologies is essential to your site performance, it is not the only thing. There are several other tools and techniques you can use and apply to improve the speed of your WordPress website and we’d like to share them with you.
1- IDENTIFY AND PRIORITIZE ISSUES
The ﬁrst thing you should do is ﬁnd out if you actually have a problem. The easiest way to
do so is to use benchmark tests. There are some free tools such as:
If you perform a benchmark test on your site using GTmetrix, you get results from both the Google PageSpeed test and Yahoo Slow test in a single report. The results are sorted in order of severity.
The Pingdom Tool displays results in several tabs, but two of them are the most important. The Waterfall, which shows the site loading time and how much time each resource takes and the Performance Grade tab, which gives you recommendations on how to improve, similar to GTMetrix.
There are many other tools out there and generally, if you have the time, the more tests you perform on your site the better. However, these two tools are usually suﬃcient to get a clear picture about how your website is performing in terms of speed.
Pro Tip: Even though most of the benchmarking tools will give you a “grade”, don’t go too far chasing it. If your website loads in under one second, you’ve done the biggest part of the job.
If the benchmark tests show you have an issue with your site speed, the next step is to identify the actual blockers. Although every website is diﬀerent and has its own set of speed issues, some problems are very common and it’s safe to start with them:
- Too many posts on the front page
- Too many social and sharing plugins and widgets
- Bloated themes with too many features Large and unoptimized images
PRIORITIZE THE ISSUES
Your research and analysis of the causes of slowness may result in a very long list of things you could do. But you need to prioritize that list. Fixing some of these problems may be time consuming, but will not result in major improvements in speed. There are two things that you should consider when prioritizing your ﬁxes:
- How diﬃcult will it be to ﬁx the issue?
- What eﬀect will resolving the issue have on your site?
You can use the answers to these questions in order to create a list of optimizations starting from those that will have the most signiﬁcant impact for the time spent.
2- PAGE SIZE & CONTENT OPTIMIZATIONS
1. REDUCE THE NUMBER OF POSTS SHOWN ON YOUR INDEX PAGE
Decreasing the number of posts shown on your homepage can
be easily done from the WordPress administration panel. Go to: Settings -> Reading Settings -> Blog pages show at most
Then, change the Blog pages “show at most” value to a lower number.
Alternatively, you can use a plugin like YITH Inﬁnite Scrolling. It will dynamically show more posts when your users scroll down near the end of your page, similar to the way Facebook shows more posts when you’re scrolling.
2. SPLIT LONG POSTS ON YOUR INDEX PAGE
If your site tends to rely on long posts, you may want to split them into pages using the <!–nextpage–> tag within the post content. By doing this, you will see a pagination under the page or posts and your users will be able to navigate through them by clicking on the next pages.
This will split one big and slow page into several faster ones.
3. REPLACE SLIDER WITH MULTIPLE IMAGES WITH ONE STATIC IMAGE
However, if you really need and want a slider, I recommend using Soliloquy. It comes in a free and a professional version, which includes more features. This plugin renders a fast and lightweight slider that has everything most people would need a slider plugin. Another good solution is the Meta Slider plugin which is another free and well-written extension.
4. USE APPROPRIATE IMAGE SIZES
Images are an essential part of a website and may need some time to be transferred from the server while the site is loading.
If you want to display an image 300×300 pixels, don’t upload a 1024×1024 pixels image and then set it to be shown smaller with HTML or CSS.
5. OPTIMIZE IMAGE SIZE WITHOUT DAMAGING QUALITY
I recommend using a free plugin called EWWW Image Optimizer. It optimises the ﬁle size of your images without damaging their quality and strips them oﬀ of all the unnecessary data that your camera saves when you take a photograph (e.g. GPS location of the photo, make and model of the camera used).
Even if the image ﬁle is reduced by just a few KBs, when you combine all the images on one page, usually the performance gain is signiﬁcant.
6. REDUCE THE USAGE OF EXTERNAL FONTS
Each font that you use from Google Free Fonts or another similar service has multiple variations, weight (300, 400, 500, 700), encoding (Latin, Cyrillic), style and so on.
Check your website and include only the font variation that you’re actually using.
Furthermore, if you’re loading a font for a small piece of text somewhere on your site, I recommend compromising on the design and simply using a font you already have on other pages.
7. MANAGE THE VOLUME OF COMMENTS ON YOUR SITE
If you get a lot of comments, this may be slowing your site in two ways. First – this makes your page more dynamic (if you have enabled caching, it has to be cleared more often) and second – each comment adds to the size of your page and HTML output.
In such cases, I recommend replacing the default WordPress comment system with a plugin called Epoch. It will replace the default way WordPress handles comments with a more optimised code that can really speed up your site especially if you get a lot of comments.
Disqus is also an option, but it’s a third party service that relies on a plugin to replace your default comment system with theirs. It will oﬄoad the comments from your site, but they will no longer be stored on your server.
8. ENABLE GZIP COMPRESSION FOR YOUR PAGES
With gZIP compression enabled, the ﬁnal HTML output of your site and some of the static resources will be compressed before being transmitted to your visitor. Then, your visitor’s browser decompresses the content before rendering. It’s much faster to compress and decompress this content than to transfer it with- out compression.
Enabling gZIP compression is very easy and requires almost no eﬀort. Simply add this code to the .htaccess ﬁle in your Word- Press main folder:
9. MINIFY AND COMBINE JS AND CSS FILES
10. ENABLE CACHING
Caching is a great technology that saves the outcome of diﬀerent operations your site has to perform in order to produce your ﬁnal content. It then serves this ready “product” to the next visitor of your site. With a good caching solution enabled and functioning, your site will be as fast as a static page until you make a change.
When this occurs, the page will load dynamically for the ﬁrst visitor after the modiﬁcation. Then, the cache will be refreshed and the next time it will load the much faster, cached version of the page.
The easiest way to cache your site is through a plugin. This saves the cached content on the server’s hard disk and signiﬁcantly improves site performance since your content won’t be dynami- cally loaded every time. WP Rocket is a great premium option, or if that’s outside your budget, try WP Super Cache.
Further down in the book I’ll talk about caching as a part of the services your hosting provider can oﬀer. When caching is enabled at the server level, the content gets saved not on the hard disk, but in the server RAM. This makes the site performance gains much greater since reading from the memory is faster than reading from the disc.
Both themes and plugins are essential to the speed of your site since they are basically pieces of code that your site executes when it gets accessed. That code often needs optimizations as well.
11. SELECT A REPUTABLE THEME FROM A SOLID PROVIDER
When choosing a theme, look for one either in the WordPress repository, or if you’re after a premium theme, look for a reputa- ble company that’s well known in the WordPress community.
Every hour you spend researching your theme provider and the theme itself will save you days later on when you invest time and money in your site and add all your content. Read reviews for the themes, try getting some actual feedback from users, check whether the company is trusted in the WordPress community.
Don’t trust a theme provided by an unknown designer that does not respond to his/her customers.
It’s important to have a well-written theme because the quality of the theme code aﬀects every part of your site. For example, some themes have a plugin functionality and added features such as relative posts under your normal posts. Such functionality often causes slow loading times because of the way queries to the MySQL database are structured. In short, you don’t have to be a good developer to have a good site, but make sure your theme is written by a good one.
12. AVOID BLOATED THEMES
Functionalities such as carousels and sliders should not be part of your theme. You can always add them using a plugin later on when you want them to be loaded. So, pick a theme that has the main functionality you need without tons of additional features.
13. ALWAYS USE A CHILD THEME WHEN CREATING YOUR SITE
WordPress updates are released often and many of them include performance optimizations. Themes are harder to update, but the good ones often get new versions with numerous updates.
Using a child theme allows you to keep the parent theme
14. OPTIMIZE FOR MOBILE DEVICES
Every year more and more traﬃc comes from mobile devices. Tablets and smartphones are becoming even more popular for browsing than standard desktop computers. That’s why, it’s important to make sure your site works as fast as possible on such devices.
Usually, when people browse your page on their mobile phone, they are on 2G, 3G or LTE, which is generally a slower connection than the one they have at home. That’s why it’s good practice to show only what users need to see on mobile, rather than a shrunken version of your pages. Here are a few steps for optimi- zing your mobile site:
Test your pages with the Google Mobile-Friendly Test which will give you information if a certain part of your page is not well optimised for mobile.
- Always select a theme that’s either mobile-ﬁrst or has a native mobile version. When you run tests for your website, make sure you test the mobile version as well.
- If your theme doesn’t have a mobile version, consider using a plugin such as WP Touch that will generate a mobile version of your page. However, having a native mobile version is always preferable.
15. WHEN USING ICONS, USE AN ICON FONT
Icon-like images have become a trend in the past few years. If you want to use such images, try utilising an icon font rather than separate images. Genericon’d is a great plugin that will help. With it, you can add vector icons as if they were normal alphabet symbols.
16. DON’T OVERLAP FUNCTIONALITY WITH PLUGINS
If a plugin includes several functions, make sure you use most of them. Don’t install another plugin if one of your active plugins can already do the job.
For example, if you’re using the Yoast SEO plugin and you want to have a Google XML Sitemap, just enable this functionality in the plugin settings page instead of adding another plugin, even though there are dozens available in the plugin repository.
17. ALWAYS KEEP YOUR PLUGINS UP-TO-DATE
Most of the updates in plugins either oﬀer security patches, new features, bug ﬁxes, speed improvements or a combination of the above.
In addition, there are new features, functions, etc. constantly being introduced with WordPress core updates. A lot of them are designed to allow plugins to operate better and faster. By keeping your plugins updated, you will get all the performance improvements from the newest release.
Keeping your plugins up-to-date will allow you to use more recent PHP versions including PHP7, which gives your site a huge performance boost. If you’re not using a plugin, delete it. There is no need to keep them on your account. It’s good security practice and one less thing to slow down your back-end.
18. CLEAN UP PLUGIN OPTIONS FROM YOUR DATABASE
Some plugins leave options and settings data in your database after you delete them. To get rid of that garbage, use a plugin called Garbage Collector.
Most plugins don’t bother cleaning your database after you’ve uninstalled them. They delete the plugin ﬁles, but the tables with diﬀerent settings they’ve been utilising, remain. This plugin will identify the options that are not being used by any plugin and allow you to remove them. Even though that’s a relatively safe operation, I recommend backing up your database before erasing any data.
4- SERVER & HOSTING OPTIMIZATIONS
19. TAKE ADVANTAGE OF SERVER LEVEL CACHING
WordPress specialised hosting providers often provide some form of caching. At Digitalberg, we have implemented NGINX as a reverse proxy and developed a special WordPress plugin called WP Fastest Cache
You can easily enable server-level caching from your control panel, giving you a huge performance improvement. Depending on the website, your loading time can go from 2-3 seconds to 0.5 seconds! Furthermore, using such a caching service will increase the amount of traﬃc you can handle on your account. A test with a default WordPress installation on the same Digitalberg hosting account shows amazing results:Needless to say, that’s a huge peak in traﬃc that’s handled without problems mostly because of the caching system running on the server.
For websites with big databases, you can also implement object caching like Memcached or Redis. These are services that your hos- ting provider must install on their server, and provide you with the ability to use them with your application. For example, at Digitalberg we provide Memcached as part of our WordPress performance services, that can be activated with a single click.
20. USE A CDN
If you have visitors from diﬀerent geographical regions, it’s a good idea to use a CDN service such as Key CDN , Microsoft Azure, Amazon, Max CDN or CloudFlare. CDN providers essentially clone your website amongst multiple host nodes. Then, when a visitor requests a URL, it gets served from the closest host node rather than from the central server. Digitalberg oﬀers free CloudFlare integration for our customers, but you can enable any other CDN service of your choice.
21. USE SSL AND UTILIZE HTTP/2
SSL protects your visitors and customers by encrypting all the information travelling between browser and server, ensuring extra security for your users and their data. It is essential for eCommerce sites and those handling sensitive data, and strongly recommended for all websites following recent developments on the web. Previously, SSL certiﬁcation was believed to slow down your website. Not any more! If you have a server that supports HTTP/2, and a working SSL certiﬁcate, your traﬃc will be going through HTTP/2.
The HTTP/2 protocol is much faster and allows the browser to make multiple simultaneous requests for resources to the server, which results in faster and safer sites. Learn more.
If you’re worried about the cost of an SSL certiﬁcate, there is a free solution called Let’s Encrypt. With it, you can maintain the security of your websites without compromising on speed.
Looking to install free SSL: qureshi.me/freessl/
Optimizing for speed is a continuous and important part of building and maintaining your WordPress site. Without optimization, you risk paying more, losing visitors and conversions and even damaging your brand and reputation.
By following the above steps, many of which can be implemented without a deep level of technical expertise, you will be well on your way to ensuring an optimal website experience for all your visitors.