Sunday 13 April 2014

How to disable and remove links in comments in blogger

Disabling the hyperlinks in the comment section in blogger blog is quite essential to avoid spammy links accumulating in the comments. Even the unnatural links in the comment section can affect the SEO ranking of your blog. Hence it is required to remove the links from comment section. If you do this, you do not need to worry much about comment moderation. You can also stop the spammy people spam your blog.

Some people make spammy comments in your blog with unnatural links to their website just to make backlinks and get the page rank from your blog. When your blog grows bigger and bigger, lot of people just enter comments to create spam links.


How To remove links from blogger comments:


1. Go To 'Blogger' and open your blog.

2. Click on 'Template' in the left side bar.

3. Click on 'Edit HTML'.

4. Search for the text '</body>'

5. Copy paste the below code just above it.


<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'/> <script>$('.comment-content a[rel$=nofollow]').replaceWith(function(){return ($(this).text());});</script>

6. Click on 'Save Template' to save the changes. Once the changes are saved, you can test whether the code is working fine and disabling links in blogger comments.

How To Test:


go and check a blog comment which had links previously. The text for the hyperlink will be there. But the link should be non clickable now. 

Even if you publish new comments with links, they will also not have clickable links. 

The above code is a jquery. 

If you want to totally remove the links including text, you should need to use the below code instead of the above code.

<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'/> <script>$('.comment-content a[rel$=nofollow]').hide());</script>

Try this code and let me know whether it works for you.

No comments:

Post a Comment