wordpress-commentsOne of the good feature of WordPress CMS is “Comments”. Any visitor of your website can share his/her views under comments without even registering. The moderator can then moderate comments, if settings are allowed.

But the main problem which every WordPress website ownder faces is that there are many spammers who uses some scripts / software to automatically post commnets to promote their website. They generally put garbled text in comments text or write positive feedback for their own website, which is of no use to your website productivity.

On the other hand, their webiste address is generally long. And that this their main target. They just want to put their website URL in your WordPress website.

There are many wordpress plugins, which automatically marked such comments as Spam and put them in separate folder or delete them. If you’re using Cloudflare CDN; it also removes Spam comments automatically.

Still, there are some spam comments which manages to bypass all these security and come to your WordPress website.

So, one solution is, we add a small code in functions.php file and it will automatically mark those comments as spam which have long website URL – i.e. more than 30 characters.

If you want to increase / decrease the website lingth check, you can do so in 4th line of code.

READ  How to Remove URL / Website Field from WordPress Comment Form?

Note: I strongly recommned to take backup of your functions.php file before making any changes in that. You can restore the original file in case of any problem. Secondly, do not use WordPress Editor to edit functions.pgp file. Instead, use text editor to edit functions.pgp file and transfer it using FTP client, like CoreFTP.

How to Automatically Spam Comments With a Long URL?
5 (100%) 3 votes
https://zwordpress.com/wp-content/uploads/2016/10/wordpress-comments.jpghttps://zwordpress.com/wp-content/uploads/2016/10/wordpress-comments-150x150.jpgWordPressWordPress TutorialsSpam CommentsOne of the good feature of WordPress CMS is 'Comments'. Any visitor of your website can share his/her views under comments without even registering. The moderator can then moderate comments, if settings are allowed. But the main problem which every WordPress website ownder faces is that there are many spammers...Wordpress Plugins, Themes, Tutorials, Snippets, How-to