WordPress.org

Ready to get started?Download WordPress

Forums

posting the same comment (7 posts)

  1. gramercy
    Member
    Posted 6 years ago #

    when the
    - same user or
    - same visitor & e-mail

    sends the
    - exact same comment or
    - even just similar content in the comment field (particularly with special characters)

    the system gives an error
    "You've said that before. No need to repeat yourself"

    maybe im dumber than a doorknob, but i didn't find the problem or the solution anywhere, even though im guessing this is a frequent problem

    any solution, anyone? thx!!!

  2. gramercy
    Member
    Posted 6 years ago #

    a similar error on a different blog
    "Duplicate comment detected; it looks as though you've already said that!"

  3. whooami
    Member
    Posted 6 years ago #

    "You've said that before. No need to repeat yourself" is not a WordPress message. Thats a plugin spitting that out. So, if you see it, look at your plugins.


    "Duplicate comment detected; it looks as though you've already said that!"
    IS a wordpress message. If you want to tweek that crack open comment.php and look for the function wp_allow_comment($commentdata)

    within that function, you will find:

    // Simple duplicate check
    	$dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND ( comment_author = '$comment_author' ";
    	if ( $comment_author_email )
    		$dupe .= "OR comment_author_email = '$comment_author_email' ";
    	$dupe .= ") AND comment_content = '$comment_content' LIMIT 1";
    	if ( $wpdb->get_var($dupe) )
    		wp_die( __('Duplicate comment detected; it looks as though you\'ve already said that!') );
  4. gramercy
    Member
    Posted 6 years ago #

    ok, so just out of curiosity, if i delete/disable that 'duplicate check' bit in comment.php, will that solve it without screwing up other stuff in WP?

    thx!

  5. gramercy
    Member
    Posted 6 years ago #

    also, is there a particular reason for this? i mean other than a lame way of stopping spam?

  6. whooami
    Member
    Posted 6 years ago #

    I dont have a clue about either of your questions. Why not just do it and see.

  7. damienk
    Member
    Posted 5 years ago #

    I was having the same problem, and for anyone still wondering, here's how you fix it:

    In the "wp-includes" folder, locate the file "comment.php" and open this with a text editor. (ie: Notepad or TextEdit) Do a quick find (Edit > Find) for the word duplicate and you'll arrive at these lines of code.

    // Simple duplicate check
    	 expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content)
    	$dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND ( comment_author = '$comment_author' ";
    	if ( $comment_author_email )
    		$dupe .= "OR comment_author_email = '$comment_author_email' ";
    	$dupe .= ") AND comment_content = '$comment_content' LIMIT 1";
    	if ( $wpdb->get_var($dupe) )
    		wp_die( __('Duplicate comment detected; it looks as though you\'ve already said that!') );

    You can delete this code completely or mark it as comments with two forward slashes at the beginning of each line //

    Delete it if you never want to see it again, and comment it if you wish to keep it for a later use.

    Once complete, save it and upload it to the appropriate location on your web server.

    Ta da! Go post the same comment twice, no one cares any more.

    Please note that future upgrades to WordPress may very well overwrite your comments.php that you just edited, and you may need to do this again.

Topic Closed

This topic has been closed to new replies.

About this Topic