[wp-trac] [WordPress Trac] #45140: REST API: Increase upper bound allowed on per_page argument

WordPress Trac noreply at wordpress.org
Mon May 19 00:08:48 UTC 2025


#45140: REST API: Increase upper bound allowed on per_page argument
------------------------------------------+--------------------------------
 Reporter:  danielbachhuber               |       Owner:  (none)
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  REST API                      |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  rest-api,
                                          |  performance
------------------------------------------+--------------------------------

Comment (by dd32):

 Personally I'm okay for this to be closed as `maybelater` if wanted, but
 at the same time, there's no real reason why a larger limit can't be
 considered.

 I'd be tempted to say that `100` is mostly fine. It also seems that the
 [https://developer.wordpress.com/docs/api/1.1/get/sites/%24site/posts/#:~:text=The%20number%20of%20posts%20to%20return.%20Limit%3A%20100.%20Default%3A%2020.
 WordPress.com API] defaults to 20 with max 100 per page too.

 Since I mentioned memory constrained hosts above, any issues that could
 occur at per_page=1000 could theoretically also happen at per_page=50 on
 some memory constrained hosts, even though it's unlikely.

 I think it's important to note that those who would run into this limit
 and want a change, are also likely to be running on environments where a
 higher limit is very achievable, those who don't understand it and never
 need to know that there were 5 paginated API requests behind the scenes
 are also the ones where it would likely run into issues if it were a bulk
 500 request.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45140#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list