How to hide Menu Options in the WordPress admin interface

- by

This is surprisingly easy thanks to a function called remove_menu_page();

To remove the Dashboard item for example, you can use the function like this:

// remove Dashboard

The parameter is the filename of the item you’d like to hide. To find out what that is, simply hover over the menu options in the admin interface and watch URL your browser displays at the bottom. If your browser doesn’t display anything, click on the menu item in question and see that the URL looks like. The parameter you need is anything after wp-admin/

Note that this will only hide the menu item – users can still navigate directly to the page via direct link.

I’ve used this functionality in a plugin called Zen Dash – take a look at the code which is well documented.

For more information check out the WordPress Codex:

If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.