Monday , February 3 2025

How to hide unwanted menu items in WordPress admin

When there is a case – disable unused or system sections and tabs in the admin panel on the left, you can use this code for functions.php with a description in the comments:

add_action('admin_menu', 'remove_admin_menu');
function remove_admin_menu() {
	//remove_menu_page('options-general.php'); // Delete the Settings section	
  	remove_menu_page('tools.php'); // Instruments
	remove_menu_page('users.php'); // Users
	remove_menu_page('plugins.php'); // Plugins
	remove_menu_page('themes.php'); // Appearance	
	remove_menu_page('edit.php'); // Blog posts
	remove_menu_page('upload.php'); // Media library
	remove_menu_page('edit.php?post_type=page'); // Pages
	remove_menu_page('edit-comments.php'); // Comments	
	remove_menu_page('link-manager.php'); // Links
  	remove_menu_page('wpcf7');   // Contact form 7
	remove_menu_page('options-framework'); // Cherry Framework
	remove_menu_page('vc-general'); //WPBakery page builder
	remove_menu_page('wpex-panel'); //Theme panel
}

In the admin panel, each menu item has its own a href, and you can easily extract the flamingo value from admin.php?page=flamingo and add it to the construction above:

remove_menu_page('flamingo'); //Flamingo

About iryna

I'm Iryna, a web developer from Ukraine with a decade of experience solving complex technical challenges in the world of freelance. Throughout my career, I've worked on everything from troubleshooting server-side issues and optimizing website performance to enhancing user interfaces. On this blog, I share detailed solutions to the technical problems I’ve encountered and methods that have worked best for me. In addition to my technical expertise, I’m also passionate about digital drawing. I hope the tutorials and insights I provide here will help both fellow developers and creatives alike in their own projects.

Check Also

How to remove 404 //fonts.gstatic.com and //fonts.googleapis.com from WordPress head section

I tried solutions with functions that should remove from head and , but a very …

Leave a Reply

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