Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#44593 closed enhancement (invalid)

get_sites() : Limitation of 100 websites ?

Reported by: onpc's profile onpc Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords:
Focuses: Cc:

Description

Hello,

In the documentation (https://developer.wordpress.org/reference/functions/get_sites/), we can see that the maximum number of sites to be retrieved is by default set to 100.

Why this limitation ?
Can we set by default all websites ?

Thanks !

Change History (1)

#1 @desrosj
5 years ago

  • Component changed from General to Networks and Sites
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version 4.9.6 deleted

Hi @onpc, thanks for this ticket and welcome to Trac!

Some multisite instances have many thousands (if not millions!) of sites. Querying every site on those installs will crash. Querying the entirety of any data set all at once does not scale and is not considered good practice.

100 is a sensible limit that was chosen as the default. If you have performance data that suggests that limit is too low (or high), this ticket can be reopened and the default number can be reevaluated. But retrieving all sites at once is not an option.

Note: See TracTickets for help on using tickets.