Y
Y
Ysery2017-10-14 14:59:11
PHP
Ysery, 2017-10-14 14:59:11

URL item in the WordPress comments form - how not only to hide, but also to disable acceptance if entered?

Good day. I'm using code that hides the URL entry in the WordPress comment form.

add_filter('comment_form_default_fields', 'sheens_unset_url_field');
function sheens_unset_url_field ( $fields ) {
  if ( isset($fields['url'] ))
  unset ( $fields['url'] );
  return $fields;
}

But that doesn't stop spam bots. They send their messages with the entered URL. It is clear that Akismet weeds them out. BUT is it possible to disable the reception of a message that has an inscribed URL? After all, this is 100% spam (ordinary commentators will not be able to enter the URL in any way - the item is missing), which I would very much like to filter out initially and not see spam in the folder. After all, sometimes normal messages get into it, which have to be targeted among this garbage. And if you prohibit the receipt of deliberately spam messages, then the task is simplified.
Maybe there is some hook or filter? Any plugin will be redundant. it will not only have this function, so I did not even look among the plugins.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question