Simple Comment Editing
Comment Length Restriction (4 posts)

  1. KatieKat
    Posted 2 years ago #

    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



  2. Ronald Huereca
    Plugin Author

    Posted 2 years ago #


    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.

  3. KatieKat
    Posted 2 years ago #

    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;

  4. KatieKat
    Posted 2 years ago #

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


Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.