When owning a WooCommerce store, you notice two things right away: firstly, WooCommerce is extremely smart with countless plugins and functionality options. Secondly, it is kind of slow. While the first thing can result in more conversions, that is sales, the second can cost you a lot in lost conversions.
Why is WooCommerce Slow?
Even though WooCommerce is the lightweight e-commerce option in comparison to Magento, it feels rather heavy, especially if your store is on shared hosting. The most common reasons for that are:
- Your hosting doesn’t meet the resource requirements of WooCommerce
- You use unoptimized images
- WooCommerce’s plugins slow down the site
- WooCommerce’s Ajax-calls slow down the site
As you can imagine, when looking at the list, a lot can be done to improve your store’s speed relatively easily. However, you have to be aware that optimizing WooCommerce to perfection is an illusion. The reason being simple: after optimizing your hosting and your images, you need to start sacrificing functions or design elements in order to speed up your store.
WooCommerce requires resources in order to function properly. Some of them are a must for all stores, while others are only required by certain extensions. A must for all stores are:
- PHP version 7 or greater
- MySQL version 5.6 or greater OR MariaDB version 10.0 or greater
- WordPress memory limit of 128 MB or greater
- HTTPS support
Required for some extensions are:
- CURL or fsockopen support, used by WooCommerce and by several of its integrations, e.g. for PayPal IPN
- Some of WooCommerce’s extensions require SOAP support
- Multibyte String support if you’re running a non-English store.
Remember though that these are basic requirements in order for WooCommerce to run, not conditions to perform optimally. If you want speed, you want to be looking for a hosting that features at least some of the following:
- SSD server. SSD stands for solid state drive and delivers up to 20x speed in comparison with a spinning drive. There are several major hosting companies, offering SSD-hosting, also for their shared plans.
- Managed hosting. As long as you don’t have a server specialist on your team, you want to stay on managed hosting, no matter whether it is shared, VPS or dedicated server. Managed hosting costs more than unmanaged but guarantees uptime, optimal performance for the resources you get, and support.
- Disc space. In order for your WooCommerce store to be quick, you want to have disc space, as cluttered disc equals slow site. If your site takes 1-2 GB, make sure you have at least 5-10 GB space.
- RAM. It is just like on your computer at home – the more RAM, the better. RAM is basically the ability of the server to handle requests. Most shared hosting’s enterprise plans start at 2 GB and this is also OK, as long as all other factors are in place and your site is optimized.
- PHP limitations. It is incredibly important that you are aware of the PHP limitations of your hosting plan and – even more importantly – that you can adjust them, when necessary. Quite a lot of hosting providers set the PHP limits quite low, mostly to prevent abuse but also to save resources. As a result, you might end up with a memory limit of 34 or 68 MB, which is not even enough for running WordPress. Besides the PHP memory limit, important are also the PHP input vars and the PHP max execution time. Either of these PHP limitations can cause your site to malfunction or processes to break. The input vars should be set at 1000 the lowest, while the PHP execution time should at the very least be set at 30. Setting them a bit higher up, for example at 2000 and 60 correspondingly ensures that processes will run smoothly. Do not set them much higher than that though! As mentioned in the beginning, there are reasons for setting these limitations reasonably low.
- HTTPS support. Just a quick note on this requirement. Most hosting providers today offer modern servers that support HTTPS without a problem. However, it isn’t a given that your chosen hosting is one of them. I have personally had to deal with a customer’s hosting with no HTTPS support. What I learned was that there isn’t anything to do but move the site on a server that does support HTTPS. Don’t be afraid to ask before purchasing hosting, as your setup depends on that.
- CDN. There are quite a few hosting providers today that offer a CDN as a part of their hosting plans, Siteground and A2 being two of them. CDN is becoming the standard for most websites, both international ones and local ones with heavy traffic. The reason is that the CDN takes some of the load off the origin server, making it work faster, even for site visitors nearby. If your hosting doesn’t offer CDN, you might want to find a CDN as a separate service. It will help a lot with optimizing WooCommerce for speed by caching all images and static resources.
You’ve heard it a lot: optimize your images, if you want your site to load fast. This applies to WooCommerce optimization as well. The first and most important principle here is to serve images that are resized to fit the space on your site. That is, if we take the WooCommerce product image spot that defaults at 600×600 px (might differ from theme to theme), you should upload product images that are in fact 600×600 px.
In addition, you should consider to implement either lossy or lossless compression (depending on the image) to achieve further reduction of image size. While page performance scores are almost impossible to satisfy, each bite counts in terms of page speed.
For best results, try combining manual image optimization with automated. To learn more about your options, read this post on image optimization. As images usually account for as much as 80% of the page size of online stores, optimizing them properly can do a lot to speed up your site.
WooCommerce is called a plugin but it is rather a universe of its own. It comes with a base module and countless extensions. A small store can maybe function with just the base module but most average stores would need at least 2-3 extensions and install another 5-6 that are nice to have but not strictly necessary.
Each of these extensions can account for up to a second delay in page load time depending on your hosting. Especially poisonous are special functionalities as compare or wish list.
Therefore, it might be very smart to assess your needs and cut drastically down on nice-to-have extensions. If you really want to keep them, you can try to minimize the impact on load times by using a CDN. Luckily, a big part of WooCommerce’s assets and extensions are cacheable, which means that it is possible to serve them over a CDN. This can reduce the time it takes to load these elements with up to 100 times.
As mentioned before, WooCommerce is quite advanced and offers a lot of features. Some of them are instant updates of cart items and keeping a sales dashboard in the backend. In addition, some themes offer extended functionality as ajax filters or pagination. Ajax filters and pagination make it basically possible to see filtered or paginated results, without refreshing the page.
Therefore, you might find advice on the internet to disable especially the cart fragments (responsible for instant cart updates but adding a lot of KB to every page of your site) in order to optimize WooCommerce. This is though something I hardly recommend, especially if you aren’t completely familiar with the way cart fragments work. The reason is that, as long as you do something wrong or skip an action in the process, you’ll end up with a store that doesn’t update customers’ carts or shows an outdated dropdown cart on pages other than the cart page.
If you want to give it a try anyway, WebNots give a great explanation of the process here. Just remember that, if you decide to disable cart fragments on pages other than the cart, you must start redirecting customers to the cart page every time they add an item to the basket. You must also disable the dropdown cart, which won’t get instantly updated either.
Optimize WooCommerce for Speed Without Sacrificing Too Much
As mentioned above, I am not a fan of the idea of disabling the Ajax calls in order to optimize WooCommerce. Likewise, I am absolutely not a fan of the idea of disabling the WordPress heartbeat API, as the WebNots’ post suggests. Simply because the price is too high and you might experience that these optimizations do more damage than good. A simple example here would be having to work without WordPress’ autosave or revisions function. Scary, right?
Instead, optimize WooCommerce with measure. Beneath, you can find my simple guide to a fast WooCommerce store:
- Use proper hosting with a server center close to your customers. Just as all other server specifications, proximity is crucial for fast page loading.
- Optimize your images. You can reduce the size of your pages with 30 % on average by optimizing all images.
- Use a CDN. Yes, it is an extra expense, as long as you can’t get it as a part of your hosting and it might seem unnecessary, as long as your server isn’t far away from your customers but it is completely worth it. Just the fact that a part of the resources is loaded not from the origin server means that you can achieve much better page performance even with cheap hosting.
- Remove nice-to-have WooCommerce plugins. For example, keep down the number of payment options or functionality extras as comparison or Wish list. In some countries it might make sense to use them but are you for example selling in Europe, you’ll find out that nobody is using them anyway.