Change Visibility to Private
You were pretty close. You just want to hook in at the right time when the comment is being saved. This is untested but should work. add_action( ‘comment_post’, ‘wpse_make_private_after_3_comments’, 10, 2 ); function wpse_make_private_after_3_comments( $comment_ID, $comment_approved ) { $comment = get_comment( $comment_ID ); $post_ID = $comment->comment_post_ID; $comments = wp_count_comments( $post_ID ); // You could also … Read more