[wp-trac] [WordPress Trac] #64304: Archives filters: add new filter to allow customizing the limit for the queries to fetch archives
WordPress Trac
noreply at wordpress.org
Tue Nov 25 18:33:23 UTC 2025
#64304: Archives filters: add new filter to allow customizing the limit for the
queries to fetch archives
-------------------------------+--------------------------------------
Reporter: jeherve | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 1.2
Severity: minor | Keywords: has-patch has-unit-tests
Focuses: performance |
-------------------------------+--------------------------------------
`wp_get_archives` already comes with 2 filters allowing one to customize
some of the aspects of the queries to fetch archives on a site:
- `getarchives_where` allows you to customize the WHERE clause
- `getarchives_join` allows you to customize the JOIN clause
I think it would be useful to add a new filter, to allow customizing the
`LIMIT` clause as well. In some environments, with sites with lots of
posts with longform content, some of those queries can be really resource-
intensive.
Until we have proper pagination for `wp_get_archives` (see #30994), I
think it would make sense to allow admins to customize the LIMIT clause in
some scenarios.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64304>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list