ad

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

copyright

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.

Add copyright notice to copy text

In WordPress, there are few plugins available that can protect your blog’s content. But what about other platforms. In this post, I am adding 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.

<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; webtips.in"; // 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>

This code works fine if the person copying content is using any browser other than Internet Explorer. I will try to post update with Internet Explorer fix soon.

If you have a fix, do share with us via comments.

Tags:
Nord VPN Sale

Deepanker Verma is the founder of Techlomedia. He is a tech blogger, developer and gadget freak.


Similar Articles

1 Comments

  • rakesh kumar says:

    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.

    • deepanker70 says:

      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.. 🙁

  • Deepanker says:

    I added this mathmatical captcha and it seems working.. thanks for your advice

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.

2020 UseThisTip | Developed By Deepanker