Pro Verified


Hide some items on the Wordpress Sidebar


Maybe you want to hide the Plugin item or more from the Wordpress Dashboard Sidebar.




Voted: 0 by 0 user(s)

How to Setup Snippet

Add to Code Snippets. Always take a backup first!



Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.


Last modified:


Important Note

This snippet has the following status:

Pro Verified

This snippet has been verified by a Code Snippet Pro team member.

Pro Comments:

Hide some items on the Wordpress Sidebar

1function remove_dashboard_menu_items() {
2 global $menu;
3 // Uncomment the lines below to exclude specific menu items
4 // unset($menu[5]); // Removes "Posts"
5 // unset($menu[10]); // Removes "Media"
6 // unset($menu[20]); // Removes "Pages"
7 unset($menu[25]); // Removes "Comments"
8 unset($menu[60]); // Removes "Appearance"
9 unset($menu[65]); // Removes "Plugins"
10 unset($menu[70]); // Removes "Users"
11 unset($menu[75]); // Removes "Tools"
12 unset($menu[80]); // Removes "Settings"
13 unset($menu[80]); // Removes "Settings"
14 remove_menu_page('index.php'); // Removes the Dashboard home page
16add_action('admin_menu', 'remove_dashboard_menu_items');


Featured Snippet

Related Snippets

Please see some snippets below related to this snippet..

WordPress Admin

AI Verified


CLOUD Meister: Hide PlugIns from List

Added: 1 year ago

Last Updated: 1 year ago

WordPress Admin

AI Verified


Reduce WooCommerce Product Admin Column Widths

Added: 4 months ago

Last Updated: 4 months ago

If you're adding new columns to your Woo Admin Screen, then reducing the size of fields such as Name can be great.

WordPress Admin

AI Verified


Hide WP Admin Bar For Non-Admins

Added: 11 months ago

Last Updated: 11 months ago

Hide WP Admin Bar For Non-Admins

Other Snippets in this Codevault

These are some popular snippets from this users codevault..


AI Verified


Remove Unused Javascript

Added: 1 year ago

Last Updated: 3 days ago

Remove Unused Javascript - and improve your Page Speed Insight Score


Pro Verified


Deactivate some WooCommerce Checkout Fields

Added: 1 year ago

Last Updated: 2 weeks ago

Deactivate some WooCommerce Checkout Fields from showing


AI Verified


CSS Grid Aid

Added: 8 months ago

Last Updated: 1 month ago

This can be used for any WordPress Builder to aid working with CSS Grids.