• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 157
  • Last Modified:

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,

Chris
0
St_Aug_Beach_Bum
Asked:
St_Aug_Beach_Bum
1 Solution
 
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.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now