For WordPress websites with good daily visits, there will definitely be a lot of spam comments to be reviewed. If you want to delete them through the WP background, it is simply a very time-consuming and labor-intensive project. Today, we mainly introduce the following two methods to delete spam comments in WordPress. We can execute SQL commands to delete in batches, or delete by enabling the Delete All Pending Comments plug-in.
Method 1: Delete All Pending Commnets plug-in
After searching in the background and installing the Delete All Pending Commnets plug-in, you can click on the left You will see a Pending Comments under the comment menu, go in and check the checkbox, and then click the delete button to delete all comments to be reviewed:
Related recommendations: 《WordPress Tutorial》
Method 2: Delete through SQL command
If you don’t like to mess with plug-ins, and you can manage MySQL by logging in to PhpMyAdmin Database, then you can delete it through SQL commands.
Wordpress comment table is wo_comments, comment_approved is the field of comment response.
Comment_approved is 1: comments passed the review
Comment_approved is 0: comments to be reviewed
Comment_approved is trash: comments in the recycle bin
Comment_approved is spam: Spam comment
The detailed SQL command execution method is as follows. You can change the statement at any time as needed.
1. Delete pending comments, spam comments, and recycle bin comments
delete From ‘wp_comments’ WHERE ‘cooment_approved’ NOT LIKE ‘1’
2. Delete only pending comments
delete From ‘wp_comments’ WHERE ‘cooment_approved’ =‘0’
3 .Only delete spam comments
delete From ‘wp_comments’ WHERE ‘cooment_approved’=’spam’
4.Only delete trash comments
delete From ‘wp_comments’ WHERE ‘cooment_approved’=’trash’
The above is the detailed content of How to delete comments in wordpress. For more information, please follow other related articles on the PHP Chinese website!