Mark comments with very long URLs as SPAM in WordPress

To mark comments with very long URLs as SPAM in WordPress you must have access to the theme  functions.php  file and permission to edit it.

Spammers frequently use links to web pages that have very long URLs. Therefore, if someone publishes a comment on your WordPress site and enters a very long URL in the comment field, there is a high possibility that the comment was published by a spammer.

The snippet below allows you to mark a comment as SPAM if it contains a website URL with over 100 characters. You can increase or decrease this limit to suit your personal needs.

One thought on “Mark comments with very long URLs as SPAM in WordPress”

Leave a Reply

Your email address will not be published. Required fields are marked *