Jump to:

23379 Posts in 18298 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » How to I bulk delete comments?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1731 Views
  • kudesign
    Avatar
    Community Member
    64 Posts

    How to I bulk delete comments? Link to this post

    I have used SS for a client, now realizing he has 5000 spam messages on one of the pages that allowed comment posting.

    Can anyone tell me how I can bulk delete all 5000 spam comments in one go? the admin "comment" tab can only allow me to check and delete 15 comments at a time, deleting 5000 spam comments can take all day.

    Any tip will be much appreciated!!

    Cheers

  • banal
    Avatar
    Community Member
    901 Posts

    Re: How to I bulk delete comments? Link to this post

    Ouch that sucks. Did you install some sort of anti-spam protection (mollom)?
    I'd simply delete the entries from the database. Something like:

    DELETE FROM PageComment WHERE ParentID = <YourPageID>

    If the comments have been marked as spam, do:

    DELETE FROM PageComment WHERE IsSpam = 1 AND ParentID = <YourPageID>

  • kudesign
    Avatar
    Community Member
    64 Posts

    Re: How to I bulk delete comments? Link to this post

    Cool, thanks for the support! I now have included a Math question in the comment posting:

    MathSpamProtection::setEnabled();

    Hope this will be sufficient for now. Cheers!!

    I am now trying to figure out how to include the math question on the user defined forms, any tip?

    Much appreciated!!

  • kudesign
    Avatar
    Community Member
    64 Posts

    Re: How to I bulk delete comments? Link to this post

    Hi there, I thought knew how to do the:

    DELETE FROM PageComment WHERE ParentID = <PageID>

    I have logged in to mySQL and don't know how I can execute this line, could you please briefly run me thru this?

    Thanks!!!

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: How to I bulk delete comments? Link to this post

    don't know how I can execute this line

    If you are using phpMyAdmin then select the database on the left, then click the SQL tab and enter the command

    1731 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.