SQL queries for wordpress comments
Delete unapproved comments:
DELETE FROM wpcomments WHERE commentapproved = 0
Disable comments on old posts:
UPDATE wpposts SET commentstatus = 'closed' WHERE postdate < '2016-03-11' AND poststatus = 'publish';
Delete pingbacks
DELETE FROM wpcomments WHERE commenttype = 'pingback';
Delete comments from specific URL
DELETE from wpcomments WHERE commentauthorurl LIKE "%nastyspamurl%" AND wpcomments.comment_approved = 'spam';
Written by tonyxrandall
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Sql
Authors
Related Tags
#sql
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#