SUBSCRIBE OUR YOUTUBE CHANNEL 👉
Join in Google News
If You Want Adsense Approval for your blog Contact Us Adsense Ready theme Now!

Delete the active link in the blogger comments and replace it with your writing

How to Delete the active link in the blogger comments and replace it with your writing by blogger store
Delete the active link in the blogger comments and replace it with your writing
Delete the active link in the blogger comments and replace it with your writing


hello all on this occasion I will share how to delete active links in blogger comments automatically and replace them with our writing.

most people who comment with active links usually aim to get free backlinks from our blogs, as blog owners it will certainly harm us, what's more, if in the future the link dies or can't be accessed, it will become a broken link which will be bad for the health of the blog. .

and actually most templates now have a script installed to turn off active links in blogger comments into plain text like using <b:eval expr='data:cb.level.body snippet { links: false }'/> but this method can affects comments truncated if they exceed 1000 characters.

and in a previous article I have also made a tutorial so that blogger comments are not truncated using the conditional tag , so only blog admins can write long comments and active links in comments, but visitors are still limited if they exceed 1000 characters the comments will be truncated.

so that blog admins and visitors can send long comments without being cut off and of course it must be safe from spammers, you can try the script that I will share here.

so the way it works is like this, usually if you insert an active link in a comment like <a href="https://blogger-store.com">click here</a> , so every comment containing the code </a> will be deleted. assume the link is active and will be replaced with the text or text that we have specified.

This script has also been shared by the igniel.com blog but the script doesn't work on all templates, because there are some comments that say it doesn't work / doesn't work and I've tried it myself, it turns out the problem is in the javascript that sets the tag Pon the comments.

while not all templates use tags Pin comments, for example, the template I currently use uses the tag DIV, so I changed the javascript and just shot it to the comment-content class because almost all templates use that class, including the templates made by igniel though.

and I also added a little css for the style of the deleted comment to make it look different from the comment that was not deleted, ok so for those of you who want to try it, let's see how below.

on this blog we do not use the script, because we use conditional tags only admins can post active links and long comments. so to see the demo can see the picture above.

please go to blogger select temaand edit htmlcopy the css below and place it above the code ]]></b:skin>


.comment-content .change-comment, .comment-content i[rel="change-comment"]{margin:15px 0;display:block;font-style:normal;border:1px dashed #e65151;border-radius:3px;padding:20px 25px;text-align:center}

then put the javascript below above the code </body> otherwise it might have been parsed so it will look like <!--</body>--></body>


<script>//<![CDATA[
/* Delete Active Link in Comments by blogger-store.com */
var content = document.getElementById('comments').getElementsByClassName('comment-content');
for (var i = 0; i < content.length; i++) {
if (content[i].innerHTML.indexOf('</a>') !== -1) {
content[i].innerHTML = "<i rel='change-comment'>Spam Detected! comment deleted by author</i>";
}}
//]]></script>

if you have, please click save and see the results, ok so that 's how to delete active links in blogger comments automatically and replace them with our writing, hopefully it will be useful.

Reference:
www.igniel.com/2018/10/abolish-link-active-in-comments.html

Hi Greetings! thanks for reaching here, We are so delighted to welcome you on board. Your intelligence and energy make you an asset to your family and love ones.

Post a Comment