Skip to content

Instantly share code, notes, and snippets.

@toddlahman
Last active December 21, 2015 11:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Wordpress Delete All Spam Comments
/* This SQL statement will remove all the unapproved comments at once: */
DELETE FROM wp_comments WHERE comment_approved = '0';
/* This SQL statement will remove all the spam comments at once: */
DELETE FROM wp_comments WHERE comment_approved = 'spam';
/* This SQL statement will remove all pingbacks and trackbacks: */
DELETE FROM wp_comments WHERE comment_type = 'trackback';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment