Blogspot 101: Right-Click Disable

by Revka ~ April 8th, 2008. Filed under: Blogger Tutorials.

*To view all of the posts in this series, either click on the following link, or type Blogger Tutorials into our search box located at the bottom of our sidebar.*

I’d like to thank Amy for asking me about this. As I told her, I had never had anyone request this feature, and I have acquired new knowledge because of her question. I must also thank Text*Snippets for providing this code.

If you wish to protect your images from theft, you will be interested in these instructions. This is not a fool-proof method; there is no such thing. However, disabling the right-click function will deter many would-be image thieves, and because this is not javascript, it will work even if your reader’s browser is not javascript enabled.

  1. Go to the Edit HTML tab.
  2. Find the <body> tag. (Scroll down to the end of the CSS code but before the <div> code starts showing up. You should see </head> followed by <body> on the next line.)
  3. Change <body> to <body oncontextmenu="return false">.
  4. Preview your changes. Right clicking should do nothing.
  5. Save your template.

It really is that easy!
Please let me know if you have any questions or comments regarding this tutorial. I’d be happy to help you in any way that I can.

*To view all of the posts in this series, either click on the following link, or type Blogger Tutorials into our search box located at the bottom of our sidebar.*

36 Responses to Blogspot 101: Right-Click Disable

  1. Jade

    Hi I tried this but I get this message all the time, I have no clue what is wrong. Hope you can help, Thanks.

    Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
    XML error message: Open quote is expected for attribute “{1}” associated with an element type “oncontextmenu”.

  2. Revka

    I’ve already contacted Jade and helped her fix the problem, but if anyone else has had the same problem, try copying and pasting the code again. WordPress had changed the way the quotation marks were appearing, and I have since fixed the problem.

    Please do not hesitate to let me know if you encounter a problem. I’m more than happy to help you.
    Revka

  3. Emilee

    I keep trying the code and get this message:
    Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
    XML error message: Element type “bodyoncontextmenu” must be followed by either attribute specifications, “>” or “/>”

  4. revka

    Thank you, Emilee, for letting me know about that. When I redid the code, I accidentally neglected to put a space between body and oncontext menu. I have since fixed the problem.

    Thanks again for the heads up. :)
    Revka

  5. Featured Friday - Text* Snippets | RS Designs

    [...] is quite a selection from which to choose. That is where I found the only code that worked to right-click disable a client’s blog. There are code snippets for all kinds of languages – CSS, HTML, [...]

  6. Czytelnia

    Hi mate, it works in FF but I’d like to block it in Opera too, help me pls.

  7. Blogspot 101: Disable Text Selections | RS Designs

    [...] I wrote Blogspot 101: Right-Click Disable, I mentioned that “[t]his is not a fool-proof method; there is no such thing.” Thanks [...]

  8. PJ

    Thanks so much for the code to disable right click in blogger….java script wasn’t working! Do you know how to disable source code view? That Java script for HTMl isn’t working either.

  9. aLiYaNNuaR

    hi… i done… but still can right click… how come???

    nice blog u have…

  10. Lina

    WORKED!!! Thanks! Your blog helped me a lot with customising my first blog :)

  11. User links about "disable" on iLinkShare

    [...] | user-saved public links | iLinkShare 3 votesComment on Blogspot 101: Right-Click Disable by aLiYaNNuaR>> saved by narutokun0010 1 days ago2 votesDisable the App Store Kill Switch>> saved by miksmi 2 [...]

  12. Kia

    Wow, finally a code that works!! Thank you so much for helping me disable right clicking on my blog.

  13. Kia

    Oops. I can still l e f t click on my pictures and download them (in Blogger)… any tips on how to disable that?

  14. Mari Wilkes Photography

    Hi! I have the same question as Kia – how do you now disable the left click when they can view the full size image and download it that way?? I’m a photographer and have discovered that clients are downloaded my images even with my logo on them and putting them on myspace and stuff……I need to stop it!!

  15. Kathryn

    I know nothing about computers but with your clear instructions I was able to do this. I have a blogspot blog, and while this disbale the right click option they can still download if they click on the photo?

    Would appreciate any help.

    Many thanks

  16. Kristina

    I put it instead of the tag (it wouldn’t work otherwise) and it disable left and right clicks! It is no longer possible to click my photos and see them bigger in a new tab/window. Thank you so much!

  17. Kristina

    instead of the *[body]

    []=

  18. Kristina

    Oh. Scratch that. But it still disables the right click, which is great!

  19. Blogspot 101: Keep Your Photos from Opening when People Left-Click on Them | RS Designs

    [...] of my most popular tutorials tells how to disable right-click at your site. However, several people have commented that while right-click is disabled at their [...]

  20. Renee

    THANKS! The code works GREAT

  21. Kushagra

    Dear It Works but when we click on Image the Image open n anyone can save it easily. Can anyone have some tip to disable that also.

  22. ma'

    oh my gosh, thank you!!!
    it’s a great thing i found this article on google.

    super super thanks!
    :D

    -ma’

  23. di

    yey!!!!!!!!!! it worked!!! thank you thank you thank yoU!! ive tried several ways to on how to disable right click. this is the only thing that worked! so thank you again!

  24. Lori @ Building our nest

    Thanks to you and Jen from ODBT for this hot tip! :)

  25. leaca

    Thank you so much. Great tip.

  26. Candi

    This is great, I wish there was a way of doing this on typepad!

  27. Magda

    Yayyy! Thank you so much! This is the only coding that has worked for me.

  28. Brittany

    Thank you so much…this was the only tutorial that actually worked! I really appreciate you putting it out here fore EVERYONE to use and see. Thank you SO much!

  29. Katrina & The King

    Hi, I tried this and it doesn’t seem to be working!
    Katrina & The King´s last blog ..let her corner me My ComLuv Profile

  30. Chiccicherry

    Hi, could u please help me? Send me a pm if you could please do it for me.. Thamx for the awsome tips:)

  31. ACEsushi CHiP

    Thank YOU!! You save my life. Some website gave me the things i want but the URL are too long. Urs is the most simplest thing i ever seen! Thanks for the TIP!
    ACEsushi CHiP´s last blog ..Butterfly By Crazytown My ComLuv Profile

  32. Abby

    One quick question. I give out some codes on my website and I want people to be able to copy that. Does this code only disable the images or does it disable codes too?
    Abby´s last blog ..Check out some… My ComLuv Profile

  33. Saben1

    It worked! Thanks for the help!
    Saben1´s last blog ..Elite Penguin Force Badges Coming To Club Penguin! My ComLuv Profile

  34. Ricky Bobby

    thank you so much. this is awesome!!

  35. Emily

    I tried this and it works in the “preview” but when I got back to view blog…it still opens my picture with a right click. Am I missing a step?

  36. Al

    Where is the edit HTML tab?

    Sorry if this makes me sound thick!

We Welcome Your Comments

...but spam will be deleted. Thanks!

CommentLuv Enabled



© 2007-2008 RS Designs | design by Revka and Linda of RS Designs Berries and Cream Blog Design