Contents
Recommended Article’s
- How To Add Pop Up Facebook Like Box in Blogger
- How To Add Multi-Colored Popular Post Widget
- How To Create a Blog on Blogger
- How Remove Subscribe To Posts Atom From Blogger
#1 Method : Disable Whole Text Selection in Blogger Using JavaScript
Step 2 – Click anywhere in the html code area and press CNTRL + F and find the below tag.
</head>
<!–Disabe Copy Paste— By – www.bloggerhope.com –>
<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>
Step 4 – Now save your Template and view your blog and see the result.
Now with this method, you can disable the whole text area for your visitors, if any one want to copy text, then they won’t copy anything . But if you want to provide some text to your readers to copy them, then follow second method below.
#2 Method : Disable Text Selection Except Some Specified Text Using CSS
This method is more useful , because many of your text you want to provide your readers to copy them like some codes, some texts, or something other. And almost everyone who use this features, always use this method.
In this method we use CSS code and disabling the text selection or right click feature. Some text which you want to enable for copy paste, this code is only for you. Now follow the method.
Step 1 – Go to your Blogger dashboard, and click on “Template” and select the option “Edit HTML” link.
]]></b:skin>
Step 3 – Now copy below code and paste just above this tag.
/*—– Disable Text Selection with CSS Code— By – www.bloggerhope.com —-*/
.post blockquote {
-webkit-user-select: text !important;
-moz-user-select: text !important;
-ms-user-select: text !important;
user-select: text !important;
}
body {
-webkit-user-select: none !important;
-moz-user-select: -moz-none !important;
-ms-user-select: none !important;
user-select: none !important;
}
Note : This code is useful if you want to allow to your readers to copy and paste some text, but if you want to disable whole text, then simply use below piece of code.
/*—– Disable Text Selection with CSS Code— By – www.bloggerhope.com —-*/
body {
-webkit-user-select: none !important;
-moz-user-select: -moz-none !important;
-ms-user-select: none !important;
user-select: none !important;
}
Note That : You can simply use this CSS codes, by adding this code, simply go to the Template Designer of your blog and click on the ADD Custom CSS and paste this copied CSS code and save your template .
You’ve done all your work.
Recommended – Use CSS Instead of JavaScript
We recommended you to use CSS method instead of JavaScript. JavaScript has biggest setback is that, user can simply go to the browser and disable inside it and then reloading your page, then your blog will be again in normal mode and anyone will be able to copy paste anything.
But if you use CSS code, then it will not be disable anyone, many experts can also remove or disable CSS code too, but newbie don’t use this feature.
So overall CSS code is the best as compared to the JavaScript code. You may let us know about this article, hope you will understand everything, and if any you’ve any question into your mind, then please share in the comment section below, i’m reply you soon as possible.