How to Speed Up a Slow WooCommerce Backend

Is the backend of your WooCommerce site slow? We all know it’s crucial that stores are speedy on the front-end to provide a great user experience for shoppers. But you might not know that it’s just as important your store’s backend is fast, too.

Your WordPress dashboard’s speed and efficiency impact your productivity, your ability to manage the day-to-day running of your store, and how you’re able to respond to any unexpected issues affecting your site.

Generally, there are three possible causes of WooCommerce backend slowness:

  1. Non-performant PHP code,
  2. Non-performant database queries, and
  3. Slow-loading of files.

So how do you diagnose and fix these issues? I polled the Prospress team—the folks behind WooCommerce Subscriptions (the world’s most popular WooCommerce extension), Robot Ninja, and AutomateWoo—and we came up with the following tips, tools, and advice to help you identify each of the three issues above and implement fixes to get your WooCommerce backend running smoothly again.

Getting Started: General Tips for Speeding Up the WooCommerce Backend

Before we dive in, let’s recap some general performance tips. You’ve no doubt heard the following a thousand times before, but each is important to have in place before moving onto the more involved fixes that are the focus of this article.

1. Disable/Delete Unused Plugins/Settings

It’s best practice to only keep the plugins you need and delete the rest. This is generally recommended from a WordPress security and maintenance standpoint.

It’s worth noting that sometimes people expect simply deleting a bunch of their plugins will be a silver bullet, but this isn’t always the case. While the number of plugins you have installed on your site may well be a factor in slowing things down, it’s more likely that there could be an issue with the quality of your plugins (which we’ll explore in more detail below).

2. Keep WordPress Core, Plugins and Themes Updated

Performance is always a key factor for WordPress developers, whether it’s the core team working on the latest version of WooCommerce, or plugin and theme developers improving their products.

So one way you can help improve and maintain the performance of your site is simply by keeping pace with core, plugin, and theme updates as they are released.

It’s important to test new versions of WordPress, WooCommerce and any plugins and themes you’re using before you hit update. This means setting up a staging site, doing your research, and running thorough tests before updating your production site.

For more on how to test and update your WooCommerce site, check out our guide Updating WooCommerce: A Safe and In-Depth Guide.

3. Choose/Switch to a Good Web Host

Not all hosts are created equal. Spending time investigating your options will go a long way when it comes to the performance of the front-end and backend of your site.

Google is your friend here. Read the reviews, ask lots of questions, and sign up with the host that checks all your boxes. While shared hosting is great for smaller sites and those new to WooCommerce, it’s worth looking into VPS and managed WordPress hosting solutions that can guarantee dedicated resources for your site.

Preferably, choose a host that supports PHP 7+ and, if possible, also provides some integrated caching functionality.

4. Use Object Caching

There are a lot of mixed and seemingly backward opinions about object caching. But let’s try and set the record straight: when done correctly, object caching is a valid and proven way to speed up your WooCommerce backend.

There are many good hosts out there that offer object caching out-of-the-box, and sometimes all you need to do is ask your host to enable it.

Alternatively, if you manage your own hosting, plugins like WP Redis with a Redis data store can complement front-end page caching whilst speeding up your WooCommerce dashboard.

5. Disable WordPress and WooCommerce Dashboard Functionality You Don’t Need

Customizing what’s displayed in your dashboard might seem redundant, but for some sites, these simple changes can make a big difference to a sluggish WooCommerce backend:

  • Removing the order count from the admin menu;
  • Disabling any dashboard widgets you don’t need or use anymore for both WooCommerce and WordPress core;
  • Hiding the tag, featured, and type admin columns from the WooCommerce product list; and
  • Disabling background image regeneration.

Plugins like WP Widget Disable can help clean up your dashboard widgets. For advanced users, Liquid Web’s Luke Cavanagh has created an excellent plugin that provides performance tweaks for the front-end and backend of WooCommerce, which you can download from his repo at GitHub.

Luke’s plugin is a gold mine of settings you can disable to speed up the WooCommerce dashboard. It’s worth pointing out that it’s not very configurable, so if you’re not a developer I’d recommend proceeding with caution. The mileage you get with this plugin, as far as performance gains go, will vary from site to site.

Speeding Up the WooCommerce Backend

Now that you’ve ruled out all those general performance issues as the cause of your WooCommerce slowness, you can probably pin your sluggish WooCommerce backend on one of three possible causes: non-performant PHP code, non-performant database queries, or slow-loading files, or even a combination of all three.

Cause #1. Non-Performant PHP Code

1. Update to the Latest Version of PHP

If your site is running on an older version of PHP, especially anything below PHP 7, updating to the latest version, 7.2, will give you immediate performance gains.

PHP 7 is up to six times faster than any previous version of PHP and requires fewer servers to deliver your WordPress site to the same number of visitors. In fact, benchmark testing shows that PHP 5.6 executes one WordPress request in just under 100M CPU instructions, while PHP 7 only executes 25M to do the same job.

Still, according to WordPress.org statistics, most WordPress sites are using PHP 5.6.

PHP versions on WordPress sites

Why? Basically, because web hosts don’t want to break their customers’ sites. This means that if you want your site running on the latest version of PHP, you’ll need to take the initiative and do it yourself, or ask your hosting provider for help.
To check what version of PHP your site is running, the Display PHP Version plugin can add this information to the “At a Glance” widget in the WordPress dashboard.

Display PHP Version Plugin

While we’re on the topic of updating PHP, it’s also a good idea to enable OPcache. OPcache is a PHP extension that improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.

When enabled, OPCache can decrease response times by up to 50%, according to Sitepoint.
The extension is built-in to PHP 5.5+ and replaces APC, and is an alternative to XCache as a PHP accelerator.
WP Rocket supports OPCache and includes the option to purge it.

2. Only Use Popular, Well-Supported Plugins

No one goes out of their way to use—or if you’re a developer, write—sub-optimal code. But sometimes, things slip through the cracks, or some weird combination of theme/plugin/hosting leads to performance bottlenecks. It happens.

For the most part, the Prospress team agreed that sticking to popular, well-supported plugins was a good option. However, some popular plugins are notorious for their impacts on site performance.

In these situations, when things get slow, the usual method of identifying a troublesome plugin is to deactivate your plugins one-by-one until the issues you’re experiencing stop. But with the right debugging tools, you can quickly pinpoint issues with more accuracy.

If you’re a PHP developer, you might be familiar with profiling tools (usually on a local test site) like those included with XDebug to record and analyze PHP usage and identify performance issues.

Otherwise, there are some fantastic debugging plugins available, which can help identify any issues with your plugins. These include Query Monitor and Debug Bar (and its various add-ons, like Debug Bar Slow Actions).

Both plugins are not strictly for assessing PHP performance, but they will give you a good indication if your plugins are coded to use sub-optimal queries (we’ll discuss this in the next section).

The next option, if you have it available, is to use a powerful developer app performance service called New Relic. This fantastic tool (which I’ll explain in more detail below) can help you really drill down into the inner workings of a WordPress site and pinpoint errors with plugins, theme files, database queries, external calls, or code that are causing performance bottlenecks.

For example, you can get a quick list of the most time-consuming plugins and themes on your site:

Plugins on New Relic Dashboard

Cause #2. Non-Performant Database Queries

1. Display a Sensible Number of Posts in the Admin

Your admin pages could be loading slowly simply because you’re loading too much on the screen at once, including posts and other object types like orders or products.

WordPress defaults to displaying 20 items at a time. But we’ve seen some people display multiple hundreds of items at once.
In an ideal world, sites would be able to handle displaying an infinite number of items, but that just isn’t the case. So it’s best to keep the number of items displayed in your dashboard to a sensible number.

Check the Screen Options tab at the top of your Orders, Coupons, Subscriptions and Products admin pages (basically any of the admin pages that display lists of things) and make sure the “Number of items per page” option is set to an appropriate number for your site and hosting.

screen options WordPress dashboard

2. Clean Up Your Database

WordPress databases often become bogged down with many thousands of items that, for the most part, you might not need or ever use again. Depending on your hosting, these thousands of items could be causing database queries to take longer than necessary.

Items like spam, trashed items, post revisions, and stale transients (where appropriate) can be cleaned up on a regular basis to help reduce the size of your database and speed up your database.

There are many different ways you can clean up your WordPress database, including with phpMyAdmin, WordPress plugins, or simply using the database optimization feature in WP Rocket.

For a comprehensive guide to cleaning up your WordPress database, check out WP Rocket’s post How to Make Your WordPress Database Clean as a Whistle.

If you’re running a large WooCommerce store, it’s worth checking out Pippin Williamson’s free Transients Manager plugin for developers.

3. Disable Debug Settings When You Aren’t Using Them

Enabling debugging options in WordPress can have some performance impacts on your WooCommerce site. So if you don’t absolutely need debugging enabled on your live site, check your wp-config.php file to make sure that debugging constants like WP_DEBUG and SAVEQUERIES are set to false.

The WordPress Codex entry for SAVEQUERIES even offers a handy reminder when using this query:

“NOTE: This will have a performance impact on your site, so make sure to turn this off when you aren’t debugging.”

BONUS: A Not-So-Secret Weapon for Database Query Analysis: New Relic

A tool we use a lot at Prospress is New Relic.

With an open platform like WooCommerce, it’s impossible to know all the database queries running on your site. The only sane way to diagnose slow queries is to get visibility into your WordPress application as a whole, including all plugins, themes, custom code and WordPress itself. This is exactly what New Relic provides.

With a little knowledge and a few clicks, it’s possible to see all of the database queries that are the most time consuming or have the slowest query time in New Relic.

For example, here’s a screenshot showing database queries ordered by slow query time in New Relic for AutomateWoo.com:

database queries New Relic

The catch? New Relic has traditionally been tricky to set up for store owners as it requires integration with the server itself, not just WordPress.

Fortunately, this is changing as some managed WordPress hosts now offer integration.

If you’re interested in knowing more about the inner workings of your WooCommerce site, consider asking your host for New Relic access. It will help you zero in on the cause of any slow backend performance.

If New Relic is not an option for you, as mentioned above I recommend the Query Monitor or Debug Bar plugins to help you analyze what queries your plugins are running when visiting various pages throughout your site (both on the front and backend).

When determining whether a plugin is less than optimal, the Prospress team identified the following red flags based on experience with client sites:

  • Plugins that run queries on every admin page instead of only their own.
  • Plugins that load their code on other admin pages, whether it’s needed or not.
  • Plugins that add additional columns to certain object types, which often requires additional queries.
  • Plugins that add too many of their own items to the WordPress admin sidebar.

Cause #3. Slow-Loading of Files

1. Track the Load Times of Files and File Sizes

Browser developer tools, like Chrome Dev Tools or Firefox Developer Tools, provide a convenient way to see if there are either large files or an excessive number of files being loaded on an admin page.

For example, loading our admin dashboard for AutomateWoo.com, I can sort file loads on the Network tab of Chrome Dev Tools and see that there is over 1MB of JavaScript taking over 1500ms to be loaded by the Yoast SEO plugin:

How to track load times with Chrome Dev Tools

Importantly, these files will likely be cached locally after an initial load, so their impact on performance may be negligible. The Network tab can also provide insights into files that are not being cached, which will have a large impact on load time, especially if they are large files.

Finally, these tools can be used to see just how many files are being loaded. You can see on AutomateWoo.com, over 100 different files are loaded on the admin dashboard. More files means slower load times!

Once you identify any bottlenecks, the next best steps are to:

  • Disable the offending plugin (and/or find a replacement). The beauty of the WordPress ecosystem is that we are spoilt for choice with the variety of different plugins and tools available for just about anything you need.
  • Contacting the plugin author and letting them know your findings. This way, they can investigate and/or fix the issue. In a way, you are helping everyone by reporting issues and/or bugs—WordPress is all about the community!

Performance Improvements Coming to WooCommerce

There are two database-related projects in active development that we’re really excited about: Custom Project Tables and Custom Order Tables.

These plugins are currently available for testing and we’re anticipating both will greatly improve WooCommerce’s performance, making it much faster for store owners.

So if you can, help test these plugins and send your feedback to the developers. At the very least, you’ll get a sneak peek at the performance gains you can expect once they’re integrated with core.

WooCommerce Custom Product Tables

The WooCommerce core team has been working to resolve issues around the use of the WordPress postmeta database table for storing product information. Their solution is the Custom Product Tables plugin.

The plugin is designed to improve store performance by introducing database tables that are designed for eCommerce. It’s currently in beta but will be production-ready soon.

WooCommerce 3.5 recently introduced the hooks and filters required for the plugin to work. This means store owners can start testing it on staging sites ahead of its integration with core.

Testing shows that checkouts are up for the biggest performance gains with improvements of up to 30% on page load times.

Measuring average load times on woocommerce backend

WooCommerce Custom Order Tables

The Liquid Web team is working on a plugin that introduces a custom table to hold all of the most common order information for WooCommerce in a single, properly-indexed location.

WooCommerce typically creates over 40 separate postmeta entries for every single order. This means if your store receives even 10 orders a day, that’s 400 new rows every day! The larger the postmeta table grows, the longer queries will take to execute, potentially slowing down queries and, in turn, page load times.

The Custom Orders Table plugin saves order data into a single, flat table that’s optimized for WooCommerce queries—one order means only one new row, with minimal performance impacts.

Wrapping Up

If your backend is running slower than a sloth and the usual performance optimization tips aren’t helping, you could well have a problem with non-performant PHP code, non-performant database queries, or slow-loading of files, or even all three. This guide will help you diagnose any issues and implement fixes.

We could go on all day about WooCommerce—Prospress exists to make the world’s best eCommerce platform a little better, because we want to help entrepreneurs prosper with WordPress. But we’ll stop here!

There were a couple of advanced tips we didn’t explore in this article that you might like to look into yourself, including using NGINX instead of Apache, and using real cron instead of WP Cron.

Lastly, I’d encourage you to check out the WooCommerce Custom Product Tables and WooCommerce Custom Order Tables plugins to see what kinds of performance gains you’ll get once these plugins are integrated with core.

About

Jason Conroy works at Prospress Inc. helping WooCommerce store owners sell more subscription products, automate their marketing, and ensure their stores are always running smoothly with automated checkout testing.

2 comments

Comment

So awesome! What a great article. A WordPress Geeks Treasure trove here for sure! I’ve done about half the things you listed here and now I’m salivating to do the other half. Thank you for this article.

Thanks Joel! Glad you like it, I hope the info will be useful 😀

Leave a Reply

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