WordPress.org

Ready to get started?Download WordPress

Forums

How to send comments that are too short to moderation? (9 posts)

  1. Chanpory
    Member
    Posted 7 years ago #

    Hi, I'm am getting a lot of comments that are just a one or two words long. How do I automatically send these to moderation? Is there a regular expression I can use as a moderation key?

  2. pizdin_dim
    Member
    Posted 7 years ago #

    No, I don't think so. You'll have to activate moderation for all comments. Which you should do anyway to protect against spam.

  3. Kafkaesqui

    Posted 7 years ago #

    "You'll have to activate moderation for all comments. Which you should do anyway to protect against spam."

    But don't you hate being forced to do stuff computers are supposed to be good at? I certainly do!

    Moderate Brief Comments plugin:
    Download plugin | View source

    Edit the $enough_words variable in the plugin to define the *appropriate* number of words (or more) a comment should have. By default this is set to 3.

  4. red-star
    Member
    Posted 7 years ago #

    thats a handy plugin Kafkaesqui !!

  5. Chanpory
    Member
    Posted 7 years ago #

    Thanks so much Kafkaesqui!!!!

  6. Kafkaesqui: wouldn't an explode() have been better? This will pass your test:

    word1[space][space][space][space]word2

  7. Kafkaesqui

    Posted 7 years ago #

    "This will pass your test:"

    Ah, the power of extra eyes. Thanks, and plugin updated to deal with that.

    "Kafkaesqui: wouldn't an explode() have been better?"

    Define "better." I'll just say I had my reasons for avoiding it here.

  8. Define "better." I'll just say I had my reasons for avoiding it here.

    Heh, alright. :)

    And this will now get caught by your plugin sadly as spam:

    word1[space][space]word2[space][space]word3[space][space]word4[space][space]word5

    Not a big deal though as it won't delete it, it'll just send it to moderation. Anyone who posts like that deserves it anyway, lol.

  9. Kafkaesqui

    Posted 7 years ago #

    Considering we could stumble across a line in more of a condition like:

    word1...word2...word3...word4...word5*

    Perhaps the plugin should be concerned about it. Amazing how a simple solution quickly gets so complicated. Damn human written languages!

    * Yes, I know people who write like that! Not that I would ever let them comment on my blog.

    EDIT: If WordPress would jump requirements up a notch to PHP 4.3 I'd feel fine with just using str_word_count(), then laying the blame on PHP when it didn't work as expected. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags