When something on a WordPress site behaves strangely, the question is usually “which plugin is doing this?”. Hooktrail answers it for any page you open.
Switch it on for yourself, open a page, and choose Hooktrail in the admin bar. A panel opens at the bottom of the page.
Every action and filter that fired, in order, grouped under WordPress’s loading stages. Each row shows when the hook first fired, how many times it ran, how long its first run took, and coloured tags for every plugin or theme with a callback on it. Click a row to see each callback, its priority and the exact file and line where it is defined.
A chart of hook run times: each bar is a hook’s first run, hooks fired inside it sit below it, and the slowest hooks are listed at the top. Click any bar to jump to that hook.
Every plugin, theme and WordPress core with the hooks it used on this page, and the hooks where more than one plugin or theme attaches a callback, listed in the order they run.
Pick a filter such as the_content or document_title_parts, reload, and see its value before and after every single callback, with the changed text highlighted. You see exactly which plugin changed what.
Every database query, with the hook that was running and the plugin or theme file, line and function that made it. Queries are totalled per plugin and repeated queries are grouped.
The theme template used for the page, the theme files loaded, and every script and stylesheet printed, with its size and the plugin, theme or external host that added it.
A short list of things worth a closer look: PHP warnings and notices with the plugin and hook that caused them, plugins on the same filter at the same priority, callbacks at extreme priorities, callbacks removed while the page loaded, repeated queries and slow hooks.
Callbacks registered on hooks that did not run on this page, grouped by plugin.
AJAX and REST API requests you made while recording (for example saves in the block editor), which never show a page of their own. Open any of them to see its full map.
Load two saved maps (for example before and after activating or updating a plugin) and see hooks, callbacks, priorities and assets that changed.
wp hooktrail record <url> [--output=<file>] records a page on this site as a logged-out visitor sees it.wp hooktrail compare <a.json> <b.json> [--fail-on-change] compares two maps; with --fail-on-change it exits with status 1 when they differ, for deploy checks.wp hooktrail hooks <plugin-folder> [--format=table|json|csv|markdown] lists the hooks a plugin offers.