Simple Code to Add Copyright Notice to Copied Text of your Website

In many popular websites, when you copy the content and paste it to somewhere, it adds a link back to the original page with a copyright notice. This helps the content owner to protect their content. Actually there are many content scrappers who create a blog on Blogger or WordPress.com and produce content by copying from other websites. So adding a copyright notice helps to get a link back from these copy bloggers.
In WordPress, there are a few plugins available that can protect your blog’s content. But what about doing the same on other platforms? In this post, I am adding a JavaScript code that can add a link back to the 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 kinds of websites.
Here is the code.
<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 © UseThisTip.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>
Paste this code in the footer of your website. It works with all blogging platforms and custom coded websites. In WordPress, you can either edit the footer.php file of your theme or use any other plugin that lets you add custom JS code on your wordPress blog.
This code works fine if the person copying content is using any browser other than Internet Explorer.
Wrap Up
This page offered a code that automatically adds a copyright notice to the copied text. Anyone who tries to copy any line or paragraph from your blog will also get the copyright text and linkback in the copied content. I personally do not use this code because I don’t want to add copyright notice automatically in the copied content. If you want, you can use this code.
If you face any problem with this code, you can always ask using the comments section below.
Similar Articles
1 Comments
Leave a comment
Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted.
Remove disqus as it will discourage most readers to place thier comments. How many probloggers are using disqus on their blog? Hope you will not take this advice otherwise and do the needful.
He rakesh.. I removed disqus but I was fuked up with spam comments with porn and gambling links. can you help me how to manage all that.. 🙁
I added this mathmatical captcha and it seems working.. thanks for your advice