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

64 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 =-.

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

  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… =-.

  33. Saben1

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

  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!

  37. mm

    awsome

  38. Susan

    Thank you for this tutorial! I have a few blogs, a personal, a craft shop, and a photography blog, and this tutorial was extremely helpful in keeping my photos only where I want them! Thank you!
    .-= Susan´s last blog ..MAKE-UP TIP MONDAYS =-.

  39. Sue

    Sweet! Thx:)

  40. Joy

    it worked! (:
    Thanks a lot. :D

  41. Mary Kate Webb

    Hi…I made this change in my HTML code…when I right click on my pics, it brings up my photobucket account, which is where I download pics too before I post them in Blogger. Is this preventable? I want it where no one can copy my pics! Thanks for any more help you may have!

  42. neesa

    it works! thanks :P
    .-= neesa´s last blog ..Adoh hehangol palak- =-.

  43. Jhari

    Wow! It took me 30mins looking for the correct code. And good thing that 1 line will just do everything. Thank you so much for the tip :)

  44. ACEsushi CHiP

    Thank for the hack again this still unbeaten than those with java application. Thats one is very lame. Thanks i hope this is still up in internet. :)
    .-= ACEsushi CHiP´s last blog .. =-.

  45. Grace

    hey may i know if you have any code that can help me disable right click for the image only but not the whole page? that would help alot.

    thanks! =)

  46. MadMikkie

    hmmm…my host won’t let me play with the html the easy way…either that or I’m too tired to think straight.

    Will try later

  47. Yvonne

    Thank u Thank u Thank u! It worekd, i was not sure if it would work. But it did. Thank u! :D

  48. Jenny

    very awesome. but there’s nothing stopping idiots from taking a screenie and cropping out the image. so make sure you mark your photos!! :)
    Jenny´s last [type] ..Such a sweet scent

  49. Daniella

    Thanks again!

  50. Tami

    Thanks sooooo much!!! This is so great to have!!!

  51. Izham Zainul

    It’s really work…
    Thank’s a lot….
    Izham Zainul´s last [type] ..Watashi no korekushon Kamen Rider Belting

  52. SV

    Hi, Thanks this code worked for me but I have a problem
    expr:class=’”loading” + data:blog.mobileClass’ this code appears in my blog below the nav bar after I did this change.how to get rid of it.
    Also is there any ways to disable left click because still I see that images get copied on the computer when left clicked
    Thanks in advance.
    SV´s last [type] ..My Vinayakar painting

  53. SV

    Hey I got the answer for my question how to disable left click in your other tutorial.Will try it.Thank you

  54. SV

    Thank you for visiting my blog.the code issue got fixed.

  55. Dave

    Please people, don’t be fooled. Right-click cannot be disabled, if you try and make it difficult to access context menus you will only annoy and turn visitors away.

    If you don’t want content copied then don’t put it on the web – simple. Anything you put on a website is downloaded to the visitor’s hard drive then displayed on screen, there are a thousand ways to recover the data.

    If you don’t believe me just google “right click disable”

    Accept it – everything on the web is in the public domain.

  56. Revka

    Dave, thanks for your comment. You are absolutely right – there is no fool-proof method for disabling right-click. However, this tutorial is in response to requests from many people for such functionality, and though it’s not fool-proof, it’s at least a deterrent for many would-be thieves.

    Whether or not a person puts this tutorial into action is completely their choice. As you can see from my site, I don’t use this method. That’s because I hate it when I come to a website that has right-click disabled. I use right-click most often to open a link in a new tab, and it’s very annoying not to be able to do that.

    Revka
    Revka´s last [type] ..Berries and Cream Blog Design Is Now Live!

  57. Kyle Leon

    Thanks for the right click disable tip :)

    Worked for me too hehe :D
    Kyle Leon´s last [type] ..Somanabolic Muscle Maximizer DOWNLOAD – Click Here!

  58. Jocelyn

    Fantastic – thanks SO MUCH for doing this. I have added it to my Blog Template and it worked first try! Thanks for your detailed and easy to follow instructions. Fantastic that there is a non-Java script fix that I could add.

  59. Heidi

    THANK YOU!!! : )

  60. Heidi

    Question … what’s to stop someone from just clicking (not right clicking) on your image and bring it to a new page and then downloading it there. I’d like for THAT not to happen… ANy ideas?? If so, can you email me?
    Thanks!!!

  61. Mahesh

    Need some help. In my template script inside body tag as follows,

    May I know, where should I insert oncontextmenu=”return false”.
    Thank you in advance for your help.

  62. cantchoos

    This is ridiculous. Javascript should never be used to “stop” a user from doing something. It should always be there for purely the user’s benefit. Since javascript is very easily shut off.

  63. Chinky

    Thanks for the post. I’ve successfully disabled left click on my blog. but could’nt do right click as my blog’s html has instead of . I tried editing the but that did’nt help. Pls tell me how can i fix it. Appreciate your help :)

  64. writer

    Hey by using Cntl+c and Cntl+v we were able to copy the content even after disabling right click. Please suggest a method to make user not to copy the content….

We Welcome Your Comments

...but spam will be deleted. Thanks!

CommentLuv badge



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