Fixing High CPU Usage Caused by Admin-Ajax.php in WooCommerce

Published on September 2, 2026 by cakker78@gmail.com
High CPU Usage

If your web host is sending you warnings about excessive CPU usage, or your WooCommerce store frequently slows to a crawl, the prime suspect is almost always a single file: admin-ajax.php.

WordPress uses admin-ajax.php to handle dynamic requests without reloading the page. In a WooCommerce environment, this file is hit constantly for cart updates, session tracking, and heartbeat pings. When traffic spikes, these simultaneous AJAX calls can completely overwhelm your server’s CPU.

1. The Main Culprit: WooCommerce Cart Fragments

WooCommerce uses an AJAX script called “Cart Fragments” to automatically update the cart total in your header whenever a user adds a product. The problem? It fires an uncacheable admin-ajax.php request on every single page load, for every single visitor.If you have 100 concurrent visitors browsing your store, your server is processing 100 heavy, dynamic PHP executions per second just to see if the cart has changed.The Fix: If you do not have a slide-out cart or a cart icon that needs instant updating across all non-shop pages, you can disable cart fragments globally or enqueue it only on WooCommerce pages using a snippet in your theme’s functions.php file, or by using a performance plugin specifically designed to disable cart fragments.

2. The WordPress Heartbeat API

The Heartbeat API is a feature that pings the server every 15 to 60 seconds. It is useful for autosaving posts in the editor or showing real-time sales notifications. However, if you leave your WooCommerce order dashboard open in a browser tab, it constantly hammers the server with AJAX requests.The Fix: You can modify or throttle the Heartbeat API. By using a snippet or an optimization tool, you can reduce the heartbeat frequency to 120 seconds or disable it entirely on the frontend and dashboard (keeping it active only for post editing).

3. Poorly Coded Third-Party Plugins

Not all AJAX requests come from WooCommerce core. Plugins that offer “Live Search,” “Recently Viewed Products,” or “Real-Time Stock Counters” rely heavily on continuous admin-ajax.php polling.The Fix: Open your browser’s Developer Tools (F12) and switch to the Network tab. Filter the requests by “XHR”. Reload your homepage and watch for calls to admin-ajax.php. Click on the request and look at the “Payload” or “Params” tab. The action parameter will usually reveal the exact name of the plugin responsible for the request. Once identified, replace the heavy plugin with a more efficient, REST API-driven alternative.

4. Relying on WP-Cron via AJAX

By default, WordPress handles scheduled tasks (like publishing scheduled posts or clearing transient data) using WP-Cron. WordPress triggers these cron jobs by firing an AJAX request every time someone visits your site. On a high-traffic WooCommerce store, this creates massive, unnecessary CPU overhead.The Fix: Disable the virtual WP-Cron by adding define( 'DISABLE_WP_CRON', true ); to your wp-config.php file. Then, set up a real server-side cron job in your hosting control panel to ping your site every 15 minutes. This shifts the heavy lifting off your visitors’ page loads and onto the server’s native scheduler.

Tired of server upgrade warnings?

Throwing more RAM and CPU at a poorly optimized WooCommerce site is a waste of money. We specialize in identifying database bloat, refactoring heavy AJAX calls, and implementing advanced caching architecture to make your store lightning fast.

Request a Speed Audit