+91 88 00 563434 [email protected] Blog open-book Knowledge Base

Find Solutions in Our Knowledge Base

How to Remove Tabs from the WordPress Administrator Dashboard

You are here:
Sharing is Caring

Please note: We have not tested this on the latest WordPress themes. So proceed with caution.

While the WordPress admin panel offers many useful features to help you build your blog or website, not everyone will find all of them necessary. Especially if you install numerous plugins, your sidebar in the dashboard can quickly become cluttered, resulting in a slower interface and decreased productivity. Fortunately, in newer versions of WordPress, you can remove certain menu items that you have no use for by adding a few lines of code to your theme’s functions file. For example, if your website is static rather than a traditional blog, you probably won’t need the Posts or Comments sections. This guide demonstrates how to remove unnecessary tabs without the need for additional plugins.

  1. Login to your WordPress admin panel and go to Appearance > Customize. Open the functions.php file under Theme Functions in the right sidebar.
  2. Scroll down the code page and paste the following lines of code into the file:

<?php

function remove_menus() {
remove_menu_page( ‘index.php’ ); //Dashboard
remove_menu_page( ‘edit.php’ ); //Posts
remove_menu_page( ‘add.php’ ); //Media
remove_menu_page( ‘edit.php?post_type=page’ ); //Pages
remove_menu_page( ‘edit-comments.php’ ); //Comments
remove_menu_page( ‘themes.php’ ); //Appearance
remove_menu_page( ‘plugins.php’ ); //Plugins
remove_menu_page( ‘users.php’ ); //Users
remove_menu_page( ‘tools.php’ ); //Tools
remove_menu_page( ‘options-general.php’ ); //Settings
}

add_action( ‘admin_menu’, ‘remove_menus’ );

?>

  1. Edit the above code to customize the appearance of items in your admin panel. To do this, simply remove the lines of code referring to the menu pages you want to keep. Using all the code listed above will remove all default tabs from the sidebar, which you probably won’t need.
  2. If you want to remove submenus from specific tabs, you can do so by using the remove_submenu_page command instead of the remove_menu_page command. For example, if you want to hide the Themes section under the Appearance tab, you can use the following line of code:

Remove_submenu_page( ‘themes.php’ );

  1. Save your changes by clicking “Update File” at the bottom of the page. If you change your theme, you will need to edit the functions.php file again, as this code is specific to the currently activated theme and not the WordPress platform itself.


Sharing is Caring

Leave a Comment

Table of Contents