[wp-trac] [WordPress Trac] #55309: Incorrect post comment count after deleting comment with replies
WordPress Trac
noreply at wordpress.org
Fri Oct 31 18:52:30 UTC 2025
#55309: Incorrect post comment count after deleting comment with replies
-------------------------+------------------------------
Reporter: jwz | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 5.9.1
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+------------------------------
Changes (by desrosj):
* keywords: 2nd-opinion =>
Comment:
I found this while working on the new Notes feature for WordPress 6.9,
which under the hood is using the default comment object with a new `note`
comment type. I [https://github.com/WordPress/gutenberg/issues/72862
discovered a bug where nested comments were not also being trashed when
the parent note was].
I did a bit of research that I think may be helpful for this ticket, so
sharing it here as well.
> I think that there are reasonable arguments for both sides of the
argument: child comments to continue showing vs. they are hidden (current
behavior).
>
> I took a few minutes and looked into how this is handled and I found
conflicting experiences in the wild with very large social networks.
>
> One instance is Reddit.
>
> - User deletes their account, the comment remains and their user shows
as deleted.
> - User deletes the comment itself, then both user and comment text show
as deleted.
> - If a user is blocked by the comment author, the comment and author are
shown as deleted.
>
> In all scenarios, every nested comments remains.
>
> On the other hand, deleting a comment on Facebook that has replies or
nested comments deletes all of the child comments.
>
> The current behavior in Core is somewhere in between. Child comments are
not deleted, but they are no longer shown on the front end. This is the
same regardless of whether the top level comment is trashed or marked as
spam.
For Notes, I have recommended that we follow the Google Docs model of
trashing all replies for the given Note at the same time. But coming back
to default comments, There are several tickets that need to be taken into
account as this is in some ways a foundational problem. This is not an
all-encompassing list, but it shows that there are inconsistencies in how
WordPress handles deleting parent comments, counting comments who's
parents have been trashed/deleted/marked as spam, re-nesting child
comments, etc. #63931, #53674, #54234, #63931.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55309#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list