In this article, we'll see how critical your website's load time is and how it hampers your website's performance. We'll enumerate the factors that slow down the load time and concentrate on the meat of the article, that is, WordPress performance optimization. We'll hopefully be able to load our website at lightning speed at the end of this article! |
---|
Why is Optimizing Your WordPress Site Important?
Optimizing your WordPress site means to load your website at the optimal time, keeping it as minimum as possible. The ideal load time is three seconds or anything lesser than three. Why do you think it's important, though? We expect to attract traffic when we create content online. Our best bet to get users to view our content is to make it to the Google search engine's first page. Google ranks web pages based on tons of factors. One such factor is your website load time that Google considers. Another study backed up by Google reveals that the probability of bounce increases by 32% as page load time goes from one second to three seconds.
What factors Slow Down the Load Time of Your Site?
There are plenty of factors to watch out for that would eat up the load time. Like,
- Poor hosting plan or a badly managed server
- Bulky pages, homepage, images or media and Hotlinking of media
- Unoptimized and outdated core, theme, plugins or database
- Unnecessary use of plugins and badly coded plugins
- Longer posts and multiple post revisions
- Persistent server and plugin cache
- Traffic volume on your website
- Use of external scripts
- Pingbacks, comments, and redirects to your server
10 WordPress Performance Optimization Strategies
We saw what factors in our website could slow down your page load. Let’s now see ways to reduce the load time by certain optimizations and good practices. I assure you that it doesn't require you to be a rigorous coder or programmer to fine-tune your website. Nor does it involve server configurations or shelling out money for plugins! It's straightforward if you carefully follow the below-mentioned points.
Before we plunge in
I recommend you take a speed test of your website before we begin to optimize it. In this way, we’ll know the difference quantitatively as well. Some excellent tools to test your website speed are, GTmetrix, Pingdom, and PageSpeed Insights by Google. Another thing to note here is to choose one tool and stick to it for better results and reflections. Let’s go ahead with the optimization now.
1. Choosing a Good WordPress Hosting Plan.
One of the most important aspects of your website's overall performance is choosing the right hosting plan. The host's server is the place in the data center where your website's data resides. There are two ways of going ahead with this. There are shared hosting plans and managed WordPress hosting.
Shared hosting: In the case of a shared hosting plan, your server's resources are shared with many other websites. The most significant advantage of this approach is that it cuts down the price you will have to pay for the hosting company by nearly 70%. Other added perks are; you're allowed to host multiple websites, and unlimited visitors are permitted.
Nevertheless, since the resources are shared, this might significantly slow down your website. Other disadvantages would be; you'll have to deal with c-panel (control panel) of the server for configuration, which is a bit complex if you're not from WordPress/technology background. Shared hosting lacks other value-added features like WordPress specific performance optimizations, automatic updates, and backups.
Managed WordPress Hosting: In managed WordPress hosting, there's a set of exclusive services given to you. Which includes in-built WordPress optimization configuration to help decrease load time, tools to install, and manage WordPress, automatic updates and backups, and website security features. However, such curated services come at a premium price. So, the major downside of a managed hosting would be high pricing. And other disadvantages are, they impose a strict upper cap on the number of visitors to the site and the number of websites.
Now that we know the major differentiator between a shared and managed hosting is the pricing, we have a few suggestions for you. If you're a beginner or your website ranges from small to medium, shared hosting is your best bet. Some of the best known shared hosting plans can be found at Bluehost and SiteGround. If your website handles massive traffic or is a business website or if it's an eCommerce one, managed hosting will give you the best results: Kinsta and WPengine and few best providers.
2. Theme of Your WordPress Site Counts Too.
Themes have a lot to do with the entire look and feel of your and website and user experience, of course. The digital theme market is so attractive that we often tend towards getting the one that is very starry looking. Agreed that theme is got to grab attention, but not at the cost of the performance. Your websites cannot afford a bulky, or poorly coded or ill-maintained theme. Hence, thorough research and performance analysis should be done before finalizing your website theme. Another aspect that puts some light in this area is whether it's a free or premium theme. Free themes can sometimes turn out to be a costly affair for your website's performance. Premium ones, on the other hand, are less prone to flaws. We recommend the following multipurpose light themes with easy load times; Astra, Divi, and the theme forest, which has a vast collection of WordPress themes.
3. The Media in your WordPress Site
Bulky media could drastically affect the performance of your website. It slows down the load time of your website hence bringing down the rank. It's paramount to compress and optimize your images before uploading them to your website. Images generally are of either .PNG or .JPG format. A .PNG file is an uncompressed image of higher quality and large size. Whereas a .JPG file is a compressed image of little lesser quality and an astonishingly smaller size. You won't know the difference until you see their properties! And you will realize that theirs a massive difference in their size, which will predominantly affect the load time.
So, if you're website is using images, make sure to optimize them. You could use .JPG in almost all scenarios but, if you're using a rather transparent image suppose, a cover image then a .PNG is recommended. You could do all the optimization manually, but if you're looking for a plugin, WPSmush and Imagify are some of the best plugins for image compression.
That was about images on your website. Another aspect concerning media on your website is embedding videos on your website. So, if your website is a video-centric one, consider a third-party video hosting. Because otherwise, it will significantly hamper the performance of your website. Some of the popular video platforms are YouTube and Vimeo.
When the files on your website are directly linked to another site, it is called as Hotlinking. The data is usually images and videos. Now, when users access the other website, they are using the bandwidth of your server—resulting in an increase in load time, of course, thereby reducing the website's performance. To prevent this, you should avoid Hotlinking, by editing your .htaccess file with the below code.
#Switch on rewrite engine
RewriteEngine on
#Allow empty referrals, in case visitors are using personal firewalls
RewriteCond %{HTTP_REFERER} !^$
#Match request URL. Replace www.yourwebsite.com with your website URL
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?www.yourwebsite.com [NC]
#Match all files with the below list of extensions
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
4. What is Caching? And Why is it Important
Caching is a process of keeping a copy of a previously visited page on a website. If you refer to our previous article (Please insert the link to "WordPress Website Basics" article), we have explained the architecture of WordPress CMS. You will see that the pages are served dynamically, which means that every time a page is requested, it is processed, the queries are executed, and the server renders those pages to the user. We know that a database transaction is costly, which, when called every time, would bring down the website's performance. The server stores a copy of it to render data when requested, called caching, which will dramatically lower the load time and improve the website's performance.
Now that we know what caching is and its importance, how do we achieve it? If you have a managed WordPress host, it is usually handled by your hosting provider. In some cases, you'll have to do it manually by a click of a button. And in other instances, you'll have to verify to keep it enabled. It differs from one hosting provider to another. If your hosting provider doesn't handle caching at all, then there are many plugins that will help your website in this regard. However, we recommend WP Rocket.
5. Why Use CDN?
CDN stands for Content Delivery Network. CDN is a network of servers that store a static copy of your website in all their servers and serve the static pages on request, based on the proximity. Now, don't confuse yourselves with the hosting provider server; both are completely different services. At your hosting provider server, all the processing happens, and pages are generated dynamically, as we saw in the previous section. But in a CDN, a static copy of unchanging files like CSS, images, and JS are stored. For instance, if your physical server resides in India, your server renders results faster to a user in India than in the USA because the Indian user is closer to the server. Now, we set up a CDN for our website, and our content is distributed over the network of servers. The USA's user is now served from a server closest to his geolocation, hence improving the performance.
The advantages of using a CDN would be:
- There is a decrease in load time since static pages do not have any processing to carry out, making it an excellent experience for the user.
- Use of a CDN cuts-down load of your hosting server, too, since it doesn't have to render CSS, JS, and other files, thereby improving the website's performance.
- Google has cited that the use of CDN would tend to rank your website higher in search results.
We recommend using StackPath CDN as it gels well with your WordPress website.
6. Optimize your WordPress Database
Since WordPress websites pages are generated dynamically, a lot of users are concurrently querying the database. Hence, it's essential to keep the database clean. After using WordPress for a significant period, a lot of data gets redundant. It could be unused tags, revised posts, etc. I'd recommend WP-Optimize plugin, an all-rounder, which can compress your files, clear cache, and maintain the database.
7. Choose your plugins wisely.
Plugins are third-party extensions that extend the functionality of your WordPress site. WordPress has a massive collection of over 56k+ of third-party plugins, and 'WordPress plugin development' is a small market in itself. So, we can't assure the authenticity of every plugin out there. We indeed ought to keep the number of plugins to a minimum. But 9-10 better performing plugins are always preferred over 4-5 poorly coded plugins. One way of testing them would be to run speed tests before and after installation. We should always try to keep plugin count to a minimum. For most of the purposes, we have recommended plugins in the previous sections. Other than those, the following might be helpful.
- Yoast SEO plugin for SEO related optimizations is an excellent plugin.
- Akismet, an anti-spam plugin, protects your website from spam.
- Really Simple SSL, to make your site SSL proof.
- UpdraftPlus, to back-up and restore either locally or to cloud.
- WPForms, useful contact form plugin.
Sometimes we install plugins for a specific need, and we no longer need it. When you uninstall a plugin, often plugins leave behind files. They may be settings files, logs files, database files, etc. They will eventually build up and eat up your load time. Hence, it's essential to clean up the plugin bloat periodically. I recommend you to do this manually.
8. Keep everything updated
- WordPress rolls out updates frequently, which would cover security vulnerabilities, bugs, and other things. Failing of which, your site might experience latency and security issues. Other than the WordPress site, your theme and plugins must be updated too.
- WordPress uses PHP as a server-side language, which is an open-source language. PHP also has updates, and you should make sure that your hosting provider has updated your website to the latest PHP version.
- HTTP2 is the latest HTTP version and is designed for performance optimization. Hence your site, hosting server, and plugins must be compliant and updated.
9. All optimizations about pages
- We had seen in the CDN section that HTML, JS, and CSS files do not change frequently. You can opt to minify these files for performance optimization. Minification of files includes removing comments, whitespaces, and other unnecessary characters.
- The home page is the main/landing page of your website. And it's important not to load too much information and instead use excerpts. WordPress gives you an option to show full text or summary of the articles on the homepage, displaying excerpts is a better choice; this will also increase your page visits.
- You should limit your post revisions to a minimum. Every time you revise your post, it will create many junk files. It is always a good practice to keep them to a minimum. You can also set a limit in your WordPress settings.
- We have a default page displayed whenever our server is down, that is the 404-error page. Now, usually, this page is bulkier than needed. You can instead load your own lighter custom 404 error page, which also prevents querying the database and hence improving the website's performance.
- I'm sure some blogs/websites have active and interactive traffic volumes, and some don't. If the comment section is not required or if it's not busy, you might want to disable it. If the comments section is active, breaking them into pages would help the performance better.
10. Other small tweaks
Let’s quickly go through some small tweaks to boost the performance of your website further!
- The WordPress theme you're using often loads fonts that are never used in your website, be sure to disable them because they eat up time to load.
- Turn off pingbacks and trackbacks in your WordPress, since it doesn't much add up to anything but slower load time.
- WordPress loads the emojis module by default. You should consider disabling it if it's of no use to you.
- Keep in mind to empty the trash after deleting anything.
- If your website uses a lot of images and videos, you can consider lazy loading your content.
- You can use an elastic-search engine, an open-source search tool to embed the search bar on your website.
- You can also opt for site monitoring systems. They ensure the constant availability of your website and whether working as expected or not.
- Mobile-first approach: Google rolled put mobile indexing for all websites starting from 2019. Before which only desktop versions were used for indexing and ranking. Now with a significant increase in mobile usage, Google considers mobile versions too. Therefore, it's essential to optimize your website for mobile versions as well.
That was our list of WordPress performance optimization strategies. We saw how we could optimize our website with simple steps in the interface. After following the optimization steps, you can retake the speed test, and you'll see the difference in performance. We should not get too touchy with the score, though. Anything overly done would result in a mess. Our aim should be to provide excellent user experience by improving the optimization and not compromising the content by over-optimizing. We hope this article sheds some light on WordPress performance optimization techniques.