Our Pages

Tuesday, 1 July 2014

How To Automatically Remove Links From Blogger Comment Section

One of the most effective ways of preventing comment spam in your blog is by paying a close attention to the links in your comment section. Spammer have been there right from time and will still be. So it is your duty to fight against spammers intending to use your blog comment section to spoil the reputation of your blog.

In this post, I will you giving you a script that will help you prevent the use of HTML codes that enables the embedding of hyperlinks.

Removing Links From Blogger Comment Section

  • Log in to your blogger dashboard and back up your template.
  • Navigate to Template > Edit HTML
  • Click anyway inside your HTML editor and press Ctrl+F to open the search box.
  • Copy and paste the code below in the search box
</body>
  • Now paste the code below just above the </body>
 <!--comment spam starts-->
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'/>
<script>$(&#39;.comment-content a[rel$=nofollow]&#39;).replaceWith(function(){return ($(this).text());});</script>
<!--comment  spam ends-->
That was all about removing links automatically from blogger comment section, feel free to leave your questions or contributions regarding this tutorial.

    No comments:

    Post a Comment

    We love to hear from you!

    We encourage comments, but please DO NOT SPAM. We do pre-moderate some comments with links.
    THANKS.