in Plugins & Tutorials

Simplifying ‘My Sites’ toolbar menu in WordPress multisite

The WordPress Toolbar saves me time daily with useful links as I jump around dozens of WordPress sites editing posts, pages and settings. But as a Super Admin on a multisite installation with hundreds of blogs and websites, I realized it also started costing me time soon after the network was created.

Because my Super Admin account is the site admin on 206 sites and counting, the “My Sites” menu in the toolbar was loading links to those sites on every page load. It got to the point where I would watch the page load get to the “My Sites” dropdown, see it hang for a several seconds while it generated the list, and then finally load the rest of the toolbar.

While one approach to fixing this could be limiting the number of sites loaded in “My Sites”, for my purposes (and those of my Super Admin colleagues) it was best just to swap all those links out for a few network admin links used the most: the “My Sites” page, the Network Dashboard, the Network Sites page and the Network Users page.

Here are the two functions used to remove “My Sites” for Super Admins and then add back in a menu with just a few useful links (this snippet has been tested on WordPress 3.4.2):

You can add any number of other links to network admin pages by entering the desired path in 'href' => network_admin_url('enter-desired-path'). You can find the path by visiting the network admin page you want to add and copying the letters after the last / in the URI. For example, site-new.php is the path for adding a new site to the network and user-new.php is the path for adding a new user to the network.

To get this snippet working for you, create a functions plugin (great tutorials on that are available by Ryan Imel at WPCandy and Justin Tadlock of Theme Hybrid), and then network activate it. Finally, don’t miss this awesome collection of WordPress Toolbar tricks from Chris Winters of techNerdia, who is also the author of the WP My Admin Bar plugin.

Comments (2)

    • It's hard for me to believe, but since writing this post there are approximately 600 sites on that multisite network! We use Amazon Web Services currently but are moving to hosting with a close partner. For many people, I would recommend a managed WordPress host like WP Engine or over AWS. Here's why: