Speed up your slow WooCommerce store

last updated 8 months ago

A slow WooCommerce store can not only affect the user experience, but also lower conversion rates and reduce sales.

In this comprehensive guide, we'll show you effective steps you can take to speed up your WooCommerce store and unlock its full potential.

1. Use cloud hosting with Cloudflare

Why cloud hosting/VPS?

Traditional shared hosting (such as SiteGround, Hostinger, or WPX) is often not designed to meet the needs of WooCommerce websites, which make more dynamic requests and therefore have less cache capacity. Such hosting providers often have limited resources, such as CPU and RAM and rely on slower SATA SSDs with Memcached, which is inferior to modern alternatives such as Redis.

The advantages of Cloudflare

Cloudflare has a large network of over 270 PoPs (Points of Presence) and offers features like Argo Smart Routing and Tiered Cache, specifically designed for dynamic content like WooCommerce. Cloudflare Enterprise also enables:

  • Full Page Caching: Reduces dynamic requests and improves Time to First Byte (TTFB).
  • Brotli compression and HTTP/3: Improves transfer speed.
  • Web Application Firewall (WAF): Protects against malicious bots and DDoS attacks.

How to set up Cloudflare Cloudflare correctly


2. Use Object Cache

An object cache should be used for WooCommerce stores because it significantly increases the performance and efficiency of the website.

WooCommerce generates a multitude of database queries when processing orders, retrieving product information, and managing user accounts. This is where an object cache can help:

How Object Cache works

An object cache stores the results of these frequent database queries in memory, significantly reducing page load times. This not only results in a better user experience but can also increase conversion rates by moving customers through the purchase process more quickly.

Additionally, an object cache offloads the database, leading to improved scalability, especially during peak periods such as sales or holidays. Furthermore, it reduces server overhead and operating costs because fewer resources are required to process requests.

Overall, the use of an object cache is a useful measure to optimize the performance of WooCommerce stores and ensure a smooth shopping experience.

Redis Logo

Why Redis?

Redis is an in-memory data store that offers greater speed and efficiency than Memcached, especially when processing dynamic requests in WooCommerce. This reduces CPU load and speeds up the website.

How to install Redis

Redis installation varies depending on the hosting provider. With Rocket.net and Cloudways, you can enable Redis through your hosting account and install the Redis Object Cache plugin in WordPress. With other providers, like Kinsta, Redis may incur an additional fee (approximately $100 per month), so it's recommended to choose a provider that integrates Redis by default.


3. Enable Full Page Caching

What is full page caching?

Full Page Caching caches your page's HTML content, reducing the number of dynamic requests. This is especially important for WooCommerce stores, which contain a lot of dynamic content such as product pages and shopping cart updates.

How do you enable full page caching?

If your hosting provider doesn't support this, you can use Cloudflare's Automatic Platform Optimization (APO), Super Page Cache for Cloudflare, or FlyingProxy. FlyingProxy also offers some Cloudflare Enterprise features, such as Argo Smart Routing and image optimization.

If that doesn't work, you have the option of enabling full page caching in Cloudflare using Page Rules. This feature allows you to efficiently store and deliver static website content, significantly improving loading times.

Configuring Page Rules allows you to specify specific URLs or paths to cache, which is especially useful for optimizing performance during high traffic. Be sure to choose your cache settings carefully to ensure dynamic content continues to display correctly while taking full advantage of caching.

Which WooCommerce pages should not be cached

When caching WooCommerce pages, it's important to exclude certain pages to ensure the user experience remains optimal and to avoid functionality issues. Here are some ideas for which WooCommerce pages to exclude from caching:

  1. Shopping cart page Since the shopping cart contains dynamic content, such as the products added and their quantities, this page should not be cached to ensure that users always see the most up-to-date information.
  2. Checkout page Similar to the shopping cart, the checkout page contains personal information and payment details. Caching could cause problems, especially if multiple users access the page simultaneously.
  3. My Account Page This page contains personal information about the user and is dynamic. Caching may allow users to view other users' account information.
  4. Product pages with variable products If you are dealing with variable products where customers can choose between different options (size, color, etc.), this page should not be cached because the choices are dynamic.
  5. Search results pages The results of a product search can change depending on the user and search queries, so it is a good idea not to cache these pages.

4. Activate Argo Smart Routing

Cloudflare's Argo Smart Routing optimizes the routes data travels through the network, reducing latency. This results in faster loading times for dynamic content. You can enable Argo Smart Routing directly in your Cloudflare account (for a fee).


5. Set the cache TTL to one month

A long cache TTL (time to live) is ideal for minimizing the number of requests to the server. However, since WooCommerce websites are updated frequently, the TTL should be set to approximately one month.

This will clear the cache regularly, but not too frequently. This improves speed without placing unnecessary strain on the server. In Cloudflare, you can simply set the browser cache TTL to "1 month."


6. Increase the memory limit

WooCommerce typically requires more memory. Increasing the memory limit to at least 256 MB (or even better, 1024 MB) is therefore important. To increase the memory limit, add the following code to your wp-config.php-file:

Copy php codedefine('WP_MEMORY_LIMIT', '1024M');

Some hosting providers like IONOS allow you to change the memory limit directly from their dashboard.


7. Remove WooCommerce Bloat

Why remove WooCommerce bloat?

WooCommerce loads a lot of resources that aren't needed on every page, such as scripts, stylesheets, and cart fragments. This unnecessarily increases page load time.

Solution: Disable WooCommerce Bloat

The "Disable WooCommerce Bloat" plugin lets you disable unnecessary resources. It removes scripts and styles from non-shop pages and can also clean up the admin area. An alternative is Perfmatters, which offers similar features.


8. Empty (regular) customer sessions and expired transients

In the WooCommerce status settings, you can delete customer sessions and expired transients. Transients are temporary data stored in the database. If they become too numerous, they slow down the website. Deleting this data reduces the load on the wp-options table in the database.


9. Optimize your product images

Product images are often an essential part of WooCommerce stores. Here are some image optimization tips:

  • Adjust image sizes: Oversized images can significantly impact loading times. Scale images to the required dimensions.
  • Image compression: Use plugins like ShortPixel or a CDN service to compress images losslessly.
  • WebP format: Convert images to WebP format to reduce file size.
  • Lazy Load: Load images only when scrolling to reduce initial loading time.
  • Preload for “above the fold” images: Preload images that are in the visible area to improve perceived loading time.

10. Reduce the number of WooCommerce plugins

Extensions and plugins based on WooCommerce offer numerous functionalities, but can also significantly impact a website's speed, especially if they are poorly optimized or unnecessary. A thorough review of installed extensions is therefore essential to optimize website performance. By disabling or removing unnecessary plugins, you reduce server load and improve loading times, which not only enhances the user experience but can also have a positive impact on search engine rankings. A tidy and well-optimized WooCommerce installation leads to more efficient use of resources and ensures your customers enjoy a smooth shopping experience.


11. Use a lightweight WooCommerce theme

WooCommerce Store Image

Heavyweight themes and page builders like Elementor or Divi add additional code that slows down your website. Instead, opt for lightweight WooCommerce themes like:

  • GeneratePress: Minimalist design and high adaptability.
  • Blocksy: Modern and responsive theme.
  • Astra: Known for its speed and compatibility with WooCommerce.

12. Unload unused assets

Many plugins load scripts and styles on all pages of your website, even if they are not needed there. With plugins like Performance Matters or Asset CleanUp you can deactivate these resources specifically on certain pages and thus reduce loading times.


13. Use hardcoding where possible

Headers, footers, and sidebars shouldn't be created with page builders, as they add additional code that loads on every page. Instead, you should hardcode these areas or include them in your theme to reduce code overhead.


14. Configure a better caching plugin

Recommended caching plugins:

  • FlyingPress: One of the most powerful caching plugins with many optimization options.
  • LiteSpeed Cache: Ideal if your hosting provider supports LiteSpeed servers.
  • WP Rocket: Known for its ease of use and comprehensive optimization features.

Configure the caching plugin to minify CSS and JavaScript files, lazy load images, and periodically clear the cache.


15. Avoid resource-hungry plugins

Some plugins can cause high CPU loads. Here's a list of plugins that can be particularly resource-intensive:

  • Security plugins: e.g. Wordfence.
  • Statistics plugins: e.g. B. Jetpack, Site Kit from Google.
  • Gallery plugins: e.g. NextGEN Gallery.

Use tools like Query Monitorto see which plugins are using the most resources, and disable them if necessary or find alternatives. WP Hive is also a useful tool for analyzing the resource consumption of plugins in the WordPress repository. Using the "WP Hive Insights" feature, you can see how plugins affect your website's memory usage and page speed scores.


16. Clean your database

A clean database is crucial for the performance of your WooCommerce store. Use a plugin like WP Optimize to regularly clean your database of unnecessary data. Many caching plugins, like WP Rocket, also offer database cleanup. Keep the following in mind:

  • Revisions: Delete old post revisions that bloat your database.
  • Spam comments: Remove spam and trash comments.
  • Expired transients: Clean up expired and no longer needed transients.
  • Orphaned database tables: Older plugins often leave tables in the database that are no longer needed. With WP Optimize, you can mark these tables and remove them.

17. Block malicious bots

Malicious bots can overload your store's server resources by making unnecessary requests. Blocking these bots saves resources and improves your website's performance. Here's how:

  • Cloudflare's Bot Fight Mode: Enable this mode in your Cloudflare dashboard to block most malicious bots.
  • Blackhole For Bad Bots: A WordPress plugin that traps and blocks bots.
  • Wordfence Live Traffic Report: Use Wordfence to monitor which bots are accessing your website in real time. Disable the plugin after analyzing to minimize resource consumption.

After identifying malicious bots, make sure you block them through your server settings or in Cloudflare.


18. Disable (or limit) Heartbeat

The WordPress Heartbeat API enables features such as saving drafts in real time and displaying notifications. However, by default, the API generates a request every 15–60 seconds, which can increase server load.

Solutions:

  • Manual deactivation: Add the following code to the functions.php-file of your theme to disable the Heartbeat API:Copy phpCodeadd_action( 'init', 'stop_heartbeat', 1 ); function stop_heartbeat() { wp_deregister_script('heartbeat'); }
  • Caching plugins: Many caching plugins like WP Rocket or Perfmatters offer settings for disabling or reducing the heartbeat frequency. This works perfectly in Litespeed, too.

19. Optimize all fonts

Fonts can generate a large number of HTTP requests, thus increasing loading times. Here are some tips to optimize font use on your WooCommerce site:

  • Reduce font families: Use as few fonts and weights as possible to minimize the number of requests.
  • Host fonts locally: Use plugins like Perfmatters or OMGF to host fonts locally instead of loading them from external sources like Google Fonts.
  • font-display: swap use: Use the attribute font-display: swapto ensure that the text remains visible while the font is loading.
  • Preload important fonts: Preload fonts that are located above the fold. To do this, add the following code to the -area of your header.php-File:htmlCopy code

By taking these measures, you will improve the perceived and actual loading speed of your website.


20. Upgrade to PHP 8

PHP is the server-side scripting language on which WordPress and WooCommerce are based. With each new PHP version, there are significant performance improvements. WooCommerce websites should always use the latest PHP version, as higher versions like PHP 8 are significantly faster.

To check the PHP version and upgrade:

  • Check PHP version: Go to your hosting dashboard and check the current PHP version. Alternatively, you can install the "Display PHP Version" plugin in WordPress.
  • Upgrade: Most hosting dashboards have an option to update your PHP version. Select PHP 8 or higher.
  • Compatibility: Before upgrading, you should check the compatibility of your theme and plugins with the new PHP version. Most modern themes and plugins are already prepared for the new PHP versions.

Summary / Conclusion

The speed of your WooCommerce store depends largely on your store's infrastructure and configuration. In addition to choosing the right hosting provider (ideally cloud hosting with Cloudflare Enterprise), image optimization, properly configuring caching plugins, reducing resource-hungry plugins, and database cleanup all play a crucial role.

Most issues with slow WooCommerce stores are due to insufficient hosting resources, poor configuration, or too many plugins. By following the steps above, you can significantly improve your store's performance and increase both the user experience and your conversion rates.

Content

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    lk media – your partner for online marketing & web design.

    Your success online is what drives us.
    lkmedia white
    Agency for future-oriented online marketing and web design. We are a team of creative minds and strategic thinkers who are passionately committed to your success in the digital space. Our goal is to present your brand optimally, reach your target group and generate sustainable growth.
    © Copyright 2024 lkmedia
    Sitemap Data protection imprint
    en_USEnglish