Easy way to get rid of on WordPress Spam Comment without any plugins

There are lots of plugins to prevent spam comment on WordPress but We can prevent comment spamming without any plugins.

Typically spamming tools target a site / WordPress comment field without any target, even if the server-side comments and comments fields for protection in the field understand that the bot can send data to fill.

We’ll use JavaScript for spam proof form field. Let’s go to the code.

At first, we add the code below at WordPress  Theme’s JavaScript file.

Now, add the code below in functions.php

It is very simple, If anyone disable javascript, then its shows error and form can’t be submitted.

This article originally wrote by Emran Ahmed on wpcookbook.net in Bengali. I just trying to translate into English. Sorry for my poor English. 🙂

 

Leave a Reply