Support  :: 
delete ALL comments from anonymous users
 Top

  • i'm fed up with this cranky spam i get on my site, and now i set it that people have to register before giving comments to newsposts.


    but, this leaves me with like 2000 spammessages in my comments... is there any fast-way to delete all comments done by anonymous (not logged in) users ?

    cuz it's way too much work to go and delete 7-15 spammessages for every newspost
  • This is exactly what a database allows you do to.... Assuming your familiar with the basics of SQL ( the query language used by most database including mysql) - if not google for 'SQL tutorial'.

    The SQL will be something along the lines of

    DELETE * FROM nuke_comments WHERE pn_name = '<some username="username">'.

    For ease of working with mysql use phpmyadin from your hosting control panel. Also check that the pn_name field is the correct field (i'm doing this from memory). Also importantly since your learning SQL BACKUP your DB first...

    -Mark</some>
  • Additional note:

    Once .760 becomes available a new release of the EZComments module will enter testing (it will require .760). This has a number of spam prevention features that will help you have anonymous commenting on again.

    -Mark
  • markwest

    This is exactly what a database allows you do to.... Assuming your familiar with the basics of SQL ( the query language used by most database including mysql) - if not google for 'SQL tutorial'.

    The SQL will be something along the lines of

    DELETE * FROM nuke_comments WHERE pn_name = '<some username="username">'.
    </some>


    i have phpMyAdmin on the backend of my hosting...

    i know how to enter commands (but i just don't know them)

    but, if i enter

    Code

    DELETE * FROM nuke_comments WHERE pn_name ='Anonymous'


    it would do the trick you say??
  • At the end of the day your at the mercy of your own experience. I've guessed at the SQL. However since you can backup your own database then nothing can go wrong - simply restore the DB if the SQL doesn't work. Saying that your SQL looks ok to me.

    -Mark
  • ok, i'll try then :)
  • it won't work ...

    as i just noticed while browsing my SQL tables, all the 'anonymous' posts just have nothing in the pn_name field ...

    so i tried this one:
    DELETE * FROM nuke_comments WHERE pn_name =' '

    but i get errormsg's all around like this:

    MySQL retourneerde: Documentatie
    #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM nuke_comments WHERE pn_name=' '' at line 1

    i also tried just with '' and "" and just plain nothing ... how do i get rid of these ???

    plz help and thanks!
  • this one did the trick:

    Code

    DELETE FROM `nuke_comments` WHERE `pn_name` = ''
  • Take out the * so the SQL reads

    DELETE FROM nuke_comments WHERE pn_name =' '

    -Mark
  • If you want to test such delete quieries, a nice method is to do a SELECT instead of DELETE. You can see what records the query will find without deleting them. It's kind of like commenting out a line of code before you delete it. Kinda.

    Frank

    --
    Serious hosting - all the features, bandwith and storage you could want without breaking the bank at DreamHost.com


    See what I do with PostNuke - http://surreal-dreams.com
  • nice info frank!
This list is based on the users active over the last 60 minutes.