Skip to content
Diamond Sierra

PB-2602: Slow hook

Paul Bunyan code PB-2602 (Warning): Slow hook. What it means and what to do.

Updated · By Diamond Sierra

On this page

What it means

Everything attached to one WordPress hook took longer than the slow-hook threshold in total.

What to do

Add the hook to the watch list in Settings to see each function on it.

Common causes

  • Many plugins attached to the same busy hook (init, wp_loaded, template_redirect, wp_head, wp_footer).
  • One slow function on the hook (PB-2601) making the whole hook slow.
  • A hook that runs many times in one request, such as the_content on a page with many posts.

How to find and fix it

  1. The first time a hook runs slow, Paul Bunyan adds it to the watch list, so later requests time each function on it. You can also add it in Settings → Watch list.
  2. Open a later request with the same hook: the slowest function on it is named with its plugin, file and line.
  3. Then treat it as a slow function (PB-2601).

Details

CodeSeverityGroup
PB-2602WarningCode