Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

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

How to I bulk delete comments?


Reply

5 Posts   1768 Views

Avatar
kudesign

25 June 2009 at 6:15pm Community Member, 64 Posts

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

Avatar
banal

25 June 2009 at 6:51pm Community Member, 901 Posts

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>

Avatar
kudesign

26 June 2009 at 4:54pm Community Member, 64 Posts

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!!

Avatar
kudesign

2 July 2009 at 10:23pm Community Member, 64 Posts

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!!!

Avatar
Willr

3 July 2009 at 5:42pm Forum Moderator, 5511 Posts

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