How to Create Automatic Article Source Links on Blogs

Guide to Making Automatic Article Source Links on Blogger When Articles are Copy Paste Using JavaScript.
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