(Original) method for deleting spam comments in batches using SQL statements in WordPress

Source: Internet
Author: User
PS: I have only logged on to the background of my blog in the past half a month. Each time I found thousands of spam ads and comments, I have been using the Akismet plug-in for Intelligent identification. It worked very well before and has basically failed recently, most spam comments are not identified. By default, only 20 records can be deleted at a time in the background. Thousands of records can be deleted at a time. You can only use SQL statements to operate the database.

PS: I have only logged on to the background of my blog in the past half a month. Each time I found thousands of spam ads and comments, I have been using the Akismet plug-in for Intelligent identification. It worked very well before and has basically failed recently, most spam comments are not identified. By default, only 20 records can be deleted at a time in the background. Thousands of records can be deleted at a time. You can only use SQL statements to operate the database.

PS: I have only logged on to the background of my blog in the past half a month. Each time I found thousands of spam ads and comments, I have been using the Akismet plug-in for Intelligent identification. It worked very well before and has basically failed recently, most spam comments are not identified. By default, only 20 logs can be deleted at a time in the background. If you want to delete thousands of logs at a time, you can only use SQL statements to operate the database. The method is as follows: 1. log on to the mysql database using the MySQL-uroot-p command in the terminal and use ha97. Switch to the database where the blog is located and run the following SQL statement: delete from wp_comments WHERE comment_approved = '0'; Note: wp_comments is the name of the data table WHERE the comment is located. If your table is renamed, change it to your table name. This statement can delete all comments to be reviewed outside of the review. The following are several SQL statements used to DELETE a specific comment: DELETE all comments FROM a URL address: DELETE FROM wp_comments WHERE comment_author_url LIKE '% www.abc.com %'; DELETE all comments in a mailbox: delete from wp_comments WHERE comment_author_email = 'abc @ abc.com '; DELETE all comments of a nickname: delete from wp_comments WHERE comment_author = 'abc ';

Original article address: (original) WordPress deletes spam comments in batches using SQL statements. Thank you for sharing it with the original author.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.