Skip to content

Instantly share code, notes, and snippets.

@toddlahman
Last active December 21, 2015 11:58
Show Gist options
  • Save toddlahman/6302252 to your computer and use it in GitHub Desktop.
Save toddlahman/6302252 to your computer and use it in GitHub Desktop.
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