[wp-trac] [WordPress Trac] #59354: Unnecessary queries performed when updating a post without providing categories or tags

WordPress Trac noreply at wordpress.org
Mon Apr 6 08:13:27 UTC 2026


#59354: Unnecessary queries performed when updating a post without providing
categories or tags
--------------------------------------+------------------------------
 Reporter:  johnbillion               |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Posts, Post Types         |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+------------------------------
Changes (by motylanogha):

 * Attachment "59354.diff" added.

 Patch for current trunk. Skips wp_set_post_categories() on update when
 post_category is not in $postarr, matching the existing tags_input guard.
 Includes unit test verifying fewer queries. All 62 wp_insert_post tests
 pass.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59354>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list