Did you know that you only have 10-20 seconds to capture someone’s attention on your website? Yep, only 10-20 seconds. That’s a tall order, indeed. It’s even harder when your website takes 10 seconds to actually load and display your message. That’s just one of the many reasons that it’s important to optimize WordPress for speed.
Now, did you know that Google uses your website performance as a metric to rank your website in search results? Yep, they do that. That’s just another reason that you need to optimize your WordPress site.
OK, did you know… No, just kidding. I could go on and on about why performance optimization is important. Let’s just say this, it is critically important to the success of your website.
How To Optimize WordPress
There are quite a few ways you can optimize WordPress. You can optimize WordPress directly in the code or via plugins. We are going to focus on the plugin approach here as this article would get very long if we included all types of optimization that we could. Be sure to check back, we will publishing future articles discussing other types of optimizations.
Sometimes you can run into issues with certain plugins and methods depending on how your WordPress website is built. Just make sure to test, and then retest again. There are many tools you can use to test your website and make sure that the optimizations you are doing are beneficial and to show you what else you might need to look into. I would recommend utilizing Google PageSpeed Insights and GTmetrix.
Optimize Your Images
Images are large. They are often the biggest items on your website and because of this they can take a lot of resources to load for your viewers. Optimizing your images with image compression, combined with using appropriately sized images, can help mitigate this issue. You should also Lazy Load your images, which will only load images as the user scrolls, thus eliminating the need to load all images immediately when they load that page.
reSmush.it is a free image compression tool. I have tested many different automatic image compression plugins like this, and this one is the best one by a long shot if you are looking for something for free. There are certainly alternatives if you are willing to pay for them, such as Kraken.io, EWWW, ShortPixel, etc. However, what you get with reSmush.it for free is truly outstanding. It will automatically compress all of your images as soon as you upload them while keeping a copy of the original image if you need to access it or you need to recompress it again for some reason. You can also manually compress images yourself, and choose your own configuration to tell the plugin how to compress and handle the images.
Optimize Your Videos
If you utilize video on your website it is important to make sure that you are doing this properly. It is always beneficial to embed your video using a third party service such as YouTube. When you do this, you can also Lazy Load this video embed, similar to Lazy Loading images.
WP YouTube Lyte will Lazy Load any embedded YouTube videos within your content, similarly to how the Native LazyLoad plugin works on images. It does this by replacing the embed with a “lite” version of the video player into your content, but will load the full player when the video is clicked on. This way it reduces the overall load time for the page because the viewer only has to load a slimmed down version of the video player. That way if they don’t play the video, it’s fine, and if they do they still get the full experience and they won’t know the difference.
Caching, Minifying, and Compression
The concept of caching and minifying is relatively simple. Let’s start with caching. The idea of caching is to allow your viewer’s web browser to download portions of your website onto their computer and reuse those portions when they view other pages or return to your site in the future. This way they only have to reload the dynamic parts of your site, and all of the static elements only need to be loaded once. Whenever you make a change your site will tell your viewers browser to clear the cache and download a new copy.
As for minifying and compression, all websites are built out of code, and the web browser interprets that code and renders a visual representation. The more complex your site is the more code was likely used to. The idea of minifying and compressing in a nutshell is to remove any unnecessary pieces of code and combine the code into as few files as possible, while also compressing them using specific algorithms. This way the viewer’s browser can download the code and render the website as fast as possible.
Below are a few plugins that can be utilized to make both caching and minification happen.
Autoptimize is an amazing and powerful plugin. It provides both caching and minification all in one. It also provides font delivery optimization, image Lazy Loading, and much more. However, because it is so powerful it is a more advanced plugin to use. If you are a beginner, setting up this plugin so that it works across your website without causing issues might be tough. However, If you are a little more comfortable and you are looking for the most flexible and lightweight option, this is the plugin for you.
WP Fastest Cache is one of the most well known caching plugins for WordPress, and for good reason. It’s a good plugin. It includes multiple caching methods, minification, CDN support, CloudFlare support, and much more. It basically is an all-in-one solution. The main downside to this plugin is that some of the features are locked behind a premium version. So you may need to be willing to shell out some cash if you need the premium features.
This has to be controlled, as some certain scripts need to load before the content in order to work. So, again, test this out for yourself.
Asynchronous loading is sometimes built into caching plugins, such as WP Performance. However, your caching plugin of choice may not have this built in, or perhaps you want a bit more control by using a separate plugin.
Over time the WordPress database can get “clogged up” so to speak. It is a good idea to clean it up and optimize the WordPress database from time to time. Similar to the asynchronous loading plugins, this functionality is sometimes built into caching plugins or other optimization plugins. So you may not need to use a standalone plugin. However, that is not always the case.
You likely do not need a database optimization plugin running at all times. You can usually get away with running database optimizations manually from time to time, which means you can disable the plugin when you don’t need it. The more plugins you have, the more resources are required for your website.
It is also worth noting that you should always have a backup whenever you are making any changes to the database.
WP-Optimize works very well for database optimization. Just like a lot of other optimization plugins we’ve listed in this article, it does more then just that. It also includes compression and caching functionality. That being said, I have found other plugins to offer better functionality for caching and compression and tend to utilize this purely for the database management tools.
Go ahead and test these out
There are so many ways that you can combine different plugins to optimize WordPress, and we’d love to hear what has worked for you.
Keep in mind, you want to use as few plugins as you can to accomplish your goals. Don’t overload your website with different plugins that all do the same thing, that will end up being counterproductive when your goal is speed and performance.