How to Disable Right Click Copy Function in Blogger or Blogspot - Theblogproject

Friday, September 13, 2019

How to Disable Right Click Copy Function in Blogger or Blogspot

A graphic illustrating a mouse right click.

Don’t want others to copy your content then you have to disable right click copy function in your Blogger or Blogspot blog using these two methods using JavaScript and CSS.

Method 1: Sign in to your Blogger or Blogspot account > Click Layout > Add Gadget > Choose HTML / JavaScript > Then paste the below code in the Widget text area.

[<script>
var message="Not Allowed";
var shouldAlert=1;
document.oncontextmenu=function(){
 if(shouldAlert==1){
  alert(message);
 }
 return false;
};
</script>]

This code was posted by SubinSb.

Method 2: Assuming you're already signed in in your account > Go to Theme tab > Click Customize > Click Advance > Add CSS > Copy paste the below CSS code in the Add custom CSS field > Click Apply to Blog. If this will not work go back to your Theme > Click Edit HTML > Ctrl + F then enter "<b:skin>" in the search field and paste the CSS code under it > Click Save theme.

[<style type=’text/css’> .post-body { -webkit-user-select: none; /* Chrome all / Safari all */ -moz-user-select: none; /* Firefox all */ -ms-user-select: none; /* IE 10+ */ -o-user-select: none; user-select: none; } </style>]

This code was posted by AssistBlogger.

No comments:

Post a Comment