5

I have installed Visual Composer for a client and am now trying to remove the tab from the Dashboard menu. How can I do this?

Remove Visual Composer tab from Dashboard menu

function remove_menus(){

    remove_menu_page( ‘js_composer.php’ );      

}

add_action( ‘admin_menu’, ‘remove_menus’ );

The code used above isn't working for me. It seems the path "js_composer.php" is not correct.

5 Answers 5

7

It is not easy to find it out, but it is pretty easy if you know how.

Add this following code to your themes functions.php.

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

(Previously been admin_menu, now is admin_init)

This is how to find out for the next time:

If you want to hide a link from any plugin in the admin backend, simply use everything behind the ?page= in this example case it's vc-welcome

No need for an additional plugin to remove/hide the link.

11
  • 2
    Very useful information well explained!
    – Luckyfella
    Commented Aug 31, 2017 at 5:17
  • Doesn't work still there. @user2511140 is the correct answer. Commented Jan 14, 2021 at 19:23
  • @MichaelRogers it's exactly the same code. This answer is more basic. If the menu name changed from vc-general to vc-welcome then the answer is still in it as it says simply use everything behind the ?page= in this case it's vc-general
    – marvinpoo
    Commented Jan 15, 2021 at 23:14
  • 1
    @MichaelRogers both answers have identical code, and both answers and the question are all off topic, 3rd party plugin dev support is not in this stacks scope
    – Tom J Nowell
    Commented Jan 15, 2021 at 23:29
  • Delete the question then? I didn't make it. Commented Jan 17, 2021 at 0:12
4

I use version 4.12.1 and this code works for me. Hide from user menu but not for admin menu.

function custom_menu_page_removing() {
    remove_menu_page('vc-welcome'); //vc
}
add_action( 'admin_menu', 'custom_menu_page_removing' );
1
  • This should be the accepted answer. Commented Jan 14, 2021 at 19:25
2

The previous answers did not work for me. I realized that I had to change the hook to admin_init.

function custom_menu_page_removing() {
    remove_menu_page('vc-welcome');
}
add_action( 'admin_init', 'custom_menu_page_removing' );
1
  • Thank you for the information, I've updated my answer, 'cause it's the accepted one so people can find it fast. Kudos for you.
    – marvinpoo
    Commented Oct 13, 2017 at 9:24
1

I solved this by installing the Admin Menu Editor plugin which gave me the ability to manually remove the Visual Composer dashboard tab. Good plugin!

0

This code worked out for me on the latest Wordpress

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.