New to Drupal, and just noticed that some spammers managed to get accounts on my website, and posted thousands of spam nodes (in no time) !! How can I remove them *all*? There's thousands of them.. Could I somewhow issue a query that filters by "user name" and deletes all nodes that were not posted by me?

Thanks in advance.
Andy

Comments

jaak’s picture

http://drupal.org/project/user_delete

Allows administrators (and/or priviledged users for their own account) to
*block a user
*block a user and unpublish all submitted content, including nodes and comments
*delete a user and reassign the submitted content to the anonymous user
*delete a user and delete all submitted content including nodes and comments

drupal_rocks’s picture

Well to make things more interesting, the spammers have been able to create hundreds of accounts, and have posted using those accounts...

Wolfflow’s picture

Quick step in:
Put your Site Offline.
You should delete all the spammers accounts and than build a "admin/user/rules" rule blocking his/her IP,
you sure will see that IP number in your admin/reports/dblog entries.

Enhance your Registration rules with some captcha routine.

Regards

Contact me for drupal projects in English, German, Italian, Drupal Hosting Support.

drupal_rocks’s picture

Well but again, there are literally hundreds of accounts that have been created. I will have to go page by page to delete every single one of them...

Druid’s picture

I will have to go page by page to delete every single one of them...

Yes you will. The only alternative would be to wipe the site and start over, which would kill off your legitimate members and all their posts. Now that you know that spammers are attracted to your site, you know that you need to take measures to make it difficult for bots to register (e.g., CAPTCHA), and you need to monitor things more closely.

If there isn't a "report to Moderator" button available for forum pages, one sure is needed! Further improvements would be to hide (not delete) a post once there are several "reports" submitted, and notify a moderator to review it; as well as to monitor post contents upon submission (looking for SHOUTING, spam words, etc.) and automatically reject or hide/report these posts until reviewed. I discuss a proposal for this in node 834086.

drupal_rocks’s picture

Hmm I think it will be OK to delete every single user (other than me, the root user) since I am just starting out - nobody has posted anything yet :) So how can I do this?

Yes, you are definitely right. This has been a lesson for me, but I am very glad that this happened early in the game.

Thanks.
Andy

Wolfflow’s picture

Another suggestion after you have solved/deleted the spams and the spam-user-accounts is to tryout this module:

Administer User by Role

you may create a role for base user that register and having assigned a special role for them, after you have check the genuine member
you move/assign to another user-role.

Contact me for drupal projects in English, German, Italian, Drupal Hosting Support.

MikeMP’s picture

You COULD write a manual SQL query that could delete all nodes that were created within a certain timespan, or within a certain range of nodeids (they should be sequential from the first piece of spam to the last, I assume).

SQL Between Syntax:
SELECT column_name(s)
FROM table_name
WHERE column_name
BETWEEN value1 AND value2

DELETE FROM node WHERE nid BETWEEN firstnodeidofspam AND lastnodeidofspam

of course, any delete from is scary hah. make sure you do a backup of your database before toying with it manually!

(im not 100% sure if there are other tables that are affected by the posting of these spam nodes, you might want to look into that too).

Good luck!

narayanis’s picture

you could try the Views Bulk Operations (VBO) or Bulk Delete modules as a quick front-end solution.