User’s total comment count excluding comments on their own posts
I’m not aware of any WordPress functions that do this, so you can try to play with this kind of query (untested): function get_custom_user_comments_count( $uid ){ global $wpdb; $sql = “SELECT COUNT(*) as total FROM {$wpdb->comments} as c JOIN {$wpdb->posts} as p ON p.ID = c.comment_post_ID WHERE c.comment_approved = ‘1’ AND p.post_status=”publish” AND … Read more