# List Every Hook Fired on a Page

> Lets administrators add ?wpide_hooks=1 to any front-end URL to see, at the bottom of the page, every action and filter that ran and how many times, in firing order.

- Type: PHP
- Runs: Frontend only
- Category: [Developer](https://wpide.com/library/category/developer/)
- Tags: debugging, hooks, actions
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/debug-list-fired-hooks/

## Code

```php
if ( isset( $_GET['wpide_hooks'] ) ) {
    $wpide_hook_counts = array();

    add_action( 'all', function ( $hook ) use ( &$wpide_hook_counts ) {
        $wpide_hook_counts[ $hook ] = ( $wpide_hook_counts[ $hook ] ?? 0 ) + 1;
    } );

    add_action( 'wp_footer', function () use ( &$wpide_hook_counts ) {
        if ( ! current_user_can( 'manage_options' ) ) {
            return;
        }

        echo '<details open style="margin:2rem;padding:1rem;background:#fff;color:#1d2327;border:1px solid #c3c4c7;font:13px/1.5 monospace;position:relative;z-index:99999">';
        echo '<summary><strong>' . count( $wpide_hook_counts ) . ' hooks fired</strong></summary><ol style="columns:2;margin:1rem 0 0 1.5rem">';
        foreach ( $wpide_hook_counts as $hook => $count ) {
            echo '<li>' . esc_html( $hook ) . ( $count > 1 ? ' <em>&times;' . (int) $count . '</em>' : '' ) . '</li>';
        }
        echo '</ol></details>';
    }, PHP_INT_MAX );
}
```

## Notes

Tracking only starts when the parameter is present, so normal page loads are not slowed down.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "List Every Hook Fired on a Page" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
