Skip to content

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:

php
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

  1. Navigate to Woody snippets > + Add Snippet in your WordPress dashboard.

  2. Select PHP Snippet as the snippet type.

  3. Paste the following code into the editor:

    php
    add_filter( 'winp_show_admin_bar_menu', '__return_false' );
  4. Under General Options, make sure the Snippet Scope is set to Run everywhere.

  5. Click Publish to save and activate the snippet.

Option 2: Add the Code to Your Theme's functions.php

  1. Navigate to Appearance > Theme File Editor in your WordPress dashboard.

  2. Select the functions.php file from the file list on the right.

  3. Add the following code at the end of the file:

    php
    add_filter( 'winp_show_admin_bar_menu', '__return_false' );
  4. 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:

  1. Refresh any page on your site or dashboard.
  2. Check the WordPress admin bar at the top of the screen.
  3. 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).