[wp-trac] [WordPress Trac] #63931: Deleting a parent comment causes the child to move up a level

WordPress Trac noreply at wordpress.org
Wed Sep 10 23:18:46 UTC 2025


#63931: Deleting a parent comment causes the child to move up a level
---------------------------------------+-----------------------------
 Reporter:  oglekler                   |       Owner:  (none)
     Type:  enhancement                |      Status:  new
 Priority:  normal                     |   Milestone:  Future Release
Component:  Comments                   |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:  has-test-info 2nd-opinion  |     Focuses:
---------------------------------------+-----------------------------

Comment (by peterwilsoncc):

 Replying to [comment:8 SirLouen]:
 > @peterwilsoncc I can agree that the advanced proposal to have
 placeholders, could be part of a plugin.
 >
 > The problem, though, is still there: you delete a comment, and the child
 becomes the parent.
 >
 > Another option could be simply trashing all the parent tree under the
 parent removed… Maybe adding a double check when removing a parent with
 children.
 >
 > But definitely converting a child into a parent is not acceptable, it is
 a clear defect.
 >
 > I have not reviewed the code, but even a hook action to override the
 behaviour could be also an option. What do you say @yashjawale ?

 I'm happy to add preflight hooks to the various trashing, deleting and
 related functions if required.

 My reading of the intention behind the reparenting commit is that it
 maintains the comment thread as well as possible. If a child comment is
 deleted, any grandchildren should remain descendants of the original
 comment.

 I don't think WordPress can delete/trash the entire comment tree because
 that is very unlikely to meet the user's intent when removing a single
 comment. A plugin may wish to do so using the existing `trash_comment` or
 `delete_comment` actions.

 If it's not already the case, then an alert in the admin of the effects of
 deleting a parent comment should be shown to the user.

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


More information about the wp-trac mailing list