Remove Links From WordPress Admin Menu

Since WordPress 3.1 they have made it very easy to remove any unwanted links from the admin menu bar.

Wordpress link menu

Most people don't want the Links menu item to be displayed so by adding the following code to your functions.php page you can remove the links menu item.

add_action( 'admin_menu', 'my_admin_menu' );
function my_admin_menu() {

If you want to remove any of the others then make sure that you change link-manager.php page to one of the other pages.

For example if you want to remove the media link from the menu then change the above snippet to.

add_action( 'admin_menu', 'my_admin_menu' );
function my_admin_menu() {

Remove Sub Menu Pages

To remove a sub-menu page you can not use the remove_menu_page() function, this will not work.

If you want to remove a sub-menu page you need to use the function remove_submenu_page().

You use this the same way as the remove_menu_page() but you pass through the slug of the sub-menu.

<?php remove_submenu_page( $menu_slug, $submenu_slug ) ?>
Back to top

Learn how to code with Treehouse

  • Learn projects with access to 1000+ videos
  • Practice live with our Code Challenge Engine
  • Get help in our members-only forums

Start with a 7 day free trial