Spam the comments If comment Author URL is bigger in Wordpress

comment Author URL is bigger in WordPress

Spam comments are most irritating for bloggers. Reading the all comments and their content and desire. If Comment author URL is bigger then you should consider that comment as Spam comment for sure. Many times I observed, spammer always try to add their site URL in Author URL.

comment Author URL is bigger in WordPress

Using following code you can protect your site from spam commenters. Open your functions.php file from your theme folder and just copy/paste the following code into that.

Following code will automatically mark the comments as spam where author URL is longer than 60 chars.

function wpapi_bigger_url_spamcheck( $approved , $commentdata ) {
return ( strlen( $commentdata['comment_author_url'] ) > 60 ) ? 'spam' : $approved;
}

add_filter( 'pre_comment_approved', 'wpapi_bigger_url_spamcheck', 99, 2 );

Above code is very important for wordpress bloggers. Every wordpress blogger should add the above code into their site.

Spam comments If comment Author URL is bigger in WordPress
Spam comments If comment Author URL is bigger in WordPress

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.