WordPress.org

Support

Support » Plugins and Hacks » How to send comments that are too short to moderation?

How to send comments that are too short to moderation?

  • 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?

Viewing 8 replies - 1 through 8 (of 8 total)
  • No, I don’t think so. You’ll have to activate moderation for all comments. Which you should do anyway to protect against spam.

    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.

    thats a handy plugin Kafkaesqui !!

    Thanks so much Kafkaesqui!!!!

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

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

    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.

    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.

    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. ;)

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to send comments that are too short to moderation?’ is closed to new replies.
Skip to toolbar