
People like to use right-click to save images or copy text they find on the internet. If you are worried that they can use this function to steal your content, you can easily disable the right click for your blogger blog.
Using the following code will cause an alert box to pop up with the message of your choice. It will let people know that your information is copyrighted. The code isn’t foolproof, but it does allow you to warn people who want to take your graphics and photos.
Please note: If you have a blog button on your site with the HTML share code, be sure to let your readers know to use their keyboard short cuts (CTRL + C, CTRL + V) instead of their mouse to copy your button code.
Disable right-click code
Copy the following code and paste it into a gadget box on your sidebar.
<script language=javascript>
<!--
var message="Function 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;
}
document.oncontextmenu=new Function("alert(message);return false")
// -->
</script>
If you’d like a different message to pop up, change the phrase “Function disabled”, but DO NOT delete the quotation marks around the message.
That’s it! Now you have disabled right click on your blog!
For more blogger tutorials make sure to check our tutorial library.
Is there any way to make this apply to only the pictures and not the posts themselves?
@phasejumper: Not that we are aware of. But we'll be sure to post about it if we ever find a code that applies to just pictures!
I was hopeful when I saw this but I can't get it to work. Copied it all, put in my email address in place of yours. Left the quotation marks intact and saved it in an html gadget.
No luck???? You can still right click and copy the photos. Had my son try it from his computer too but it isn't working.
Any ideas?
Hi Lori! Something in the code must've been left out during the copy to the HTML gadget. We use this code on all of our premade designs and on some of our personal blogs. The code is NOT foolproof — unfortunately there are ways around it. Luckily for all of us, I think one of the DB girls has a new tutorial for a better disable code that I'm sure will be up sooon!! So keep your eye out for it. 🙂
I just tried it on my genealogy blog and it works great???
I wonder what is wrong on my main blog that stops it from working.
At least it works on one. Thanks
Oh my gosh….i can't say thank you enough for this tutorial. I'm so thrilled about this! I love to blog and love to take photos, but often worry about them being lifted. Yeah, i worry about a LOT of things, lol…
Seriously, thank you!!
I loved this! Until I get my blog button this will do just fine! Yeah…thank you, DB!
I just tried it thanks!
I've try it.success!!!!!!!! tq so much…
This isn’t working for me 🙁
I am very interested in trying it, however, I did not understand where to past it… Looking at the layout section in my dashboard on the right panel I have where to add gadgets and I have how to add gadget and the ones that are already in use. I don´t have like an blank area where to paste the codes provided. Would explain it better?
Go to your blogger layout, and under the sidebar section click on “Add a Gadget”. In the new window with the list of gadgets, look for “HTML/JavaScript” widget and click on + icon on the right. Now copy/paste the code from our post to the new widget content area and click save.