Count all comments of a custom post type
How about direct sql with a simple subquery to first get all the post ids of your custom post type ex: function get_all_comments_of_post_type($post_type){ global $wpdb; $cc = $wpdb->get_var(“SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID in ( SELECT ID FROM $wpdb->posts WHERE post_type=”$post_type” AND post_status=”publish”) AND comment_approved = ‘1’ “); return $cc; } Usage: $total_comments = get_all_comments_of_post_type(‘some_post_type’);