Easy Ways to Remove Active Links in Blogger Comments - Blogxhtml
News Update
Loading...

Tuesday, 29 September 2020

Easy Ways to Remove Active Links in Blogger Comments



 In the world of bloggers, inserting an active link is a less effective way to get free backlinks. Most of them do it in order to plant a backlink for their blog. If in the future the active link is dead and can no longer be accessed, alias changes to a broken link, it will be bad for the health of your blog.

Well, on this occasion I will provide a tutorial on how to Easily Remove Active Links in Blogger Comments, instead of your blog being one of the targets of Spammers who spread active links in comments, start preventing now.


Easy Ways to Remove Active Links in Blogger Comments


We use 2 Methods to remove an active link in a comment:
  1. Deactivates the link to plain text.
  2. Delete the entire comment and replace it.

In the following, we will explain one by one, as follows:

1. Deactivating links to plain text.

Every active link that is inserted will be turned off automatically, it will become plain text without changing the entire text.

There are 2 types of script code that you can try on your blog, namely JavaScript and jQuery . Please choose one of them below.

Please go to menu THEMES > Edit HTML > Enter the code below just ABOVE the code </ body>
1.1 JavaScript

<script> //<![CDATA[
/* Hapus Link Aktif di Komentar by igniel.com */
content = document.getElementById('comments').getElementsByTagName('p');
for (var i = 0; i < content.length; i++) {
 if (content[i].innerHTML.indexOf('</a>') !== -1) {
 content[i].innerHTML = content[i].innerHTML.replace(/<a[^>]*>|<\/a>/g, "");
 }
}
//]]> </script>

1.2 jQuery

<script> //<![CDATA[
/* Hapus Link Aktif di Komentar by igniel.com */
$(function(){$('#comments p').find('a').contents().unwrap();});
//]]> </script>

If so, please click SAVE and Finish.

2. Delete the entire content of comments and replace them .

This one method is very good for you, because spam comments usually don't connect with the content of your content, so it would be nice if they were removed and replaced with their own words.

The steps are the same as above paste the code below right ON the code </ body>

<script> //<![CDATA[
/* Hapus Link Aktif di Komentar by igniel.com */
var content = document.getElementById('comments').getElementsByTagName('p');
for (var i = 0; i < content.length; i++) {
 if (content[i].innerHTML.indexOf('</a>') !== -1) {
  content[i].innerHTML = 'Oops...nggak boleh masukin link aktif disini kak! Mau nyepam ya? Komen dinonaktifkan otomatis oleh showdzgn.com';
 }
}
//]]> </script>

Please change the words we marked according to your wishes.

Well, how easy is it not how to delete active links in Blogger comments, if there are problems, please comment in the column below this article or you can contact us via the contact form.

Share with your friends

Add your opinion
Disqus comments
Notification
BLOGXHTML.BLOGSPOT.COM is a blog where you can learn HTML, CSS, and JavaScript, SEO along with creative CSS Animations.
Done