Showing WordPress Hooks on Pages


From time to time you might forget what hooks to use in WordPress. The following article will explain how to show the hooks on your site’s frontend so you can locate them easily.

Method 1 – Echo in HTML

This is easy if you add the following code to your functions.php or via the “Code Snippets” plugin. This might break your site, but you can always view source on the page and see the hooks.Copy

add_action( 'all', 'th_show_all_hooks' );
function th_show_all_hooks( $tag ) {
	if(!(is_admin())){ // Display Hooks in front end pages only
		$debug_tags = array();
		global $debug_tags;
		if ( in_array( $tag, $debug_tags ) ) {
		echo "<pre>" . $tag . "</pre>";
		$debug_tags[] = $tag;

This code is from

Method 2 – Show Hooks Plugin

This plugins is pretty great, however it’s hard to use. Sometimes there’s too many hooks and you can’t find the one you’re looking for.

Show Hooks – WordPress plugin | English (Canada)
Show the origin of a action or filter hook sequentially which helps a developer to debug quickly.

Method 3 – ?


Comments are closed.

You May Also Like