How can I limit the number of comments per registered user per day?

You could pull all of the comments by current user and loop over them to see how may where today or you can create a custom sql Query to select just the count of comments for the last 24 hours, something like this:

global $wpdb,$current_user;
$sql = $wpdb->prepare("
    SELECT count(*)
    FROM wp_comments 
    WHERE comment_author="%s"
    AND comment_date >= DATE_SUB(NOW(),INTERVAL 1 DAY);"
    ,$current_user);
$count = $wpdb->get_results($sql);

Leave a Comment