How to remove the Tools menu item from the WP-Admin menu

Where is function.php is stored and built? I want to remove menu named as tools from mysite from all user like admin and other user’s?

I Request you please help me out from this problem.Give me the best solution like lay-man to wordpress so that i can understand things quickly.

Related posts

Leave a Reply

3 comments

  1. You want to use remove menu page.

    <?php
    add_action( 'admin_menu', 'wpse26980_remove_tools', 99 );
    function wpse26980_remove_tools()
    {
        remove_menu_page( 'tools.php' );
    }
    

    You can drop that in your functions.php file (without the opening <?php most likely).

    That’s not going to prevent people from typing in yoursite.com/wp-admin/tools.php and seeing the tools page, however.

  2. The following code removes menus, place in your theme functions.php file:

    // Remove unneeded menus
    function sc_remove_menus()
    {
        // setup the global menu variable
        global $menu;
        // this is an array of the menu item names we wish to remove
        $restricted = array( __('Links'),__('Tools'),__('Comments'), __('Media'));
        end ($menu);
        while (prev($menu))
        {
            $value = explode(' ',$menu[key($menu)][0]);
            if(in_array($value[0] != NULL?$value[0]:"" , $restricted))
            {
                unset($menu[key($menu)]);
            }
        }
    }
    // hook into the action that creates the menu
    add_action('admin_menu', 'sc_remove_menus');
    

    If you just want to remove just tools then change this line:

    $restricted = array( __('Links'),__('Tools'),__('Comments'), __('Media'));
    

    to:

    $restricted = array(__('Tools'));
    

    This will only remove the menu item. You can still get to tools by typing in the URL manually.