In this article you will learn how to disable right click and text selection in blogger. To disable the feature we need to modify or customize blogger HTML template. Here I am going to disable this feature using JavaScript.
Disable Right Click and Text Selection in Blogger | WordPress
Recommend:
To disable text copy and right click feature from any website like Blogger or WordPress follow below steps.
- Go to your website (Blogger or WordPress)
- In case of blogger select your blog and click on Theme menu
- Now click on Customize Theme and Edit HTML
- Press CTRL+F and search </head>
- Paste below code above </head> tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
function disableselect(e){ | |
return false | |
} | |
function reEnable(){ | |
return true | |
} | |
//if IE4+ | |
document.onselectstart=new Function ("return false") | |
document.oncontextmenu=new Function ("return false") | |
//if NS6 | |
if (window.sidebar){ | |
document.onmousedown=disableselect | |
document.onclick=reEnable | |
} | |
</script> |
0 Comments