How to Create Automatic Article Source Links on Blogs

How to Create Automatic Article Source Links on Blogs
How to Create Automatic Article Source Links on Blogs



How to Create an Automatic Article Source Link on a Blog - Have you ever seen an article link source appear when we copy the contents of the article? Examples like the display below.

Lorem ipsum dolor sit amet, elite adipiscing consectetur. Pelentesque vel bibendum ex, eget bibendum turpis. Cras vitae lectus felis. Maecenas odio justo, porta tempor fermentum ac, cursus nec dui. In consectetur efficiency dui suscipit commodo.

Thank you for visiting, this article is sourced from: https://www.miusm-tech.com/

For a blogger implementing this function there are many benefits, one of which is to copy-pastecompletely avoid and publish it on other people's blogs without including the source of the article.

That way the source link will appear automatically to provide information and warnings to copiers of blog articles. Then how do you make the source link automatic when the article is copied and pasted?

To create an automatic source link when someone else's copy and paste the article, we can add JavaScript code to the blog template HTML.

To make it clearer, you can follow these steps:
  • Open the Blogger Dashboard
  • Select Menu Themes / Templates
  • Click EDIT HTML
  • Search for tag code </head>, use Find function (CTRL + F)
  • Copy the code below then paste it just above the tag
  • Click SAVE if done
<script type='text/javascript'>
//<![CDATA[
function copaslink(){var e,n=document.getElementsByTagName("body")[0],t=(e=window.getSelection())+("<br/><br/>© Article Source : < a href='"+document.location.href+"'>"+document.location.href+"</a><br/>"),o=document.createElement("div");o.style.position= "absolute",o.style.left="-99999px",n.appendChild(o),o.innerHTML=t,e.selectAllChildren(o),window.setTimeout(function(){n.removeChild(o)} ,0)}document.oncopy=copaslink;
//]]>
</script>

Adjust the marked text using the sentence you want

The code above functions to display the source link of the article when writing is copied and pasted anywhere, be it on blogs, social media, word, notepad, and so on.

Closing

So, that was How to Create an Automatic Article Source Link on Blogger . If this article is useful, you can share and recommend it to friends who need it, if you have problems you can ask via the comments column.

Source Code:
www.marwat-tech.com

Post a Comment

Welcome to Jehangir Khan's Tech Blog! We're thrilled to have you join the conversation. Your comments and feedback are valuable to us and help us create a community of tech enthusiasts who share ideas and insights. We encourage you to share your thoughts related to the post and engage in a respectful and meaningful conversation with others. Please refrain from spamming or promoting your own content in the comments section. We also ask that you avoid using inappropriate language or attacking others. Please note that all comments will be reviewed before they are posted, and we reserve the right to remove any comments that violate our policies. Let's explore the world of technology together and inspire each other to achieve our goals!

Previous Post Next Post