Last updated on March 26, 2017
Suffered a spam attack on your Drupal site? You are in good company. Even with Mollom installed, your site can be overrun faster than a dog with fleas.
To get rid of the thousands and thousands of spam comments, you have two choices.
Either, delete the comments from your MySQL database
To delete spam directly at your MySQL database, you will have to log in to your hosting service. Then use phpAdmin to find the right table. And truncate the table to clear out all the comments.
I haven’t tried this but proceed logically and it should work.
Or, delete comments from your front end using a View
- Install two modules: Entity API and Views Bulk Operations
- Clear your cache
- Make a new View at Structure/Views/ and use Comments as your content
- Leave the format as Unformatted and set the number of comments as 500 — check the pager
- Continue & Edit
- Change Content to Fields
- Add a Field for Bulk Operations: Comment and set the value as Delete
- Remove the filters unless you want them
- Go to the View (e.g., http:/yourwebsite.name/spam-control or whatever you called your view)
- Start deleting
You need two clicks at the top and you must confirm the list. It takes a little time and it is probably quicker to delete the table but this was more satisfying and can remain in the background to clean up smaller spam attacks in future.