diff --git a/wp-includes/comment-functions.php b/wp-includes/comment-functions.php index 5f52018c86..3bafa8ce88 100644 --- a/wp-includes/comment-functions.php +++ b/wp-includes/comment-functions.php @@ -201,7 +201,7 @@ function wp_delete_comment($comment_id) { return false; $post_id = $comment->comment_post_ID; - if ( $post_id ) + if ( $post_id && $comment->comment_approved == 1 ) $wpdb->query( "UPDATE $wpdb->posts SET comment_count = comment_count - 1 WHERE ID = '$post_id'" ); do_action('wp_set_comment_status', $comment_id, 'delete');