Skip to content

Instantly share code, notes, and snippets.

@underhilllabs
Created May 22, 2012 22:07
Show Gist options
  • Select an option

  • Save underhilllabs/2771976 to your computer and use it in GitHub Desktop.

Select an option

Save underhilllabs/2771976 to your computer and use it in GitHub Desktop.
Deleting Comment Spam

delete obvious spammy subjects

drush sqlq "delete from comment where subject like '%viagra%'" drush sqlq "delete from comment where subject like '%payday loan%'"

or if you know the last good comment id, ie > 3002 and < 4005

first look at the list

drush sqlq "select name,subject from comment where cid > 3002 and cid < 4005"

next delete the spam

drush sqlq "delete from comment where cid > 3002 and cid < 4005"

If you are unfamiliar with the comment table, you can run desc table from commandline

drush sqlq "desc comment"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment