Pro Verified

Name

Hide some items on the Wordpress Sidebar

About

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

Language

PHP

Rating

Voted: 0 by 0 user(s)

How to Setup Snippet

Add to Code Snippets. Always take a backup first!

Codevault

WebSquadron

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.

History

Last modified:

18/05/2023

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
15}
16add_action('admin_menu', 'remove_dashboard_menu_items');

0

Featured Snippet

Related Snippets

Please see some snippets below related to this snippet..

WordPress Admin

AI Verified

0

CLOUD Meister: Hide PlugIns from List

Added: 1 year ago

Last Updated: 1 year ago

WordPress Admin

AI Verified

0

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

1

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..

Performance

AI Verified

32

Remove Unused Javascript

Added: 1 year ago

Last Updated: 3 days ago

Remove Unused Javascript - and improve your Page Speed Insight Score

WooCommerce

Pro Verified

10

Deactivate some WooCommerce Checkout Fields

Added: 1 year ago

Last Updated: 2 weeks ago

Deactivate some WooCommerce Checkout Fields from showing

Elementor

AI Verified

6

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.