Disable Spam Link Comments In Blogger

How to remove spam comment in blogger-A harmful spam link can destroy your seo ranking to search engine so be careful, to make your personal blog protected you need to do that. You must take care of your blog from spammer.
You should follow on increasing your ranking and go a head so to keep protected from spammer you need it let's see how to do that.
How to stop spam comment in blogger:
At first you can use moderation system when a spammer comment with unnecessary link on your blog when use to moderate it you need to do it manually from your dashboard or in the post if you logged in, or second option is to hide links. so let's see in this post how to hide spammer links automatically with coding.

Disable spam comment in blogger

Step 1: At first go to your blogger dashboard then go Template > Edit HTML now search for </style>
Step2: Now copy the bellow code and paste it before this </style> tag
.spammer-detected { font-size: 14px!important; color: #fff!important; background: #5cb0d8!important; margin: 25px; border-radius: 4px; display: inline-block; padding: 10px 15px!important; }
Step 3: Now copy the bellow code and paste it before </body> tag
<script type='text/javascript'> //<![CDATA[ function blockLinks(parentID, children) { var parent = document.getElementById(parentID), content = parent.getElementsByTagName(children); for (var i = 0; i < content.length; i++) { if (content[i].innerHTML.indexOf('</a>') !== -1) { content[i].innerHTML = "<mark>You are going to make spam</mark> Spam is not allowed!"; content[i].className = "spammer-detected"; } } } blockLinks('comment-holder', 'p'); //]]> </script>
Now save your template you finally done it. You can ask me anything in  Facebook

0 Comments