Stopping Comment Spam

Posted In Modules - By Geoserv On Tuesday, April 7th, 2009 With 27 Comments

One of the biggest issues with the Pligg CMS is SPAM.  As a Pligg powered website owner you are constantly dealing with submissions of links that are blatent spam, spam bots and spam in the comments.  To be fair, Pligg is not the only CMS that faces this issue, but it does have very little deterents in place to prevent it.

Pligg comment spamI have told you how to prevent auto-submitters or spam bots from submitting to your site by using reCaptcha on step 1 of the submission process.  If you successfully install it, you will see a drastic decrease in spam as bots will no longer be able to submit, which is the source of the most of the spam submissions.

The only other source of spam is via the comments.  This again has been a problem with Pligg since day one and if you search their forums the developers have yet to post a solution to users being able to post links in their comments.

I will show you 2 methods for dealing with comments that contain spam links.

Making comment links nofollow

Open libs/utils.php, find:

function text_to_html($string) {
        return preg_replace(‘/([hf][tps]{2,4}://[^ tnr]+[^ .t,nr()"'])/’, ‘<a href="$1">$1</a>’, $string);
}

change it to:

function text_to_html($string) {
        return preg_replace(‘/([hf][tps]{2,4}://[^ tnr]+[^ .t,nr()"'])/’, ‘<a rel="nofollow" href="$1">$1</a>’, $string);
}

Make links un-clickable:

Open libs/utils.php, find:

function text_to_html($string) {
        return preg_replace(‘/([hf][tps]{2,4}://[^ tnr]+[^ .t,nr()"'])/’, ‘<a href="$1">$1</a>’, $string);
}

change it to:

function text_to_html($string) {
        return preg_replace(‘/([hf][tps]{2,4}://[^ tnr]+[^ .t,nr()"'])/’, ‘$1′, $string);
}

That’s it.  Which method, is up to you.

Which one will you be using?


We provide guaranteed car insurance with online 640-816 training and MB2-631. You can also get best quality a+ certification dumps along with mcpd for your guaranteed success.

Related Search:

  • stop pilgg spam
Tags: , , ,

About - Geoserv has been working with the Pligg CMS for 2+ years.

  • Pingback: Pliggs

  • Pingback: phaoloo

  • Pingback: You are now listed on FAQPAL

  • Pingback: Vote for this article at blogengage.com

  • Pingback: Stopping Comment Spam

  • http://www.bostonmaattorneys.com bostonmaattorneys

    Wow !
    Thanks for sharing the code.Keep up posting the good work :)

  • http://weatherfeeder.com Weather forecast

    I have a website with a section where you can put your name, email and a comment or question that is sent to my email. I got spammed and i am getting an email every minute and don’t know how to stop them.

  • http://www.rtlworld.com julia

    This site is a great place to vent your frustrations about spam and the like. There is also practical advice for avoiding and dealing with spam. The author of the blog is hilarious and observant. Anti-spammers unite! http://www.stop-viagra-spam.com

  • Pingback: Pliggs

  • http://bestdogforme.com dogs mating

    I have a website with a section where you can put your name, email and a comment or question that is sent to my email. I got spammed and i am getting an email every minute and don’t know how to stop them.
    I searched online but what i found is how to stop spam on blog but don’t know how to stop it from website.
    .-= dogs mating´s last blog ..Best pets at low prices =-.

  • Pingback: Adding reCaptcha to comments

  • http://www.gokgunlugu.com uzaysitesi

    Good information.Thank you for shairng:)

  • hiteshthakur034

    yup buddy…great knowledge you have shared with us….really creative and innovative thoughts u have said……… …..well u can visit for info about twitter followers at http://thetwittersecret.com/

  • Pingback: Twitter Followers Making You a Celebrity « Hitesh Thakur

  • stockalerts

    Thanks for providing this important information. I don't know more about coding but from here i got some useful points.

  • http://it.gsr24.com/ sky

    Top Site Leute

    Kann sich sehen lassen
    Benutze gerade Pligg

  • http://it.gsr24.com/ sky

    Top Site Leute

    Kann sich sehen lassen
    Benutze gerade Pligg

  • Wedding Accessories

    Its a real problem, spammer are now using our own contact forms aginst us :-( The good news is that you can actually start to regain some control over what you get in your inbox.

  • http://www.aloveshop.com seks shop

    Its a real problem, spammer are now using our own contact forms aginst us :-( The good news is that you can ctually start to regain some control over what you get in your inbox.

  • http://www.diycarhire.com.au car hire

    Depending upon the amount of comments and control you want over comments on your WordPress site, you may want to moderate all comments on your site.

  • http://carhireshop.com.au/ Car Hire Shop

    It's my personal experience that if you will not stop auto comments submissions, they are going to increase by the time.

  • http://carhireshop.com.au/ Car Hire Shop

    It's my personal experience that if you will not stop auto comments submissions, they are going to increase by the time.

  • http://www.spinxwebdesign.com/ Web Design Los Angeles

    I was really in need of this code. I am sure I will be able to use it correctly.

  • http://www.universebricks.co.uk Lego Star Wars Sets

    reCaptcha is a must for any blog owner. One of the reasons its so good is that most (probably all) auto submitter bots can’t get past it. Spammers don’t currently have an automated way of fooling it, meaning its a manual process for them leading to less spammy comments.

  • http://www.rightwaysolution.com Web Development

    Captcha is good way to stop comment spam.

  • http://www.libertyforexchange.com Liberty Reserve

    That’s Nice Solution. I really love the way you post and helped pligg cms owners.

  • http://www.albenishop.com seks shop

    Thanks for providing this important information ;)