Remove Toolbar options on WordPress Multisite

How to remove the dropdowns in your toolbar, the little black bar at the top of the page you see when you’re logged in, in a WordPress multisite install.  Many like to customize the experience a user gets when they sign up for a site so this function comes in handy.

These are most of them, but you can find more by viewing the source code and searching for wp-admin-bar- the id is the stuff that comes right after that in each case. So to remove the WP logo, you’ll see wp-admin-bar-wp-logo. “wp-logo” is the id and you use that to remove it in the function.

Slightly more involved is the foreach loop in the function that removes the new posts link that drops down from the “My Sites” Nav item. For example, I used some custom post types and not the “post” post type, so I wanted to delete that and keep the My Sites dropdown super simple. So it checks for all blogs created by the user in the foreach and adds them to their own unique id to remove them.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

40 + = 50