How to Remove Admin Menu Item in WordPress

Remove admin menu item in WordPress has exciting features that can be tailored from the dashboard to enhance user experience and eliminate confusion.

The WordPress admin dashboard contains many menus and submenus, such as Dashboard, Media, Posts, Pages, Comments, Appearance, Plugins, Users, and more.

Removing specific menus from the admin panel is often necessary, particularly when third-party plugin menus or default menus are not needed. Streamlining the dashboard is essential for clarity and efficiency.

Remove Admin Menu Item in WordPress

How to Remove a Menu Item

Using the remove_menu_page( string $menu_slug ) function to remove a menu item.

Example:

  • remove_menu_page( ‘tools.php’ )
  • remove_menu_page( ‘plugin_menu_slug’ )

For example, to remove contact form 7 menu from admin panel use below mentioned codes.

Remove Contact Form

See the results before and after.

Remove Contact Form2

For removing menu items by page, use the mentioned codes-

Remove Menu Items

do_action( ‘admin_init’ )

Fires as an admin screen or script is being initialized. ( admin_init is fires before any other hook when a user accesses the admin arena.)

How to Remove Post Type from WordPress

To remove a registered post type named “blog” from the admin panel, follow these instructions.

Remove Post Type

How to Remove Submenu Page Items

Use remove_submenu_page ( ‘plugin_menu_slug’, ‘plugin_submenu_slug’ ) to remove submenu page items.

Remove Post Type Example

add_action: To include a callback function in your action hook.

admin_menu: Trigger this action before the admin menu is loaded in the Admin panel.

Conclusion

In conclusion, remove Admin Menu item in WordPress is not only straightforward but essential for enhancing the user experience by decluttering the admin interface.

Customizing the admin menu is a powerful strategy that effectively streamlines navigation for specific user roles and eliminates unnecessary visual clutter for your team.

Always back up your site before making any modifications, and rigorously test the adjustments to ensure they align with your needs without compromising functionality.

You will create a more efficient and user-friendly WordPress admin environment by implementing these changes thoughtfully.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *