Skip to content

Instantly share code, notes, and snippets.

@s9011514
Last active May 10, 2016 08:38
Show Gist options
  • Save s9011514/017d550a387072f78736ae51de665286 to your computer and use it in GitHub Desktop.
Save s9011514/017d550a387072f78736ae51de665286 to your computer and use it in GitHub Desktop.
批次刪除WordPress垃圾留言
/* 批次刪除不存在的迴響之meta值 */
DELETE FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM wp_comments);
/* 請將 188.143.232.32 換成您要過濾的IP */
DELETE FROM wp_comments WHERE comment_author_IP = '188.143.232.32';
/* 刪除所有歸類為 spam 的留言 */
DELETE from wp_comments WHERE comment_approved = 'spam'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment