How to Disable the Active Snippets Admin Bar Menu
When you have active snippets on your site, Woody Code Snippets displays an Active Snippets menu in the WordPress admin bar at the top of your screen. This menu provides quick access to your currently active snippets. If you prefer a cleaner admin bar or simply do not need this shortcut, you can disable it using a PHP filter.
What the Active Snippets Menu Does
The Active Snippets menu appears in the WordPress admin bar whenever you have one or more snippets enabled. It shows a list of your active snippets so you can quickly navigate to them without going through the full Woody snippets menu in the dashboard sidebar.
While this is a useful feature during development or when managing multiple snippets, some users prefer to remove it to keep the admin bar minimal.
How to Disable the Menu
To hide the Active Snippets menu from the admin bar, add the following PHP filter to your site:
add_filter( 'winp_show_admin_bar_menu', '__return_false' );You can add this code using either of the following methods:
Option 1: Add a PHP Snippet in Woody Code Snippets
Navigate to Woody snippets > + Add Snippet in your WordPress dashboard.
Select PHP Snippet as the snippet type.
Paste the following code into the editor:
phpadd_filter( 'winp_show_admin_bar_menu', '__return_false' );Under General Options, make sure the Snippet Scope is set to Run everywhere.
Click Publish to save and activate the snippet.
Option 2: Add the Code to Your Theme's functions.php
Navigate to Appearance > Theme File Editor in your WordPress dashboard.
Select the
functions.phpfile from the file list on the right.Add the following code at the end of the file:
phpadd_filter( 'winp_show_admin_bar_menu', '__return_false' );Click Update File to save.
⚠️ Important: Editing your theme's functions.php directly means your changes will be lost if you update or switch your theme. Using a Woody PHP snippet (Option 1) or a child theme is recommended instead.
Verifying the Change
After adding the filter:
- Refresh any page on your site or dashboard.
- Check the WordPress admin bar at the top of the screen.
- The Active Snippets menu should no longer appear.
To re-enable the menu later, simply deactivate or delete the snippet containing the filter (or remove the code from functions.php).
