User Agents

Web browsers and everyday web tech, explained

Remove Tabs from WordPress Admin Dashboard

· 5 min read · Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Removing tabs from the WordPress administrator dashboard streamlines the interface by hiding unnecessary menus and submenus, improving focus and reducing clutter for site administrators and clients. This is particularly useful when managing client sites or simplifying the backend for non-technical users. You can remove dashboard tabs—such as Posts, Comments, Plugins, or specific submenu items—using built-in WordPress hooks via your theme’s functions.php file or a custom plugin. This guide walks you through the process safely and effectively, ensuring you maintain full control without breaking functionality.

What You'll Need

  • Access to your WordPress site’s admin dashboard
  • Administrator-level login credentials
  • Access to your theme’s functions.php file or the ability to create a custom plugin
  • A child theme (recommended to prevent loss of changes during theme updates)
  • A code editor or the built-in WordPress Theme Editor
  • Basic understanding of PHP syntax and WordPress hooks

Step-by-Step

  1. Log in to your WordPress admin dashboard using administrator credentials.
  2. Navigate to Appearance > Theme File Editor or use an external code editor if you are working locally. If using the built-in editor, ensure you have selected the active theme—preferably a child theme.
  3. In the right-hand column, locate and select the functions.php file. If you're using a child theme, this file may be empty or contain existing customizations.
  4. Add the following PHP opening tag if it's not already present at the top of the file: <?php.
  5. To remove top-level admin menu items (like Posts, Media, or Comments), use the remove_menu_page() function. Insert this code snippet into functions.php, customizing the menu slug as needed:
    function remove_unwanted_menu_items() {
        remove_menu_page('edit.php'); // Removes Posts
        remove_menu_page('upload.php'); // Removes Media
        remove_menu_page('edit-comments.php'); // Removes Comments
    }
    add_action('admin_menu', 'remove_unwanted_menu_items');
  6. To remove submenu items (like specific tools or settings pages), use the remove_submenu_page() function. For example, to remove the Privacy settings submenu under Settings:
    function remove_submenu_items() {
        remove_submenu_page('options-general.php', 'options-privacy.php');
    }
    add_action('admin_menu', 'remove_submenu_items', 999);
  7. Replace the slugs in the functions with the appropriate ones for the tabs you want to remove. Common slugs include:
    • index.php – Dashboard
    • post-new.php – New Post
    • themes.php – Appearance
    • plugins.php – Plugins
    • users.php – Users
    • tools.php – Tools
    • options-general.php – Settings
  8. For more granular control—such as hiding tabs only for specific user roles—wrap the remove functions in conditional logic. For example, to remove the Plugins tab only for users who are not administrators:
    function remove_menu_based_on_role() {
        if (!current_user_can('administrator')) {
            remove_menu_page('plugins.php');
        }
    }
    add_action('admin_menu', 'remove_menu_based_on_role');
  9. After adding your code, click Update File if using the Theme Editor. If using a local editor, upload the modified functions.php file via FTP or your hosting file manager.
  10. Log out and log back in to see the changes take effect, or open an incognito browser window to test as a non-admin user if applicable.
  11. (Optional) Instead of editing functions.php, create a custom plugin to house these functions. This keeps your changes independent of the theme. Create a new folder in /wp-content/plugins/, add a PHP file with a plugin header, and include the same functions inside. Activate the plugin from Plugins > Installed Plugins.

Common Mistakes

  • Editing the parent theme’s functions.php instead of a child theme, causing loss of changes after updates.
  • Using incorrect slugs for menu pages—always verify the correct slug in WordPress core documentation or by inspecting URLs in the admin panel.
  • Forgetting to add the <?php tag, resulting in a blank screen or syntax error.
  • Removing essential pages like Dashboard or Settings without providing alternatives, which can lock users out of critical functions.
  • Applying removals to all users when the goal was to restrict only certain roles.

Tips

  • Always back up your site and functions.php file before making changes.
  • Use a staging environment to test changes before applying them to a live site.
  • Use the 999 priority in add_action when removing submenu items to ensure the hook runs after all menus are registered.
  • Consider using plugins like Admin Menu Editor for a GUI-based approach if you prefer not to code.
  • Comment your code clearly so future developers (or you) understand why certain tabs were removed.

Troubleshooting

If the tabs do not disappear after saving changes, first verify that you are logged in with the correct user role and that conditional logic isn’t blocking the removal. Clear any caching plugins or server-side cache, as cached admin pages may not reflect changes immediately. If you see a white screen or error, reconnect via FTP and restore the original functions.php file—this usually indicates a PHP syntax error. Use a PHP linter or code validator to check your script before upload. If using a custom plugin, ensure it is activated and contains a valid plugin header. If submenu items persist, increase the action priority (e.g., 999) to ensure the removal runs late in the admin menu setup process.

Frequently Asked Questions

Can I remove the Dashboard tab?

Yes, but not recommended. Use remove_menu_page('index.php'), though this may disorient users.

Will removing tabs affect site functionality?

No—removing tabs only hides access. The underlying features still exist and can be accessed via direct URLs.

How do I restore a removed tab?

Delete the corresponding remove_menu_page() or remove_submenu_page() function from your code and update the file.

Can I hide tabs for specific user roles only?

Yes. Use current_user_can() to conditionally apply removals based on user capabilities.

Is it safe to edit functions.php?

Yes, if using a child theme and you’ve backed up the file. Errors can cause a white screen, so proceed cautiously.

Do I need a plugin to remove dashboard tabs?

No. You can use code in functions.php or a custom plugin, but GUI plugins are available for non-coders.