How to Disable Mouse Text Selection Function on Blogger Blogspot and WordPress Web Pages
Using the following java script you can Stop the Mouse Text Select option on your Website Pages. So that you can protect your website from Copy and paste option. You have to past this script on your website. For Blogger / WordPress, you can paste it in Gadget/Widget.
For Blogger Blogspot:
1. Log-in to Blogger Admin
2. Go to your blogger Dashboard -> Template -> Add a Gadget -> HTML/JavaScript
3. Paste the below code and save the Gadget.( No title Required)
Disable Mouse Selection On WordPress:
1. Log-in to WordPress Dashboard
2. Go to Appearance -> Widgets -> Add new Text Widget
3. Past one of the below code and save the Widget as shown below.
Script to Disable Mouse Selection:
<script type="text/javascript">//Disable mouse select // http://nxwiki.blogspot.com var omitformtags=["input", "textarea", "select"] omitformtags=omitformtags.join("|") function disableselect(e){ if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1) return false } function reEnable(){ return true } if (typeof document.onselectstart!="undefined") document.onselectstart=new Function ("return false") else { document.onmousedown=disableselect document.onmouseup=reEnable } </script>
thanq its working
Updated the code, please try it now give your feedback..
It doesn't work my friend. I tried on my blog autohippo.blogspot.com
Thnxx its work
One is still able to select and copy when accessing blog via mobile etc…how to get rid of that?
Thank you for the code! I was wondering if there was a way to disable mouse selection of text going up. The code blocks text selection going down but I can select the text going up. Thank you!