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.
- To detect a user's Blogger Profile URL, acquire to your comment department together with left click on the names of the comment posters.
- Now listing of options volition last appear, from the listing pick out "Copy link address" equally it is shown inwards the screenshot below:
- After copying the profile URL, acquire to Blogger >> Template >> Edit HTML >> Search for </body> together with simply below it glue the next code:
- 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.
- Once everything is done, salve the template. Take a hold back at the screenshot below to the results:
<b:if cond='data:comment.authorUrl!= "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>
Method#2: Blocking Spam bots inwards Blogger alongside jQuery:
In the minute method, nosotros volition block bots using jQuery.
- Go to Blogger >> Template >> Edit HTML >> search for the ending </body> tag together with correct higher upward it glue the next jQuery code:
- 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.
- Once everything is done, press "Save Template". Take a hold back at the screenshot below to the results:
<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>
Comments