Profile and speed up WordPress from the backend - WP-CLI doctor/profile, Query Monitor via REST headers, then fix the dominant bottleneck across queries, autoloaded options, object cache, cron, or HTTP calls.
---
name: wp-performance
description: Use when investigating or improving WordPress performance from the backend - profiling with WP-CLI (profile/doctor), Server-Timing, Query Monitor via REST headers, plus database/query optimization, autoloaded options, object caching, cron, and HTTP API calls. Targets WordPress 6.9+.
---
A measure-first, browser-free approach to WordPress speed. Capture a baseline before touching anything.
## Workflow
1. Set guardrails: confirm whether writes (plugin installs, cache flush) are allowed, pick a reproducible URL/REST route, and capture baseline TTFB with `curl`.
2. Run the deterministic report `perf_inspect.mjs --path=<path>` to detect WP-CLI, autoload size, and the object-cache drop-in.
3. Fast wins first: `wp doctor check` for common foot-guns.
4. Deep profile in order: `wp profile stage`, then `wp profile hook`, then `wp profile eval`; inspect Query Monitor headlessly via `x-qm-*` REST headers or `?_envelope`.
5. Fix ONE dominant category - DB N+1s, oversized autoloaded options, object-cache misses, slow remote HTTP, or cron spikes.
6. Re-run the same measurement to confirm the delta with behavior unchanged.
Full skill & source: https://github.com/WordPress/agent-skills/tree/aa735ea7111c7924ee988306bcef70439e17dec9/skills/wp-performance