Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
749 views
in Q2A Core by
Hello everyone,

İ have a big issue. there are Many spam comment on the every question. There are 100-1000 spam comment every question. I blocked comment anonymously but i must remove that spam. remove them one by one is impossible. How to quickly remove. I have a 9 page question and many many spam comments.

Thank you

1 Answer

0 votes
by

I think that there is no magic one single step action to solve this, and this mainly because not all the comments are spam. So you cannot blindly erase comments in one sigle step.

What I would do is the following:

1/ First backup your database as is.

2/ Next: use Phpmyadmin and issue the following SQL line:

SELECT postid, title, content FROM `qa_posts` WHERE `type`= "C"

You will then have all comments appearing and easily see their title and content. That's where "human attention" needs to start: you need to check on your own the spams against the valid comments (which should be easy from their title and content field)

Below is the quick and dirty way of deleting spams, but please read the whole post before anything

3/ Select all spams in the first column, then at the bottom of the table "With selected:"  => Delete

However, there might be a safer/smarter way: instead of directly delete from within PhpMyadmin, you may instead of step 3

4/ Select all spams in the first column, then at the bottom of the table "With selected:"  => Export

5/ Select "Php Array" as the format to be exported.

6/ Write a small script that fetch the array that was exported (that is the array of comments considered as spams), and that call the qa_post_delete($postid)function (see there for the function http://www.question2answer.org/functions.php) for each postid that appears in the array.

Calling that function is safer in my opinion since it will handle internal special "cleaning" process (if any) required at time of deleting each spam comment.

Please note that I am not responsible for any loss of data whasoever, just giving out my advice about how I would tackle this kind of problem.

And remenber to first do a backup of your database before diging into any kind of bulk deletion.

Hope this helps.

Welcome to the Q&A site for Question2Answer.

If you have a question about Q2A, please ask here, in English.

To report a bug, please create a new issue on Github or ask a question here with the bug tag.

If you just want to try Q2A, please use the demo site.

Categories

...