[wp-trac] [WordPress Trac] #64325: Notes: comment_count field is unintentionally incremented when note are resolved or reopened

WordPress Trac noreply at wordpress.org
Mon Dec 1 11:02:20 UTC 2025


#64325: Notes: comment_count field is unintentionally incremented when note are
resolved or reopened
--------------------------+--------------------
 Reporter:  wildworks     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  6.9
Component:  Notes         |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+--------------------
 Originally reported at https://github.com/WordPress/gutenberg/issues/73667
 by @shimotomoki

 The `comment_count` column should show the total number **excluding
 notes**. However, when a note is resolved or reopened, the
 `wp_update_comment_count_now` function counts comments including notes,
 and increments `comment_count` by an unexpected number.

 As a result, the comment count may not be displayed correctly in some
 places.

 At the very least, I think the SELECT statement
 [https://github.com/WordPress/WordPress/blob/770a2736945ef2656b85828c2e126f3e07a3b435
 /wp-includes/comment.php#L2875 here] should filter out notes.


 === Step-by-step reproduction instructions

 - Create and publish a new post.
 - Open the post on the front-end and add a normal comment to the post.
 - The comment section says `One response to “{post_title}”`, which is
 correct.
 - Add a block, add a note to it, resolve the note, and save the post.
 - Open the post on the front-end.
 - The comment section says `3 responses to “Test”`, which is incorrect.
 - Access http://localhost:8888/wp-admin/edit-comments.php
 - The "Inresponse to" column shows the number of comments as 3, which is
 incorrect.

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


More information about the wp-trac mailing list