Search & Find

Sponsor Post

Best Telegram Groups List Collection - Updated

Monday, 23 November 2015

How to Disable Copy Paste in Blogger blog with Pictures

Hello friends, welcome to the Techtspot blog, today I will show you how to protect your Blogger Blog content from Copying with pictures.
Disable Copy Paste in Blogger blog

Why we need to Disable Copy Paste function in the blog?

Disable copy paste function means we can disable the text selection function from our blog, website, and eCommerce Store, in the internet there are lots of users that copy the content from our online assets (blog, website, e-store, social profile, etc.) and they use for their benefit, so we need to prevent this action.

In the blogger platform, there is no option for disabling the copy-paste function or text selection function, here we are using the third-party script for disabling the copy-paste function and here I give you 2 codes first is JavaScript code and the second is CSS code, first select the code then apply in your blogger blog, now let's start.

These are the Following Steps:-
Step 1: First go to the blogger blog dashboard and click the Theme option, here we click the Customise dropdown button then click the Edit HTML option.
Disable Copy Paste in Blogger blog 1
Step 2: Applying to disable copy-paste function JavaScript code > here we click anywhere in the code and press Ctrl+F button then find "</head>" tag and we create some space above the </head> tag then paste the disable copy-paste JavaScript code, and at last click the Save button.
Disable Copy Paste in Blogger blog 2
Disable copy-paste function JavaScript code:-
<script type='text/javascript'>
var isCtrl = false;
document.onkeyup=function(e)
{
if(e.which == 17)
isCtrl=false;
}
document.onkeydown=function(e)
{
if(e.which == 17)
isCtrl=true;
if((e.which == 85) || (e.which == 67) &amp;&amp; isCtrl == true)
{
// alert(&#8216;Keyboard shortcuts are cool!&#8217;);
return false;
}
}
var isNS = (navigator.appName == "Netscape") ? 1 : 0;
if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
function mischandler(){
return false;
}
function mousehandler(e){
var myevent = (isNS) ? e : event;
var eventbutton = (isNS) ? myevent.which : myevent.button;
if((eventbutton==2)||(eventbutton==3)) return false;
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
</script>
Here when we use JavaScript code to disable the Copying Text function from Blogger blog but the most common problem is the user can easily disable the JavaScript code on any web browser then the user can copy our content very easily, so we use CSS code for protecting our content.
Step 3: Applying to disable copy-paste function CSS code > now second I give you CSS code, here we click anywhere in the code and press Ctrl+F button then find out the ".post-body" selector code and we paste CSS code in the .post-body selector, and at last click the Save button.
Disable Copy Paste in Blogger blog 3
Disable copy-paste function CSS code:-
-webkit-user-select: none !important;
-moz-user-select: -moz-none !important;
-ms-user-select: none !important;
user-select: none !important;
Step 4Now open the Blogger blog to check the results.

Now Visit the - Demo Blog to see the result.

Above I give you my demo blog link, where I disabled copy-paste function, if you are thinking to disable text selection in your blogger blog then first look at the copy-paste function code in my demo blog.

9 comments: