Disable Text Selection To Prevent Copy Paste in blogger

At some point, did you ever needed to disable text selection on your blog or website? Yeah, prevent selecting text on your pages. Text selection is to prevent copying your text by others and it's not just for fun sort of thing. Hmm... It may be your content or just few pages of text where you just need to make sure that your visitors can read only. There are some scenarios that you may aware of copying text on your pages. Or your text may have already being copied by someone who can named as a content scrapper and wanna figure out how to disable.



Demo


Live Demo

How To Disable Text Selection to Prevent Copy Paste in blogger

  • Go to Blogger Dashboard 
  • Click on DropDown Menu and select Template
  • Backup your Template before making any changes to your blog
  • Now Click on Edit HTML --> Proceed --> Expand Widget Templates
  • Press Ctrl + F and search the code shown below


</head>

  • Now replace it with the code shown below

<script language='JavaScript1.2'>
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function (&quot;return false&quot;)
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
</head>

  • Now save your template

Like it? Share it.

No Comments

Click to Add a New Comment

  • If you're asking a question click on Subscribe By Email link, on the comment form, to be notified of replies.
  • Do NOT add links to the body of your comment as they will not be published.
  • Only the comments posted in ENGLISH will be approved.
  • If you have a problem check first the comments , maybe you will find the solution there.