Remove admin menu elements
-
Hello everyone,
I’m trying to remove some admin menu elements from the backend of my wp site. I used this code:if( !current_user_can('admin_role') ) { function remove_menu_elements() { remove_menu_page('bricks'); remove_menu_page('ivory-search'); remove_menu_page('complianz'); remove_menu_page('themes.php'); remove_menu_page('fonts-plugin'); remove_menu_page('plugins.php'); remove_menu_page('tools.php'); remove_menu_page('options-general.php'); remove_menu_page('wptelegram'); remove_menu_page('bnfw_notification'); remove_menu_page('pods'); remove_menu_page('fpsm'); remove_menu_page('roles'); remove_menu_page('one-user-avatar'); remove_menu_page('googlesitekit-splash'); } add_action( 'admin_init', 'remove_menu_elements' ); }
This code is working for most of the elements, but some are not removed. Like the Plugin “Members”, or “Customize WordPress Emails and Alerts – Better Notifications for WP”, and some more. What am I doing wrong? Why are those ones not being removed? Is there some way to achieve the result? Thanks a lot!
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘Remove admin menu elements’ is closed to new replies.