Skip to content

Instantly share code, notes, and snippets.

@chriscoyier
Forked from norcross/url-spamcheck.php
Created April 26, 2013 17:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chriscoyier/5469005 to your computer and use it in GitHub Desktop.
Save chriscoyier/5469005 to your computer and use it in GitHub Desktop.
<?php
function rkv_url_spamcheck( $approved , $commentdata ) {
$author_url = $commentdata['comment_author_url'];
$author_url_length = strlen($author_url);
if ($author_url_length > 50 )
$approved = 'spam';
return $approved;
}
add_filter( 'pre_comment_approved', 'rkv_url_spamcheck', 99, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment