PHP – WordPress – Hide/Remove WordPress Admin Menus

The given PHP example helps you hide the admin menu options in wordpress.

Code Example:
<?php
// Remove Admin Menus
function remove_menu_items() {
	global $menu;
	$restricted = array(
		__('Links'),
		__('Comments'),
		__('Media'),
		__('Plugins'),
		__('Tools'),
		__('Users')
	);
	end ($menu);
	while (prev($menu)) {
		$value = explode(' ',$menu[key($menu)][0]);
		if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){
			unset($menu[key($menu)]);
		}
	}
}
add_action('admin_menu', 'remove_menu_items');
?>

Post to Twitter Post to Digg Post to Facebook Post to Google Buzz Send Gmail

Leave a Comment

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