Skip to content

Instantly share code, notes, and snippets.

@epicmonkeez
Created August 31, 2013 11:43
Show Gist options
  • Save epicmonkeez/6397738 to your computer and use it in GitHub Desktop.
Save epicmonkeez/6397738 to your computer and use it in GitHub Desktop.
Automatically mark as spam comments with a super long url.
<?php
function em_url_spamcheck( $approved , $commentdata ) {
return ( strlen( $commentdata['comment_author_url'] ) > 50 ) ? 'spam' : $approved;
}
add_filter( 'pre_comment_approved', 'em_url_spamcheck', 99, 2 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment