

Demo
switch_to_blog(), i.e. Super Admin All Sites Menu is faster and uses less resources than the WP Admin Bar My Sites menu.A demo is available in WordPress Playground. It’s a bit slow loading, 50 subsites are added.
If you disable Super Admin All Sites Menu in the Main Site plugins menu, you’ll see the WP Admin Bar My Sites menu doesn’t allow you to scroll and see all sites. This is a 14-year-old (!) bug on WordPress.
If you activate the Restricted Site Access plugin (included), you’ll see a red icon next to the site name. ATM, this only works on the main site due to issues with WordPress Playground.
You can use the following filters to override the defaults:
all_sites_menu_order_by
Sort menu by. Default value is name, accepts id, url or name
add_filter( 'all_sites_menu_order_by', function( string $order_by ) : string {
return 'url';
} );
all_sites_menu_load_increments
AJAX load increments. Default value is 100.
add_filter( 'all_sites_menu_load_increments', function( int $increments ) : int {
return 300;
} );
all_sites_menu_plugin_trigger
Trigger an update of local storage (IndexedDB) when a plugin is (de)activated. Default is [ 'restricted-site-access/restricted_site_access.php' ].
Note: Must be an array and each element in the array must point to the main plugin file. Syntax
'plugin-dir/plugin-file.php'
add_filter( 'all_sites_menu_plugin_trigger', function( array $plugins ) : array {
return [
'restricted-site-access/restricted_site_access.php',
'myplugin/myplugin.php',
];
} );
all_sites_menu_search_threshold
Don’t display search field if there’s less than N subsites. Default value is 20.
add_filter( 'all_sites_menu_search_threshold', function( int $increments ) : int {
return 40;
} );
all_sites_menu_search_threshold
Don’t display search field if there’s less than N subsites. Default value is 20.
add_filter( 'all_sites_menu_search_threshold', function( int $increments ) : int {
return 40;
} );
all_sites_menu_force_refresh_expiration
How often a forced refresh should be taken. Default value is 3600. Set the value to 0 to disable forced refresh.
add_filter( 'all_sites_menu_force_refresh_expiration', function( int $seconds ) : int {
return 3600;
} );
all_sites_menu_submenu_items
Customise the per-site submenu items (add, remove, or reorder). Each item: ['id' => string, 'title' => string, 'href' => string]. Receives $items, $blog_id, $admin_url, $site_url.
// Add an "Edit Site" link pointing to the network admin site-info page.
add_filter( 'all_sites_menu_submenu_items', function( array $items, int $blog_id, string $admin_url ) : array {
$items[] = [
'id' => 'edit-site',
'title' => 'Edit Site',
'href' => network_admin_url( 'site-info.php?id=' . $blog_id ),
];
return $items;
}, 10, 3 );