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

Block Editor: Select on Enter/Return in the Block Inserter Text Input [SnipSnip.pro]

Added: 5 months ago

Last Updated: 5 months ago

ADMIN ONLY • When using Block Editor and searching for the name of a block or pattern, you can hit enter to jump focus to the results, hit enter again to select. This snippet adds JS to the admin foot...

WordPress Admin

AI Verified

0

Hide "Screen Options" on the Admin Dashboard

Added: 1 year ago

Last Updated: 1 year ago

This snippet hides the "Screen Options" tab for all users except you. Now, you can stop clients from filling the dashboard with all the spammy junk which is generated by many plugins. This snipp...

WordPress Admin

AI Verified

0

Show Site Logo on WP Login Screen - CustomLoginLogo [SnipSnip.pro]

Added: 9 months ago

Last Updated: 6 months ago

Adds your site logo to the WP Login screen. You can customize the css for background color and logo size if desired. <a href="https://snipsnip.pro/s/763" target="_blank" rel="nofollow noopener">https:...

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

Performance

AI Verified

29

Remove Unused Javascript

Added: 1 year ago

Last Updated: 1 month ago

Remove Unused Javascript - and improve your Page Speed Insight Score

WooCommerce

Pro Verified

9

Deactivate some WooCommerce Checkout Fields

Added: 1 year ago

Last Updated: 6 months ago

Deactivate some WooCommerce Checkout Fields from showing

Performance

Pro Verified

5

Disable e-icons from Elementor

Added: 1 year ago

Last Updated: 1 year ago

Disable e-icons - and remove the notification from occurring during your Page Speed Insight Check.