phpwordpresswpbakery

Is there any way I can hide the WPBakery Page Builder tab for other roles except admin


I am trying to hide the WPBakery Page Builder tab for all the roles except admin.

I tried using adminimize plugin to do so, but still the tab is visible in all the roles. https://wordpress.org/plugins/adminimize/

I also tried the below code but I can only do it for admin and not other roles.

if ( !is_admin() ) {
    function custom_menu_page_removing() 
    {
    remove_menu_page('vc-general'); //vc
    }
add_action( 'admin_init', 'custom_menu_page_removing' );
}

Solution

  • vc-welcome will hide menu from all other roles except admin so no need to write if condition, You can try below code

    function custom_menu_page_removing() {
        remove_menu_page('vc-welcome');
        }
    add_action( 'admin_init', 'custom_menu_page_removing' );