List all hooked WordPress functions

June 24, 2009 at 9:26 am

WordPress hooks are very useful because they allow you to “surcharge” an existing WP function with your own code. But when things goes wrong, it should be useful to be able to list all hooked WordPress functions. Here is the code to it.

The first thing to do is to paste the following function in your functions.php file:

function list_hooked_functions($tag=false){
 global $wp_filter;
 if ($tag) {
  if (!is_array($hook[$tag])) {
  trigger_error("Nothing found for '$tag' hook", E_USER_WARNING);
 else {
 echo '<pre>';
 foreach($hook as $tag => $priority){
  echo "<br />&gt;&gt;&gt;&gt;&gt;\t<strong>$tag</strong><br />";
  foreach($priority as $priority => $function){
  echo $priority;
  foreach($function as $name => $properties) echo "\t$name<br />";
 echo '</pre>';

Once done, simply call the list_hooked_functions() function to print on the screen all hooked WordPress functions. Please note that this function is for debugging purposes only.


Thanks to Rarst for contributing to WpRecipes with this very useful function! If you’d like to contribute to WpRecipes, don’t hesitate to contact me.