WordPress - Function to delete comments if url present?

I have my wordpress comments section set up so that there is no input box for the commenter's website.

So I know, for sure, that if there is a value for 'url' in a comment - it's spam, some bot or something.

Is there a way to add something (to functions.php perhaps?) that will delete or otherwise ignore comments if they contain a value for 'url'?

I realize this will not get rid of someone putting a url in the main body of the comment. That's ok. I just know it's a bot though if there is a url value, so those can be gotten rid of without any human review.

Thanks for any thoughts on how to do this,

Who is Participating?
Jason C. LevineNo oneCommented:
Go to Settings | Discussion and look for comment moderation.  There, you just set WordPress to hold a comment in the queue if it has one or more links.

It would be better to use Akismet, which is far more effective than doing what are trying to do.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.