Slow page load times can degrade a website’s rankings and reputation. Website visitors expect websites to load quickly, and often won’t wait around for a slow-loading site. Google and other search engines penalize sites that are too slow to load, especially on mobile devices. The internet is full of instructions for how to speed up your WordPress website. At RED, we have our own speed improvement steps we run through on website installations. But sometimes that isn’t enough.
Recently, on a client’s website, we ran into extremely slow page load times with WooCommerce, even though this client was on a high-powered host. Pages took as long as 7 to 14 seconds to load, if they didn’t completely time out and return an error.
On this client’s host, we use development, test, and live site environments. The development site was fast, but the test site was slower, and the live site was crawling along at a snail’s pace. What was causing slow page load times with WooCommerce, why were page load times not the same across the three environments, and how could we fix it?
As you look into improving slow page load times on a WooCommerce shop, start with these troubleshooting steps:
- Make a full backup before you begin testing.
- Temporarily turn off your firewall to see if that’s causing a slowdown.
- Check your hosting account to see if it’s over quota.
- Switch to a default theme.
- Remove plugins you don’t need. (This is also good for security.)
- Deactivate other plugins to see if you can track down the slowdown to a specific plugin.
Remove excess data and optimize database tables.
Turn on debugging by adding these lines to wp-config.php. Don’t forget to remove them when you’re done testing:define(‘WP_DEBUG’, true);define(‘WP_DEBUG_LOG’, true);define(‘WP_DEBUG_DISPLAY’, false);define(‘SCRIPT_DEBUG’, true);@ini_set(‘display_errors’, 0);
Fix any PHP errors in your debug.log file, which you’ll find inside the wp-content/ folder.
If you notice one page template loading more slowly than others, try commenting out parts of that template to narrow in on the code that’s causing high resource usage.
What was causing our WooCommerce slowdown?
We ultimately tracked this slow website speed to an oversized debug log. The website was trying to open and write to that file every time it loaded a page. The live site’s debug log was 48.5 GB.On the development site, the file was small, and on the test site, it was 31GB. This size difference also explained the speed difference between the three environments.
When we had previously copied the live site to the test environment, the debug log came along for the ride. But since the test environment got less traffic, the debug log didn’t continue to grow as quickly as the one on the live site.
To solve this issue:
- We turned debug logging off in the wp-config.php file:
define(‘WP_DEBUG’, false);define(‘WP_DEBUG_LOG’, false);
We deleted the existing debug log files.
Now WooCommerce product pages are loading in less than one second.
Much better for our client and the website’s visitors.
Have you run into slow page load times on WooCommerce sites? What helped your site run faster?