
The plugin Query Monitor is an essential tool for WordPress developers.
This helper plugin solves the following problem: when we need to view the page source code, especially on the frontend, QM can be very intrusive.
The plugin author suggests this solution to use in the wp-config.php
file:
if ( ! defined( 'WP_ADMIN' ) || ! WP_ADMIN ) {
define( 'QM_DISABLED', true );
}
My plugin offers a button to toggle this on the Admin Bar.
Just click on the admin bar icon to show/hide QM on the frontend. If the icon is blue, it means QM is active on the frontend; if it is colorless, it means it is inactive.
Usage Instructions
Copy the file “query-monitor-toggle.php
” to the mu-plugins directory of WordPress.
After installation, administrators will find a new icon on the admin bar.
Clicking this button toggles the frontend visibility of Query Monitor without reloading the page.
To extend this functionality to the admin area, visit the Plugins > Must-Use (/wp-admin/plugins.php?plugin_status=mustuse
) page to check “Also disable in the admin area” – this setting appears as an additional checkbox next to the plugin’s action links.
