At some point we all face the speed issue, whether it’s a problem with our web host, website’s coding or something else, in this article we are trying to explain why your website may be running slow and how can you make a WordPress website load faster.
Why your WordPress site is loading slow?
Un-minified HTML codes.
In most cases, developers keep HTML codes in a proper structure so that anyone can modify or customise the theme later without having any issues or calling the previous developer. Formatting HTML in proper manner introduces many lines of spaces in the code. Hence, the browser is forced to compile those blank spaces along with the other necessary HTML tags. Hence, putting un-minified HTML codes makes your website slower because the browser takes much extra time to compile the HTML.
Un-minified CSS files.
Same as the HTML codes, CSS works in a similar manner. Hence putting each class and CSS properties in a single line makes the file unnecessarily heavy. So minifying the CSS helps the browser load the website faster.
Bigger or Huge images.
This is one of the big issues I have seen amongst my clients. Sometimes we upload several 3000 pixels wide image to a blog post where are the same picture is displayed at a smaller resolution. Hence, uploading an image straight out of the camera, without resizing makes the page’s size huge in megabytes. So, the solution is to use optimised images or automated image optimizer plugins inside your WordPress installation so that the images can load faster.
Multiple database queries.
This happens due to bad coding. In some cases, we have many queries on the home page or landing pages where we pull and display multiple post items together. I have noticed in some cases the developer just forgot the close the custom query. Hence, the database connection keeps open to the server and at the end of the day it slows down the site.
So, How to make your WordPress site load faster?
Well, to do that definitely we are going to use some plugins and tools, which will make the process less complex and faster. First, I am going to list you the plugins that we are going to need to make the website faster. Alternatively, you can visit XXX to install our recommended plugins on your WordPress installation.
1. How to configure W3 Total Cache Properly?
W3 Total Cache works in a different manner. It’s not like the other plugins where we activate the plugins and it starts working right from that moment, instead, W3TC needs to be configured manually to work properly. Sometimes, activating the wrong items or misconfiguration can mess up your website. If that’s what happened in your case, keep reading this article, I will explain how to recover your site from that situation as well.
Once you have activated the plugin, navigate to Performance -> General Settings. You will find many settings over there, we are going to enable the caching mechanisms one by one. Alternatively, you can enable these at once as well.
- Page Cache
- Database Cache
- Object Cache
- Browser Cache
Here are the settings that you need to update in each of the menu options except Page Cache, Database Cache, Object Cache. For those three items, leave the options as it is, we don’t need to modify those. We are going to tweak the Minify and Browser Cache settings.
Caution:: For many WordPress themes especially when your theme is heavily customised, enabling the minify option will break your website. For example, the jQuery animations may not appear, sliders may not work or even the stylesheet may not work. If you face any such of issues, try disabling the minify option.
- For HTML & XML, tick the Line Break Removal along with Enable option.
- For CSS, just enable this feature. If you have @import codes inside your CSS files, our recommendation is to remove that manually and paste the imported CSS in the file.
Once you do these configurations, purge all the caches from the Performance menu on the top menubar and check your website’s speed using GTMetrix or Google PageSpeed. It should be running a lot faster.
JetPack comes with a very handy feature called Photon. Which is a free CDN (Content Delivery Network) for your images. It will upload all the images to a very fast cloud server and serve images of your posts and pages from their server. Which not only makes the images load very fast, it also optimises the image’s delivery based on the user’s internet connection speed.
3. WP Smush
As you have seen WP Smush already made to our 8 Must Use WordPress Plugins for Your Blog and Website blog post because of it’s optimization skills. Hence, we don’t want you to miss this plugin. WP Smush is a free plugin which compresses the images you upload to your blog posts or pages via WordPress media uploader.
Pretty much that’s it, beyond all these optimizations definitely you are going to need a good and reliable web host for your website. If the server is running slow then you need to contact your host.
Please let us know if you face any issues with these in the comments. We will be happy to help!