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.
Live Demo
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 ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
</head>
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
</head>
- Now save your template
No Comments
Click to Add a New Comment