Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@JustinSainton
Forked from norcross/url-spamcheck.php
Last active February 4, 2016 13:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JustinSainton/5468988 to your computer and use it in GitHub Desktop.
Save JustinSainton/5468988 to your computer and use it in GitHub Desktop.
Marks any comment as spam whose author link is greater than 50 chars.
<?php
function rkv_url_spamcheck( $approved , $commentdata ) {
return ( strlen( $commentdata['comment_author_url'] ) > 50 ) ? 'spam' : $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