What this problem looks like
CPU usage is requests times cost per request. Cutting either lowers load. Full-page cache slashes PHP executions for anonymous visitors. Fixing one plugin that runs ten SQL queries per page helps everyone.
xmlrpc.php, wp-cron.php, and admin-ajax.php are common attack and abuse endpoints that spike CPU on unsecured sites.
Step 1: Read hosting metrics
Identify whether spikes are sustained or burst. Bursts at the hour mark suggest cron. Constant high CPU with low traffic suggests search engine crawl misconfiguration or malware.
Step 2: Secure and cache public traffic
- Enable full-page cache for anonymous users.
- Use Cloudflare or host WAF to rate limit
wp-login.php. - Disable
xmlrpcif unused: add filter or security plugin toggle. - Block aggressive bots in
robots.txtand firewall when legitimate.
add_filter( 'xmlrpc_enabled', '__return_false' ); Step 3: Fix WP-Cron properly
Disable default wp-cron trigger and use system cron to call wp-cron.php every five minutes. Open wp-config.php in your site root, next to wp-admin and wp-content. Search for DISABLE_WP_CRON first. If the line already exists, set it to true instead of adding a duplicate. If it does not exist, paste the constant above the line that says stop editing:
define( 'DISABLE_WP_CRON', true ); Step 4: Action Scheduler backlog
WooCommerce and Subscriptions queue thousands of actions. Failed or pending queues retry and burn CPU. Clear completed actions and fix stuck hooks.
The commands below need SSH access and will not work inside File Manager:
wp action-scheduler run
wp action-scheduler clean --status=complete Step 5: Plugin and query offenders
Related posts plugins, statistic widgets, and live visitor counters query on every page load. Replace with static blocks or server-side analytics. Query Monitor reveals plugins attaching to init with remote HTTP calls.
To isolate a CPU hog, rename wp-content/plugins to plugins.disabled via File Manager, SFTP, or FTP. If CPU drops, rename plugins.disabled back to plugins, then activate plugins one at a time in wp-admin.
When to stop DIY and hire help
CPU pegged after malware scan, DDoS, or unknown cron jobs needs incident response. BugShield finds WordPress CPU bottlenecks and hardens shops against repeat spikes at a confirmed price without hourly billing surprises.