How To Automatically Hide Spam Links In Blogger Comments

Spam Comments Computer Keyboard Stock Image

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.

Video Tutorial

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)


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 –>
<script src=”” type=”text/javascript”></script>
$(‘.comment-content a[rel$=nofollow]’).replaceWith(function(){return ($(this).text());});
<!–Stop Blog Comments –>

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.

AuthorAuthor – 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.


  1. This is great and the video makes it so easy my new favorite website!!


  2. Thank you for this easy tutorial, spam comments have become a real problem for me recently.


  3. Benta AtSLIKstitchesMarch 7, 2014 at 10:10 PM

    Hi Paul, I’m fairly sure there is a dodgy link on my blog (when I view it on my phone I get taken to an app advert) but when I search for
    smaller than / slash / body /greater than
    it cant find it?


  4. this is a great post.spammer very disturb me.thanks


  5. thanks for tutorial.,, spammer really disturb.


  6. Ahmad Khoirul AzmiMarch 23, 2014 at 11:28 AM

    Hi, Paul. I know and am sure that links hidden using CSS can only be applied to human eyes, but not Google. What about the second method, does google reads links hidden using jquery? Thanks 🙂


  7. That is useful for me actually, thank now I can avoid the blogger spam using the css that you share


  8. kampungjasa InckuMay 15, 2014 at 6:44 AM

    i like it this thank you ^^ no spam again in my blog