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>
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