How Comment Spam Bots Work?
Blogger (service) is a used past times millions of blogs as well as 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 honour blogs as well as postal service spam comments.
Some spam bots are smart plenty to create sum captcha as well as flexible plenty to respond 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 begin method, nosotros volition block bots using b: if condition. Therefore, to ban a user from commenting on your site, yous receive got to honour his Blogger Profile URL as well as using b: if status halt him from accessing comment form. This volition blacklist a specific user's Blogger profile as well as he volition no longer hold upward able to brand or run into whatever comments on your site.
- To honour a user's Blogger Profile URL, acquire to your comment department as well as left click on the names of the comment posters.
- Now listing of options volition hold upward 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> as well as only below it glue the next code:
- Now inwards the higher upward code, replace https://www.blogger.com/profile/XXXXXXXXXX with the Blogger profile URL yous copied earlier. Keep inwards heed this volition ban solely ane user to ban to a greater extent than users yous receive got to glue the higher upward code ane time again inwards your template but amongst dissimilar profile URL.
- Once everything is done, relieve the template. Take a await 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 amongst jQuery:
In the instant method, nosotros volition block bots using jQuery.
- Go to Blogger >> Template >> Edit HTML >> search for the ending </body> tag as well as correct higher upward it glue the next jQuery code:
- Now inwards the higher upward code, supercede https://www.blogger.com/profile/XXX with the Blogger profile URL that yous 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 await 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>
No comments:
Post a Comment