[wp-trac] [WordPress Trac] #61097: Filter `wp_count_posts()` query before execution to avoid slow query

WordPress Trac noreply at wordpress.org
Fri Sep 19 11:51:07 UTC 2025


#61097: Filter `wp_count_posts()` query before execution to avoid slow query
-------------------------------------------------+-------------------------
 Reporter:  rcorrales                            |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  6.9
Component:  Posts, Post Types                    |     Version:  2.5
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests has-test-   |     Focuses:
  info                                           |  performance
-------------------------------------------------+-------------------------
Changes (by SirLouen):

 * keywords:  has-patch has-unit-tests has-test-info needs-testing => has-
     patch has-unit-tests has-test-info
 * milestone:  Future Release => 6.9


Comment:

 This has been fully cooked and is ready for delivery.
 Thanks to @sajjad67 for thorough testing and @westonruter for review, and
 obviously @rcorrales for the report and the SQL proposal.

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


More information about the wp-trac mailing list