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   1793 Views

Avatar
kudesign

Community Member, 64 Posts

25 June 2009 at 6:15pm

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

Community Member, 901 Posts

25 June 2009 at 6:51pm

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

Community Member, 64 Posts

26 June 2009 at 4:54pm

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

Community Member, 64 Posts

2 July 2009 at 10:23pm

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

Forum Moderator, 5513 Posts

3 July 2009 at 5:42pm

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