wp_delete_comment


wp_delete_comment ( $comment_id, $force_delete = false )

Parameters:
  • (int|WP_Comment) comment_id Comment ID or WP_Comment object.
  • (bool) force_delete Whether to bypass Trash and force deletion. Default false.
Returns:
  • (bool) True on success, false on failure.
Defined at:

Description

Trashes or deletes a comment.The comment is moved to Trash instead of permanently deleted unless Trash is disabled, item is already in the Trash, or $force_delete is true. The post comment count will be updated if the comment was approved and has a post ID available.

Related Functions

wp_ajax_delete_comment, wp_filter_comment, wp_update_comment, wp_delete_attachment, wp_list_comments

Top Google Results

User discussions

wpseek mobile