Hello friends, welcome to the Techtspot blog, today I will show you how to protect your Blogger Blog content from Copying with pictures.
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.
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 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) && isCtrl == true)
{
// alert(‘Keyboard shortcuts are cool!’);
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 function CSS code:-
-webkit-user-select: none !important;
-moz-user-select: -moz-none !important;
-ms-user-select: none !important;
user-select: none !important;
Step 4: Now 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.
Read More:-
How to Embed PDF Files to Blogger blog Post
How to add a Horizontal Menu Bar in Blogger Blog
How to Add Code Box in Blogger blog post
Disable Right Click on all Blogger blog images
I hope you enjoy this Post. If any problem comment it.
How to Embed PDF Files to Blogger blog Post
How to add a Horizontal Menu Bar in Blogger Blog
How to Add Code Box in Blogger blog post
Disable Right Click on all Blogger blog images
I hope you enjoy this Post. If any problem comment it.
very good its work...
ReplyDeletenice post
ReplyDeletethanks it working ....
ReplyDeletegood job thank you
ReplyDeletethanks for comment :)
DeleteAmazing , Thank you very much
ReplyDeleteThanks for comment :)
DeleteNice
ReplyDeleteThanks for comment :)
Delete