Back to Community

Troubleshooting High CPU and Database Load from Google for WooCommerce Sync Queries

4 threads Sep 23, 2025 PluginGoogle for woocommerce

Content

If your WooCommerce site is experiencing performance slowdowns or high CPU usage, and your hosting provider has flagged a complex, repetitive database query, you're not alone. This is a known issue that can occur with the 'Google for WooCommerce' plugin, especially on sites with a large number of products. This guide will help you understand why it happens and what you can do to resolve it.

The Problem: An Inefficient Product Query

The core of the issue is a specific SQL query run by the plugin to determine which products need to be synchronized with Google Merchant Center. The query, which involves multiple joins on the wp_postmeta table, can become very resource-intensive on larger stores. When the plugin attempts to sync thousands of products, this query may run slowly, get stuck in a loop, or consume excessive server resources, leading to the symptoms described in the support threads:

  • High CPU usage (reported up to 370%).
  • Database slowdowns affecting the entire site.
  • The product sync status being stuck as "Sync in progress."
  • "Out of Memory" PHP errors when manually forcing a sync.

Why Does This Happen?

The query is designed to check product visibility settings and sync errors for every product in your catalog. On a large store, this process requires the database to cross-reference a massive amount of data. If your server's PHP memory limit, maximum execution time, or database configuration aren't optimized for this load, the process can fail or cripple your site's performance.

Common Solutions to Try

Here are the most effective steps you can take to address this problem, starting with the simplest.

1. Increase PHP Memory Limit and Execution Time

Even if you have a high memory limit set, the plugin's sync process may require more. Edit your site's wp-config.php file and add or modify the following lines above the /* That's all, stop editing! Happy publishing. */ comment:

define( 'WP_MEMORY_LIMIT', '1024M' );
define( 'WP_MAX_MEMORY_LIMIT', '1024M' );
set_time_limit( 300 ); // Sets the maximum execution time to 300 seconds

Note: Some hosting providers enforce a maximum allowed limit. If you cannot increase it beyond a certain point (e.g., 1024M), you will need to focus on the other solutions below.

2. Install a Persistent Object Cache

A persistent object cache, like Redis or Memcached, is one of the most effective ways to reduce database load. It stores the results of frequent database queries in memory, preventing the database from having to execute the complex sync query repeatedly. Many managed hosting providers offer this as a one-click service. Enabling an object cache can dramatically improve overall site performance and help the sync process run more smoothly.

3. Optimize the Sync Process

If you have a very large catalog (e.g., 14,000 products), syncing everything at once can be problematic. Consider these strategies:

  • Batch Sync: The plugin uses Action Scheduler to handle sync tasks in batches. Ensure that WP-Cron is working correctly. If your site has low traffic, you might need to set up a server-level cron job to trigger wp-cron.php regularly.
  • Selective Sync: Review your sync settings in the 'Google for WooCommerce' configuration. You may be able to exclude certain product categories or tags from the sync to reduce the initial load.

4. Check for Conflicting Plugins or Code

A theme or plugin conflict can sometimes exacerbate performance issues. To test for this:

  1. Temporarily switch to a default WordPress theme like Twenty Twenty-Four.
  2. Deactivate all plugins except for WooCommerce and 'Google for WooCommerce'.
  3. Check if the high CPU usage persists.
  4. If the issue is resolved, reactivate your plugins one by one to identify the culprit.

Summary

Performance issues related to the 'Google for WooCommerce' plugin are often tied to the scale of a store's product catalog and server environment. The most reliable solutions involve optimizing your server's resources (PHP limits, object caching) and ensuring the sync process can run efficiently. If you continue to experience problems after trying these steps, it can be helpful to search the official plugin support forums for similar cases, as other users may have found specific workarounds.