dumples
asked 7 years ago

Hello,
I am getting a lot of comment spam on my DWQA question pages. The comments aren’t being held for moderation, and they aren’t being processed through through a spam filter.
Is there an easy to prevent comments from being auto-approved, or a way to add a captcha?

1 Answers
DominicStaff
answered 7 years ago

In your case, you should disable to allow the anonymous submit a comment or you can add the following code to the functions.php file in your theme folder:

add_filter( 'dwqa_insert_comment_args', 'dwqa_theme_moderate_comment' );
function dwqa_theme_moderate_comment( $args ) {
$args['comment_approved'] = 0;
return $args;
}

Then add the following code to the line 232 of the Handle.php in the plugins > dw-question-answer > inc folder.

$args['comment_approved'] = 0;
Powered by DW Question & Answer Pro