Disable Right click, Copy and Paste function


Some time you might required to protect your web pages from thieves who takes your ideas, hard work and many more with simple copy and paste. Around the web world you can find lot of web site uses same contents and same web design, this time you need to protect your website. You can’t just protect the web site just with removing information from the css or any other information from the source code or controlling the visitor by ip address. But disabling right click,copy and paste function will reduce content being stolen.

Use the following java script, this will disable right click, copy and paste function. This script will allow visitor to select the text, but will not allow to copy.

<script type=’text/javascript’>

document.onkeydown=function(a){var a=a||event||window.event;if(a.shiftKey===true||a.ctrlKey==true||a.keyCode==123){return false}};if(top.location.href!=self.location.href)top.location.href=self.location.href;


<script type=’text/javascript’>

function disableSelection(target){

if (typeof target.onselectstart!=”undefined”) //IE route

target.onselectstart=function(){return false}

else if (typeof target.style.MozUserSelect!=”undefined”)



target.onmousedown=function(){return false}

target.style.cursor = “default”


document.oncontextmenu=function(){ return false; }


Place the above script between head tag.


Place your script here!!!


That’s all!.