Hook Profiling

Which WordPress Hook Is Slow?

A slow WordPress request usually spends its time across many callbacks. Find Slow Callbacks profiles one real request and ranks the exact hook callbacks by their own time.

Read our reviews on Trustpilot ↗

Why Hooks Hide the Real Cost

WordPress does not run one plugin at a time in a neat queue. A request fires hooks such as plugins_loaded, init, admin_init, wp_head, the content filters and the endpoint-specific action, and every plugin can attach callbacks to the same request.

By the time the page feels slow, the cost is already mixed together. Deactivating plugins in halves can narrow the search, but it cannot tell you which callback inside the plugin cost the time.

The Pattern

The page takes seconds, Query Monitor or a slow log points at a request, and the plugin list is full of plausible suspects. Every hook fired. The missing fact is which callback consumed the time.

What Find Slow Callbacks Measures

Find Slow Callbacks deploys an MU-plugin profiler. During a test request it wraps hook callbacks with timing code, then records the hook name, callback name, priority and source file.

The main number is own time: time spent inside that callback after subtracting nested callbacks it triggered. When the inclusive total is much larger, the result shows that nested total too, so a cheap wrapper is not mistaken for the expensive child.

Field What it tells you
Hook Which WordPress action or filter was running.
Callback The function, class method or closure that ran.
Own time Time inside the callback itself, after nested hooks are subtracted.
Nested total The larger inclusive cost when that callback triggered more work.
Source file The file path resolved through reflection, usually enough to identify the owning plugin or theme.
Priority Where the callback sat in the hook order.

The default minimum time is 10ms, so the report is not buried under thousands of trivial callbacks. Lower it for detail or raise it when only the largest bottlenecks matter.

How a Profiling Session Runs

You give the module one URL on the same hostname. It creates a one-time token, preflights the URL, then fires a non-blocking GET request that carries your admin cookies. That means an admin screen can be profiled with the same logged-in identity that opened it.

The MU-plugin does not profile normal traffic. It activates for the request carrying a valid token, times the hooks in that request, writes the batch to its database table and the module streams progress back to the screen.

  • Same-site URLs only: the URL host must match the WordPress site host.
  • GET requests: the profiler can load a URL, but it cannot replay a browser POST payload.
  • Loopback required: the server must be able to request itself; the module tries a localhost fallback when the direct URL fails.
  • One URL per run: the result describes the request that was profiled; other URLs need their own runs.

Read the Result Without Blaming the Wrong File

Inclusive timing is a trap. A theme callback on wp_head can look slow because six plugins underneath it did the work. Own time separates what the callback did itself from what it triggered.

Start with the largest own-time rows, then use the nested total as context. A callback with low own time and high nested time is a launcher. A callback with high own time is the place to inspect.

Evidence Better interpretation
High own time This callback itself is expensive and deserves the first look.
Low own time, high nested total The callback triggers expensive children; do not blame the wrapper first.
Same source file repeating One plugin or theme owns several costly callbacks in this request.
HTTP badge The last Site Doctor scan flagged that plugin for HTTP calls outside wp_remote_*.

Sessions are saved, so a before-and-after comparison does not depend on memory or screenshots. Run the same URL after a plugin change and compare the shape of the result.

Find Slow Callbacks is a Pro module, and every paid plan includes all 19 modules from $79/year for one site. Profile the request once, then stop arguing with the plugin list.

Get WP Multitool - from $79/year

What the Profiler Does Not Replace

A callback profile explains PHP time. It does not explain the SQL inside that callback. When the expensive callback is a database problem, Slow Query Analyzer is the module that names the query.

Its scope is narrower than a full application profiler: WordPress hook evidence, captured inside the request you care about, without turning a production site into a permanent tracing lab.

Honest Limits

  • It is off by default. The MU-plugin file loads on every request even though profiling only activates for a tokenized test request, so the module is an explicit opt-in.
  • It adds overhead while profiling. Reflection and timing cost CPU during the test request. Do not treat the measured page time as normal production time.
  • It cannot replay POST. A checkout submit, form post or ajax payload is not reproduced by the GET request.
  • It needs loopback HTTP. Firewalls, 403 rules, 5xx responses or blocked localhost requests can stop the session before profiling starts.
  • Results vary. Cache warmth, database load and external services change between runs, so compare repeated sessions before trusting a pattern.
  • It does not fix the callback. The report names the hook, callback and file. Deactivating, replacing or patching the owner remains your decision.

WordPress Hook Profiling FAQ

How do I find which WordPress hook is slow?

Profile the slow request, then sort the captured callbacks by own time. The report shows the hook, callback, priority and source file, which is much more useful than guessing from the plugin list.

What is the difference between own time and total time?

Own time is what the callback spent itself after nested callbacks are subtracted. Total time includes the hooks it triggered, so a cheap wrapper can have a large total without being the real cost.

Does profiling affect normal visitors?

No. Normal requests are not profiled. The MU-plugin activates only for a request carrying the one-time token created for the explicit test session.

Can it profile wp-admin pages?

Yes, when the test request can carry your admin cookies and the server can make the loopback request. The URL still has to belong to the same site hostname.

Can it replay an ajax POST or checkout submit?

No. The profiler loads one URL with a GET request. It cannot replay the browser POST payload, so ajax endpoints are measured as a URL load rather than an exact form submission.

Why is Find Slow Callbacks disabled by default?

The module installs an MU-plugin file that loads on every request, even though actual profiling is token-gated. The extra file is negligible when idle, but enabling it remains an explicit opt-in.

Name the Callback

Find Slow Callbacks is included with WP Multitool Pro, and every paid plan includes all 19 modules from $79/year for one site. Profile the slow URL, rank the callbacks by own time, and compare the next run after the fix.

Get WP Multitool - from $79/year Find Slow Callbacks Docs All plans on the pricing page →