Site logo

Archived topic

How to hide Elements in admin bar?

5 replies · Started by Robert on December 1, 2022

Viewing posts 1–6 of 6

..or disable it in the WordPress admin bar, without deactivating elements?

Hi there,

try adding this PHP Snippet:


add_action('wp', function(){
    remove_action( 'admin_bar_menu', 'generate_add_elements_admin_bar', 100 );
});

Does not seem to work, I tried in function.php of child theme and snippets-plugin.

Thats odd, i tested it ok.
How about just adding this:

remove_action( 'admin_bar_menu', 'generate_add_elements_admin_bar', 100 );

this one works, thanks.

Generally, btw., I think it should be an easy to switch off option.

You're welcome.

This archived topic is closed to new replies.