Remove tools.php page from WordPress admin

Background

The WordPress admin section (/wp-admin) contains a menu item named tools (between users and settings). It has an obtrusive sub-item named “Available Tools” which is a page that contains a feature named “Press This”.

/wp-admin/tools.php

My question

How do I remove this page from the tools section?

Read More

What I’ve tried

I’ve tried a function to remove menu item:

    add_action( 'admin_menu', 'my_remove_menu_pages' );
function my_remove_menu_pages() {
    remove_menu_page('press-this.php');
    //remove_menu_page('tools.php');
}

If I remove tools.php, the entire tools section is removed rather than just the “Available Tools” section.

I’ve also tried deleting the press-this.php from the directory.

Neither approaches have been to any avail.

I cannot find a solution anywhere online. Any help would be greatly appreciated.

Related posts

Leave a Reply

3 comments

  1. this way uses WP functions:
    tested and work

    add_action( 'admin_menu', 'remove_tools' );
    function remove_tools() {
        remove_submenu_page('tools.php', 'tools.php');
    }
    
  2. You can use admin_menu hook to modify $submenu global var :

    add_action('admin_menu','modify_menu');
    
    function modify_menu()
    {
      global $submenu;
      unset($submenu['tools.php'][5]);
    }
    

    EDIT : as janw said in his answer, you should instead use remove_submenu_page

  3. Try this code. It hides the entire Tools menu if there’s no other tools available to the user.

    add_action('admin_init', 'remove_tools_admin_menu');
        function remove_tools_admin_menu() {
            global $submenu;
            unset($submenu['tools.php'][5]);
            if(count($submenu['tools.php']) == 0) {
                remove_menu_page('tools.php');
            }
    }