Hi, I don't know if it's normal but some users are abusing the replies.. how can I avoid users replying to their own comments?
Limited Support
Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.
We appreciate your patience and understanding while our team is away. Thank you for being part of the wpDiscuz community!
Merry Christmas and Happy Holidays! π
Apr 16, 2025 8:04 am
1 Reply
Apr 17, 2025 8:59 am
Hi,
Use this hook code:Β
add_action("wpdiscuz_before_wp_new_comment", function ($commentdata) {
if (!empty($commentdata["user_id"]) && !empty($commentdata["comment_parent"])) {
$parent_comment = get_comment($commentdata["comment_parent"]);
if ($parent_comment instanceof WP_Comment) {
$parent_comment_user_id = (int)$parent_comment->user_id;
$comment_user_id = (int)$commentdata["user_id"];
if ($parent_comment_user_id === $comment_user_id) {
wp_die(esc_html__("You can not reply to own comment!", "wpdiscuz"));
}
}
}
});
Helpful article: https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/

