Support » Plugin: Simple Comment Editing » Comment Length Restriction

  • Hi,
    this is a brilliant plugin and very worthy of my 5 star review.

    Hope this is a simple query.

    I have a minimum comment length of 50 characters in my functions.php file but have noticed that when editing a comment it is not picking up the restriction and the user is able to edit a comment to less than 50 characters. Is there any way of forcing a user to make a comment of more than 50 characters when editing a comment.

    Kind Regards


Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ronald Huereca



    Thank you for the wonderful plugin compliment.

    Unfortunately there isn’t currently a way in the plugin to make the 50 characters a requirement. I’ll consider adding some filters that can have custom error messages so additional checks can be placed on Ajax-submitted comments.

    For now, I’m considering this a feature request.

    Thanks again so much for the rating and kind words.

    Hi Ronald,
    not sure if this helps but I am using this at the moment to control the comment length obviously without the edit but do not have enough technical experience to understand how to implement with your plugin.

    add_filter( ‘preprocess_comment’, ‘minimal_comment_length’ );

    function minimal_comment_length( $commentdata ) {
    $minimalCommentLength = 50;

    if ( strlen( trim( $commentdata[‘comment_content’] ) ) < $minimalCommentLength )
    wp_die( ‘All comments must be at least ‘ . $minimalCommentLength . ‘ characters long.’ );
    return $commentdata;

    Please note this is not my own code but has come from the website below.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Comment Length Restriction’ is closed to new replies.