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>

Related articles

How to Allow Contributor to Upload Images in WordPress Without Using Plugin

Hello guys, If you created the "contributor" user role...

Why should you teach coding to your children? Benefits of Coding

Nowadays, even before they can count, kids learn how...

E-Commerce App Development For Beginners: Things to Know Before Starting

With the advent of technology, everything is changing, even...

Download e-PAN Card Easily- Follow These Simple Steps

The permanent account number or PAN card is required...

Fixed: No input file specified Error in Codeigniter

Hello guys, Today I'm working on a Codeigniter project...
Abhay Pratap Singh
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.

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here