How to disable right click copy and paste on blogger website

For Blogs

Log into your blog dashboard

Go to template then click on Edit Html

Then use CTRL + F and search for “<head>” tag

Paste bellow code right after “<head>” tag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!--Avoid Copying Script -->
<script type="text/javascript">
var omitformtags=[&quot;input&quot;, &quot;textarea&quot;, &quot;select&quot;]
omitformtags=omitformtags.join(&quot;|&quot;)
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
function reEnable(){
return true
}
if (typeof document.onselectstart!=&quot;undefined&quot;)
document.onselectstart=new Function (&quot;return false&quot;)
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
</script>
Save your template and now you are done.


For Websites

Go to page what you need to avoid been copied

Then use CTRL + F and search for “<head>” tag

Paste bellow code right after “<head>” tag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!--Avoid Copying Script -->
<script type="text/javascript">
var omitformtags=[&quot;input&quot;, &quot;textarea&quot;, &quot;select&quot;]
omitformtags=omitformtags.join(&quot;|&quot;)
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
function reEnable(){
return true
}
if (typeof document.onselectstart!=&quot;undefined&quot;)
document.onselectstart=new Function (&quot;return false&quot;)
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
</script>
Save your file and now you are done.

No comments:

Post a Comment