WordPress - Function to delete comments if url present?

Posted on 2011-10-02
Last Modified: 2012-05-12
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,

Question by:St_Aug_Beach_Bum
    1 Comment
    LVL 70

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Suggested Solutions

    If you are looking for plug-ins to add functions to your WordPress small business web site, take some time to read though this comprehensive list.  These are all the plugins I use for my customers WordPress web sites, as well as my own.  Be sure to …
    I want to start by talking about the use of plug-ins for WordPress. I started a web-site for a company I was working for a few years ago; I had extremely basic knowledge of HTML. I am a Graphic Designer by trade so I invited the opportunity as a cha…
    The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: :…
    The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now