
In this video, I will show you how you can hide unnecessary Dashboard Menu items on the WordPress website.
function remove_dashboard_menu_items() {
global $menu;
// Uncomment the lines below to exclude specific menu items
// unset($menu[5]); // Removes "Posts"
// unset($menu[10]); // Removes "Media"
// unset($menu[20]); // Removes "Pages"
unset($menu[25]); // Removes "Comments"
unset($menu[60]); // Removes "Appearance"
unset($menu[65]); // Removes "Plugins"
unset($menu[70]); // Removes "Users"
unset($menu[75]); // Removes "Tools"
unset($menu[80]); // Removes "Settings"
remove_menu_page('index.php'); // Removes the Dashboard home page
}
add_action('admin_menu', 'remove_dashboard_menu_items');
Use this PHP code snippet in your WordPress website using any code manager plugin like WP Code, Code Snippets, etc.
You can also paste the code directly into the function.php file of your theme.