How to Disable Copy and Paste In Blog or Website

If you have a blog or website with information/data you do not want people to copy.
Actually disabling copy in a blog is not something advisable to new blogger, but still there are lot of people who do not want their work to be copied, perhaps they are afraid that other bloggers may copy and republish their content, for that reason they want to disable copy on their blog, here is a simple code to do just that.

<script type="text/javascript">
var omitformtags=["input", "tex<remove me>tarea", "select"]
omitformtags=omitformtags.join("|")
function disab<remove me>leselect(e){
if (omitformtags.<remove me>indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
function re<remove me>Enable(){
return true
}
if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disable<remove me>select
document.onmouseup=reEnable
}
</script>
Note: for this code to work you will have to remove <remove me>from it without space please
Copy the above code and paste it in your blog; here is how to paste:
  • Log in to your blog, and click on Add Widgets.
  • In the Widget elements Click on the HTML/Javascrpt 
  • Then copy and paste the above code in that box, You can save it without putting the Title.
  • Make sure the widget is under the blog post section in your blogger layout.
If you are website owner, copy the code to your HTML code and save.

 After installing this element save and try to copy (test it if you can copy anything from your post)
Good Luck

Comments