How to Disable Right Click using JavaScript blogger Pictured Steps

0

 

How to Disable Right Click using JavaScript Pictured Steps:

Normally, most blogs keep the right click option enabled to let their users navigate, copy, print, save and reload their web pages. But sometimes the dirty-minded users just visit your blog for just copy pasting your content. So to stop them copy pasting and to protect your blog, you have to disable the option of right click.

READ  How to submit Blogger blogspot URL to Bing webmaster
FelixMittermeier / Pixabay

Once right click has been disabled the option of copying from right click is banned. But You all know the shortcut key ctrl+c to copy the text. so the content is still not secure.

READ  Top 15 best Free premium template for blogger blogspot website

So, the next step is that if you disable text selection in your blogs then ctrl+c also won’t work.

Also see: How to enable blocked right click to copy the content in a website

READ  How to add adsense banner ads 300X250 in inside blog post in website

The Steps to disable right click in blogger is shown below.

Step 1: Go to Layout Tab on the left side of the blogger menu.

html script to disable right click

Step 2: Click on ‘Add a Gadget’ at anywhere (You can choose sidebar left or right or anywhere where you can add HTML script as this won’t appear)

remove copy paste option on blogger

Step 3: Now choose the widget ‘HTML/ Javascript’.

steps to remove copy paste option

The blank space to enter the blogger’s HTML script would appear. Paste the following code from the link and click ‘save’.

READ  How to change theme of your blog in blogger

Disable Right Click using JavaScript code:

<script language=javascript>
<!–

//Edit by AppReviewes.com

READ  Top 10 Way to Increase Blogspot Website Loading Speed

var message=” Sorry Right Click Has Been Disabled”;

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

READ  How To Setup Easy Mag Blogger Template

document.oncontextmenu=new Function(“alert(message);return false”)

// –>
</script>

NOTE: This script will disable right click only. It does not remove text selection. So users can copy from your blog by pressing ctrl+c. To remove text selection from your blog click the link mentioned below.

Click here

LEAVE A REPLY

Please enter your comment!
Please enter your name here