spam links

How To Automatically Hide Spam Links In Blogger Comments

auto-remove-spam-comments-blogger

Comment spam is a major issue for all bloggers. We all love comments and they can be the life blood of a blog but spam can be hard to control. Even comments that look OK can contain spam links, especially on Blogger were when moderating comments you can not see if any of the text is a link. So in this post I have two ways to ensure your the comments on your blog will not contain spam links. Not only will it remove the links from any future comments but it will also remove all links from past comments.

We have two options :

CSS – First a small piece of CSS that will completely remove links left in comments.With the CSS the anchor text that make the link (the clickable words) will be completely removed the rest of the comment will remain.

jQuery Second we have a small piece of jQuery script that will leave the anchor text that make the link (the clickable words) but they will no longer be a link or clickable.

Cool Ehh ? I had used the CSS for some time (Yes spammers ye have been wasting your time) but have now switched to the jQuery. Check out the video tutorial to see more on how each works then It’s your choice on how you want to go. The codes needed are below the video.

Use CSS To Completely Remove Links And Anchor Text

Step 1. – In Your (New Design) Blogger Dashboard Click The Drop Down Menu For Your Blog > Choose Customize > Advanced > Add Css, as shown in the video below.

Step 2. Copy and Paste the following code into the Css Section then click Apply To Blog.

.comment-content a {
display: none;
}

Use jQuery To Remove Links But Leave The Anchor Text

Step 1. In Your (New Design) Blogger Dashboard Click The Drop Down Menu For Your Blog > Choose Template > Then Edit Html > Now Proceed as shown in the video Below :

Step 2. Find the following piece of code in your blogs Html : (Click Ctrl and F for a search bar to help find the code – How To Find Code In Blogger Template Template)

</body>

Step 3. Now Copy And Paste This Code Directly Above / Before </body>

Note – The line in yellow is the main jQuery script if you previously added this to your blog do not add it.

<!--Stop Blog Comments http://www.spiceupyourblog.com -->
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script>
$('.comment-content a[rel$=nofollow]').replaceWith(function(){return ($(this).text());});
</script>
<!--Stop Blog Comments http://www.spiceupyourblog.com -->

And that’s your lot, no more sleepless nights worrying if people have left dodgey links on your blog.

Drop your comments and questions below.

author-paul-crowe

Author – Paul Crowe is the owner and main author of Spice Up Your Blog. Paul lives in Ireland, has been blogging since 2006 and writing Spice Up Your Blog since 2009.You can find him in the usual social networks.


What My Robot Recommends:

How To Automatically Hide Spam Links In Blogger Comments
Informative
88
Useful
83
Easy To Read
85
Fact
86
Reader Rating0 Votes
0
86