Tutorial: How To Right Click Disable Your Blog

Do you want to protect the images and photos on your blog? You can protect your site with a right click disable code! Using the follow code will cause an alert box to pop up with the message of you choice, letting 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 graphic 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.

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 in red, but DO NOT delete the quotation marks around the message.

That’s it! Now your information is right click disabled!

Note: if you have issues getting this to work, please contact us at [email protected] for assistance.

 


Comments

  1. Thank you! Thank you! Thank you! I've been trying to find a way to protect images of my kids and clients, and I'll now sleep better at night knowing my photos are protected.

  2. Very cool! Thank you!

  3. TY!!!

  4. Bless You!!!!!

  5. Is there any way to make this apply to only the pictures and not the posts themselves?

  6. @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!

  7. 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?

  8. 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. 🙂

  9. 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

  10. 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!!

  11. I loved this! Until I get my blog button this will do just fine! Yeah…thank you, DB!

  12. I just tried it thanks!

  13. I've try it.success!!!!!!!! tq so much…

  14. This isn’t working for me 🙁

Speak Your Mind

*