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

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • E-mail this story to a friend!
  • Reddit
  • Sk-rt
  • StumbleUpon

14 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!!

We Welcome Your Comments

...but spam will be deleted. Thanks!


© 2007-2008 RS Designs | powered by WordPress | design by Revka and Linda of RS Designs