Iklan

How to Disable HTML links in the Comments Blog

How to Disable HTML links in the Comments Blog

This article is How to Disable HTML links in comments Blog which aims to be the link that is "spam" in the column of blog comments do not damage the reputation of the blog in the eyes of search engines. As more and more outbound links that are not qualified out of our blog, then it will be bad for our blog later.

Usually the active links in comments abandoned spammers is a form of promotion, backlink search, and so forth. But in essence the way not only to find backlinks, because the backlink itself will come to our blog that is deemed useful.

To disable live links in blog comments, we just need to apply some javascript code, and you can replace the live link in the comment column of your blog with regular letters or in the form of a warning.


Follow the instruction install script to prevent HTML links in blog comments

1. Go to Blogger >> Dashboard >> Templete >> Edit HTML
2. Place the following code before tag </ style>


CSS - Go Widget

.spammer-detected {
    font-size: 14px!important;
    color: #fff!important;
    background: #5cb0d8!important;
    margin: 25px;
    border-radius: 4px;
    display: inline-block;
    padding: 10px 15px!important;
}


3 Then place the following code before tag </ body>


jQuery - Go Widget

<script type='text/javascript'>
//<![CDATA[
$(function(){$('#comments p').find('a').contents().unwrap();});
//]]>
</script>


The following code uses a special message


jQuery - Go Widget

<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> live links is prohibited!!</mark>Spam is not allowed!";
content[i].className = "spammer-detected";
} } }
blockLinks('comment-holder', 'p');
//]]>
</script>

4. Save your template

Thanks ... please share if this article useful to others.

Next
Prev Post
Previous
Next Post
Buka Komentar