Tag Spamming

Is there a way to limit the number of tags (or the length of the tag input) so that I can prevent tag spamming?

I don't mind users adding up to about a dozen tags, but some are adding four or five lines of tags and I have to manually edit them down.

Is there a place in the code to reduce the length of the input "string"?

  • @ BucksandBrains, You can use the CSS to limit the amount of word that your tag input can allow. Once a user exceeds the limit, the rest of the words are chopped off and if they are human, they will realize that their typing curser has stopped working and then they will have to figure-out what to leave or what to delete before hitting save or submit form button on your site.

  • Okay, but is editing the CSS directly considered bad form? Is there a more elegant (and configurable) way to do it so that it shows up as an Admin setting?

  • You should use a custom plugin... do not edit the core file...


    your_new_plugin/views/default/ your_new_plugin / your_new_form.php
    Your new plugin should be palaced at the bottom of your Plugin list.
    take the plugin forms that you want to limit the tags input fields ,  copy the files and paste them in the default file , and then edit the forms for example:
     in your file:   your_new_form.php
    lets edit one input in your form e.g your full name with 50 letters maximum e.g

    <div class='container'>
        <label for='name' >Your Full Name*: </label><br/>
        <input type='text' name='name' id='name' value='<?php echo $formproc->SafeDisplay('name') ?>' maxlength="50" /><br/>
        <span id='_name_errorloc' class='error'></span>
    </div>

  • BucksandBrains , or you can modify the input type to not allow autocomplete terms for the spammers... and any thing above 50 words will be deleted if the form is saved... And this is how you customize Elgg and when you upgrade, you can edit the files in your_new_plugin accordigly... No pain no hussle...

    <input type="text" name="CSS_class" autocomplete="off" size="12" maxlength="8" />

  • These are helpful posts that show me a few ways to approach a problem, since length may be an issue in other areas of the software besides tags. Thank you.