Good day, dear gurus.

Yes, the Akismet plugin is good for everyone, it marks spam messages with a bang. But these spam messages accumulate a huge amount, 95% of which contains HTML link (s). And this list should be reviewed, because it can get regular messages from real commentators.

Tell me, please, the code that could be inserted into functions.php , which checks for the html tag in the message being sent, and if it is present, displays a message (wp_die), like: HTML HTML link tag in comments is prohibited. Go back and edit the message.

Actively googled, but did not find a solution, although this is a couple of lines of code maximum ...

    1 answer 1

     $spamArray = ['href', 'img'. 'что еще считаете нужным']; 

    pick up a post request with your textarea, I guess, then

     foreach ($spamArray as $spamVal) { if (strpos($_POST['нужное поле'], $spamVal) > 0 ) { echo 'Ваше сообщение'; break; // или die() } } 

    PS I hope in general, the meaning is clear, I do not pretend to have a complete answer, and the code is sculpted in a commentary