How to Add Copyright Notice to Copied Text With a Script

In many popular websites, when you copy the content and paste it to somewhere, it adds a link back to the original page with copyright notice. This helps content owner to protect content. Actually there are many content scrappers who create blog on blogger or WordPress.com and produce content by copying from other websites. So adding a copyright notice helps to get link back from these copy bloggers.

Here I’m going to share a  JavaScript code that can add link back to original website with a copyright notice. This can help you to protect your website content. This JavaScript code will work on all platforms and all kind of websites. Bellow is the javascript Code, Copy code and add this to your website just above the </body> tag.

<Script Type="Text/Javascript">
Function AddLink() {
Var Body_element = Document.GetElementsByTagName('Body')[0];
Var Selection;
Selection = Window.GetSelection();
Var Pagelink = "<Br /><Br /> Read More At: <A Href='"+Document.Location.Href+"'>"+Document.Location.Href+"</A><Br />Copyright &Copy; Trixhub.Com"; // Change This To A Custom Copyright Message If You Want
Var Copytext = Selection + Pagelink;
Var Newdiv = Document.CreateElement('Div');
Newdiv.Style.Position='Absolute';
Newdiv.Style.Left='-99999px';
Body_element.AppendChild(Newdiv);
Newdiv.InnerHTML = Copytext;
Selection.SelectAllChildren(Newdiv);
Window.SetTimeout(Function() {
Body_element.RemoveChild(Newdiv);
},0);
}
Document.Oncopy = AddLink;
</Script>
Abhay Pratap Singhhttps://www.itechcube.com
Abhay Pratap Singh is Digital Entrepreneur, Who is Making Money From the Internet since 2012. He Also Works as a Freelancer and Does Web and Mobile app Development. Apart from That, He Invests in Stock Market and Crypto Currencies. Here in iTechCube, Writes about Blogging, WordPress Guides, and Tutorials to help begginers.

Related Articles

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here