How to Block the Spammer Commentator in Blogger
Lets Start!
Goto Blogger Dashboard => Template => Edit Html
Find the </body> Tag.
and Paste this code Above it.(Above "here"</body>)..
<script type='text/javascript'>
//<![CDATA[
var spamlist=[
'http://www.blogger.com/profile/12345678', /* Spammer's Profile Url */
'http://nameblog.blogspot.com/', /* Spammer's Blog Url */
'Address URL commentator to-3' / * don't add url after last comma * /
];
for(var v=0; v<spamlist.length; v=v+1){
$("a[href='"+spamlist[v]+"']").each(function(){
$(this).closest(".comment-block").find(".comment-content")
.replaceWith("<div class='comment-content' style='color:red'>you have been banned! Please Leave this Blog!</div>"),
$(this).replaceWith("<span style='color:red'>BANNED USER!</span>");
})
}
//]]>
</script>
- Replace http://www.blogger.com/profile/12345678 with spammer user's profile link
- Replace http://namablog.blogspot.com with Spammer user's Blog/Site.
If You are using Threaded Comment then add this Javascript code before <body> Tag.
<script type='text/javascript'>
//<![CDATA[
var spamlist=[
'http://www.blogger.com/profile/12345678', /* Spammer's Profile Url */
'http://namablog.blogspot.com/', /* Spammer's Blog Url */
'Address URL commentator to-3' / * don't add url after last comma * /
];
for(var v=0; v<spamlist.length; v=v+1){
$("a[href='"+spamlist[v]+"']").each(function(){
$(this).closest(".comment_inner").find(".comment_body")
.replaceWith("<div class='.comment_body' style='color:red'>you have been banned! Please Leave this Blog!</div>"),
$(this).replaceWith("<span style='color:red'>BANNED USER!</span>");
})
}
//]]>
</script>
No comments:
Post a Comment