How To Block Spam Comment Bots Inwards Blogger

Spam Comments tin drive a existent problem if they are non prevented. To block spam comments, bloggers accept strict actions past times bespeak people to register, acquire into a captcha or response a random query before leaving a comment. However, these spam prevention techniques arrive hard for your daily visitors to comment because re-entering a weird captcha every fourth dimension you lot brand a comment is a existent pain. Majority of Spam comment is made past times bots, which are designed to acquire out spammy comments on blogs together with websites. Today inwards this article, nosotros volition present you lot how to block spam comment bots inwards Blogger.


How Comment Spam Bots Work?

Blogger (service) is a used past times millions of blogs together with websites. Therefore, all these websites uses the same Blogger commenting system unless they are using a third-party commenting system. This means, it makes it a lot easier for spam bots to detect blogs together with postal service spam comments.

Some spam bots are smart plenty to fill upward captcha together with flexible plenty to response dissimilar questions to fool the website's spam prevention system. This means, the best way to tackle spam bots is to completely block them from commenting on your website.


Method#1: Blocking Spam Bots inwards Blogger Using b:if Condition

In the commencement method, nosotros volition block bots using b: if condition. Therefore, to ban a user from commenting on your site, you lot receive got to detect his Blogger Profile URL together with using b: if status halt him from accessing comment form. This volition blacklist a specific user's Blogger profile together with he volition no longer last able to brand or come across whatever comments on your site.
  1. To detect a user's Blogger Profile URL, acquire to your comment department together with left click on the names of the comment posters.

  2. Now listing of options volition last appear, from the listing pick out "Copy link address" equally it is shown inwards the screenshot below:
  3. After copying the profile URL, acquire to Blogger >> Template >> Edit HTML >> Search for </body> together with simply below it glue the next code:

  4. <b:if cond='data:comment.authorUrl!= &quot;https://www.blogger.com/profile/XXXXXXXXXX"' >
    <script>
     $(".comment-form").replaceWith("<p style=" color: #111; text-align: center; border: 1px company #d2d2d2; padding: 13px; font-size: 15px; ">You are Banned from Commenting on this site</p>");
    </script>
    </b:if>

  5. Now inwards the higher upward code, replace https://www.blogger.com/profile/XXXXXXXXXX with the Blogger profile URL you lot copied earlier. Keep inwards heed this volition ban alone 1 user to ban to a greater extent than users you lot receive got to glue the higher upward code 1 time again inwards your template but alongside dissimilar profile URL.

  6. Once everything is done, salve the template. Take a hold back at the screenshot below to the results:

Method#2: Blocking Spam bots inwards Blogger alongside jQuery:

In the minute method, nosotros volition block bots using jQuery.
  1. Go to Blogger >> Template >> Edit HTML >> search for the ending </body> tag together with correct higher upward it glue the next jQuery code:

  2. <script type='text/javascript'>
        //<![CDATA[
        //Block Spam Comment Bots inwards Blogger
        //Black List Blogger Profiles
        var spamlist = [
            'https://www.blogger.com/profile/XXX', //First Ban User
            'https://www.blogger.com/profile/XXX', //Second Ban User
            'https://www.blogger.com/profile/XXX' //Third Ban User
        ];


        for (var v = 0; v < spamlist.length; v = v + 1) {
            $("a[href='" + spamlist[v] + "']").each(function() {
                $(this).closest(".comment-block").find(".comment-actions, .datetime, .comment-replybox-thread, .comment-block")
                    .replaceWith("");
                $(this).closest(".comment-block").find(".comment-content")
                    .replaceWith("<div class='comment-content' style='color:red'>This user's comment has been removed!</div>");
                $(this).replaceWith("<span style='color:red'>BANNED USER!</span>");
            })
        }
        //]]>
    </script>

  3. Now inwards the higher upward code, supplant https://www.blogger.com/profile/XXX with the Blogger profile URL that you lot would similar to ban. You tin ban unlimited users past times adding profile links inwards the higher upward codes.

  4. Once everything is done, press "Save Template". Take a hold back at the screenshot below to the results:
We promise this tutorial has helped you lot inwards learning how to block spam comments bots inwards blogger. Let us know what practise you lot recall close this plugin inwards the comments below.

Comments