Query Monitor 4.1.1 has 13 actions and 34 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Query Monitor fires an action
add_action( 'debug_bar_enqueue_scripts', function() {
// Your code runs here.
}, 10, 1 );
// Change a value Query Monitor is about to use
add_filter( 'qm/collect/silent_http_errors', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * This filter is documented in collectors/http.php */ apply_filters( 'qm/collect/silent_http_errors', array( 'http_request_not_executed', 'airplane_mode_enabled', ) ); -
/** * This filter is documented in wp-includes/class.wp-scripts.php */ apply_filters( "{$loader}_loader_src", $src, $dependency->handle ); -
/** * Fires after scripts have been enqueued. This mimics the same action fired in * the Debug Bar plugin. */ do_action( 'debug_bar_enqueue_scripts' ); -
/** * Filters the debug bar panel list. This mimics the same filter called in the * Debug Bar plugin. */ apply_filters( 'debug_bar_panels', array() ); -
/** * Fires when an `alert` level message is logged. */ do_action( 'qm/alert', $message, $context ); -
/** * Fires when an assertion is performed. */ do_action( 'qm/assert', $assertion, $message, $value ); -
/** * Allow filtering of built-in collector files. */ apply_filters( 'qm/built-in-collectors', $collectors ); -
/** * Filters the concerned actions for the given panel. */ apply_filters( "qm/collect/concerned_actions/{$id}", $this->get_concerned_actions() ); -
/** * Filters the concerned constants for the given panel. */ apply_filters( "qm/collect/concerned_constants/{$id}", $this->get_concerned_constants() ); -
/** * Filters the concerned filters for the given panel. */ apply_filters( "qm/collect/concerned_filters/{$id}", $this->get_concerned_filters() ); -
/** * Filters the concerned options for the given panel. */ apply_filters( "qm/collect/concerned_options/{$id}", $this->get_concerned_options() ); -
/** * Allows users to filter the names of conditional functions that are exposed * by QM. */ apply_filters( 'qm/collect/conditionals', array( 'is_404', 'is_admin', 'is_archive', 'is_attachment', 'is_author', 'is_blog_admin', 'is_category', 'is_comment_feed', 'is_customize_preview', 'is_date', 'is_day', 'is_embed', 'is_favicon', 'is_feed', 'is_front_page', 'is_home', 'is_login', 'is_main_network', 'is_main_site', 'is_month', 'is_network_admin', 'is_page', 'is_page_template', 'is_paged', 'is_post_type_archive', 'is_preview', 'is... ); -
/** * Fires before logging the PHP error in Query Monitor. */ do_action( 'qm/collect/new_php_error', $errno, $message, $file, $line, $context ); -
/** * Filters the levels used for reported PHP errors on a per-component basis. */ apply_filters( 'qm/collect/php_error_levels', array() ); -
/** * Filters the PHP error handler return value. This can be used to control * whether or not the default error handler is called after Query Monitor's. */ apply_filters( 'qm/collect/php_errors_return_value', $return_value ); -
/** * Filters the collectors that are being added. */ apply_filters( 'qm/collectors', array(), $this ); -
/** * Filters the context for a custom or unknown component. The context is * usually a representation specific to the individual component, for example * the file base name. */ apply_filters( "qm/component_context/{$type}", $context, $file, $file ); -
/** * Filters the absolute directory paths that correlate to components. */ apply_filters( 'qm/component_dirs', self::$file_dirs ); -
/** * Filters the user-facing name to display for a custom or unknown component. */ apply_filters( "qm/component_name/{$type}", $name, $this->file ); -
/** * Filters the type of a custom or unknown component. */ apply_filters( "qm/component_type/{$type}", $type, $file, $file, $context ); -
/** * Fires when a `critical` level message is logged. */ do_action( 'qm/critical', $message, $context ); -
/** * Fires when a `debug` level message is logged. */ do_action( 'qm/debug', $message, $context ); -
/** * Allows users to disable this dispatcher. */ apply_filters( "qm/dispatch/{$this->id}", true ); -
/** * Filters the dispatchers that are being added. */ apply_filters( 'qm/dispatchers', array(), $this ); -
/** * Fires when an `emergency` level message is logged. */ do_action( 'qm/emergency', $message, $context ); -
/** * Fires when an `error` level message is logged. */ do_action( 'qm/error', $message, $context ); -
/** * Fires when an `info` level message is logged. */ do_action( 'qm/info', $message, $context ); -
/** * Fires when a `notice` level message is logged. */ do_action( 'qm/notice', $message, $context ); -
/** * Fires when assets for QM's HTML have been enqueued. */ do_action( 'qm/output/enqueued-assets', $this ); -
/** * Filters the clickable file link format. */ apply_filters( 'qm/output/file_link_format', $format ); -
/** * Filters the file path mapping for clickable file links. */ apply_filters( 'qm/output/file_path_map', $map ); -
/** * Filters the title used in Query Monitor's admin toolbar menu. */ apply_filters( 'qm/output/title', array() ); -
/** * Allows users to filter what outputs. */ apply_filters( "qm/outputter/{$outputter_id}", array(), $collectors ); -
/** * Back-compat filter. Please use `qm/dispatch/html` instead */ apply_filters( 'qm/process', true, is_admin_bar_showing() ); -
/** * Filter whether to show the QM extended query information prompt. */ apply_filters( 'qm/show_extended_query_prompt', true ); -
/** * Filters which classes to ignore when constructing user-facing call stacks. */ apply_filters( 'qm/trace/ignore_class', self::$ignore_class ); -
/** * Filters which action and filter names to ignore when constructing * user-facing call stacks. */ apply_filters( 'qm/trace/ignore_hook', self::$ignore_hook ); -
/** * Filters which class methods to ignore when constructing user-facing call * stacks. */ apply_filters( 'qm/trace/ignore_method', self::$ignore_method ); -
/** * Filters which namespaces to ignore when constructing user-facing call * stacks. */ apply_filters( 'qm/trace/ignore_namespace', self::$ignore_namespace ); -
/** * Filters the number of argument values to show for the given function name * when constructing user-facing call stacks. */ apply_filters( 'qm/trace/show_args', self::$show_args ); -
/** * Fires when a `warning` level message is logged. */ do_action( 'qm/warning', $message, $context ); -
/** * This filter is deprecated. Please use `qm/collect/conditionals` instead. */ apply_filters( 'query_monitor_conditionals', $conds ); -
do_action( 'qm/cease' ); -
apply_filters( 'qm/environment-constants', $constants );
Generated from Query Monitor's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: