Skip to content

Large Network Problem

Frank Bültge edited this page Feb 26, 2015 · 6 revisions

Change the get sites value

The plugin get on default 9999 sites from the network. If you have more sites as the default value 9999 then use the filter hook multisite_enhancements_sites_limit to change this value. The default of WordPress since version 3.7 is 100.

add_filter( 'multisite_enhancements_sites_limit', function() {
	
	// set the new value
	$sites_limit = 20000;
	
	// Return the value
	return $sites_limit;
} );

Historie

Included via Commit dc17bec, Released in Version 1.1.0

Change the Core value

If you use the Multisite functionality for more as 10.000 sites inside the network, then will WordPress stop a lot of processes. Also a result for this plugin and it will not list all themes and plugins on the admin pages. But you can change the value for the default. The follow source is a example, copy this in a custom plugin for your network.

add_filter( 'wp_is_large_network', function( $is_large, $type, $count ) {

	if ( ! $is_large )
		return $is_large;

	// $type can be 'sites' or 'users'
	if ( 'sites' !== $type )
		return $is_large;

	// Default is 10000, we add one 0
	return $count > 100000;
}, 10, 3 );

Background: see the issue