Hello blogger friends, this time we will discuss the hyperlinks that often appear in blogger comments. These hyperlinks are usually spam links that are intentionally sent to get people to click on the link. It's still okay if the link is something useful but if the link isn't something good then we need to prevent that by removing the hyperlink in our blogger comments.
Usually, to change the link, you need the JQuery javascript library, but how do you remove the hyperlink in the blogger's comments without JQuery?
You have to log into your blogger account and edit the theme in html mode, which can be accessed from Themes> three dots> Edit HTML. Now you install the code below just above the code
</body>
.<b:if cond='data:view.isSingleItem'>
<script type='text/javascript'>
document.querySelectorAll(".comment-content a").forEach(function(el){el.removeAttribute("href");el.setAttribute("class","text-danger");el.innerHTML = "Disabled"});
</script>
</b:if>
For part text-danger is the class of the text and Disabled is text that replaces the link, replace the class with the class you want then save the template and see the results.
Hyperlinks contained in comments will be deleted and replaced with the word Disabled.
The javascript code to remove hyperlinks in blogger comments is simple code and doesn't require JQuery, it is highly recommended if you don't need the JQuery library, you know that using the JQuery library makes loading a blog a bit heavy.