No right click images plugin

The No Right Click Images Plugin Plugin uses JavaScript to change the right click action on IMG tags to disable context menu. It disables the context menu on images only so other right click actions, such as links, should work normally.

Since it uses JavaScript, it targets more images than using a plugin that filter pages and rewrite the tag. The plugin will find many images generated in scripts or pasted into posts and comments, that similar plugins will not find.

It is impossible to keep people from stealing images that appear in web pages, but this plugin will deter casual theft from surfers who do not want to interpret HTML or dig into the browser cache.

Download

Latest version: Download No right click images plugin v2.2 [zip]

Installation

  1. Download the plugin.
  2. Upload the plugin to your wp-content/plugins directory.
  3. Activate the plugin.

FAQ

Changelog

1.0

  • initial release

1.1

  • deleted some unused code in the javascript

1.2

  • Added code that works when javascript creates or loads a new image. Disabled drag and drop on images so images can’t be dragged to desktop.

1.3

  • Disabled links to local images (png, gif, jpg) in wp-content, preventing them from opening in a new window. This would allow these images to be saved or copied.

1.4

  • Backed out click check on images because it broke galleries. I left it in as an option if you want to change the code.

2.0

  • Separated javascript into a loadable file. Added an option to replace images on right click in order to thwart FireFox users who choose to block javascript from controlling the context menu. Made drag and drop blocking optional.

2.1

  • Added option so that logged in users are allowed to copy images. Disables the plugin for logged in users. Captured copy to clipboard events to prevent another way of copying in some browsers. Fixed a problem in image replacement that prevented an image from being restored when another image was right clicked before the image times out.

2.2

  • Changed the default so that logged in users cannot copy images. Too many people tested the plugin without checking the settings and assumed that the plugin was broken. They did not read the documentation, try the settings, or check the WordPress forums. I am sorry that I had to do this, but people were indicating on the WordPress plugin page that it didn’t work.
69 Comments

69 Responses to “No right click images plugin”

  1. tof says:

    hi,

    in first thanks for your plugin it’s a very good and easy thing.

    But i use lightviewplus and when i click on image, this one become like a pop up, and the no right click doesn’t work.

    Do you have a idea?

    Thank’s a lot

  2. Keith says:

    It looks like your plugin is bypassing the wordpress plugins to display a simple page. My plugin won’t work unless it is on a page loaded by wordpress. You could modify the lightviewplus code and put the javascript from my plugin in the bottom of their code just before the tag.

    Keith

  3. Mario says:

    This plugin does’nt work with WordPress 3.01 and Chrome….

  4. Keith says:

    I only test with firefox and IE 7,8,9. I am told it works with safari. That covers 95%. If someone wanted to steal an image, it would not be impossible. All they would have to do is look at the source for the URL of the image. This is a deterrent for casual theft, but a serious burglar could take all of you images. If the surfer can see an image, it is possible to steal it.

  5. Dave says:

    It disables a right click in WP, but does not disable a normal click. When clicking on the image it opens in another window where the “no right click” does not work

  6. Keith says:

    When you put an image in your blog, it is up to you to make it so it doesn’t open into a new window. No plugin can control that.

  7. Vicky says:

    Hey,

    Thanks for the plugin! Just wondering if there is a way I can add to the code so a message appears when someone tries to right click on my images. Or maybe a suggestion for any future releases you might have in mind :)

    Thanks again,

    Vicky Dowsett

  8. Keith says:

    Right now nothing happens when they right click. I would think that a message might be irritating. In one way the user is complimenting you by wanting to re-use your work, so it could be that you would alienate a fan. Of course, there are people out there who search google images for one they like and steal it outright, these people you could afford to alienate. How you tell these two apart…

    after line 56 add:

    alert(“Leave my pictures alone!!!!”);
    or
    alert(“All images copyright 2011 by yourname, All rights reserved”);

  9. Simply the most useful plugin I have ever seen,
    thank you,
    dave.

  10. GR8FL says:

    love the plugin, but it suddenly does not work. I can right-click images everywhere now. Using WP 3.1.2 and Firefox 3.6.1.7

  11. Keith says:

    WP 3.1.2 seems to have broken something. I have three plugins affected by this and I am looking into it.

    Keith

  12. Pascal says:

    Hello Keith,

    Great job on that plug-in!!! This is exactly what I was looking for. Thanks a lot!

    I also have some trouble with the plug-in and WP 3.1.2.
    It works great on the main page with all the posts. But when I click on a single post, it’s not working anymore.

    Thanks,
    Pascal

  13. Keith says:

    It loads in the footer and some themes neglect to execute a wp_footer command in all of the page types.

    The way you can tell if it is loaded, go to the page where it doesn’t work and “view source”. Near the bottom should be the javascript for open in new window. If you don’t see it, your theme is broken.

    Keith

  14. Pascal says:

    That’s actually my theme I’m working on. I’ll fix that.

    Thanks a lot!!!

  15. Roy says:

    Hi
    Firstly thank you for your plugin, I am a WP novice so please bear this in mind, I made the site with a theme for my daughters photos, now she complains people can right click her photos, I asked her to watermark them but she said no, your plugin works a treat but if they click on photo it opens in firefox then they can, how do I stop them from doing this please?
    many thanks
    Roy

  16. Keith says:

    When you upload an image to wordpress this is normal behavior. You can take out the link in the html if you like. There are other ways to put an image into a wordpress blog.

  17. Roy says:

    Hi
    sorry to be a pest, but I have no idea how to do this.
    thanks
    Roy

  18. Keith says:

    Roy,

    I uploaded a new version that prevents the behavior you described. I am not sure if all users will be happy, but this prevents a direct link to images in wp-content from opening in their own window.

    Keith

  19. roy says:

    Hi
    thank you so much m8 – you the man.
    Roy

  20. Keith says:

    Version 1.3 is live on the wordpress repository. Update if you need the new functionality.

  21. Vince says:

    Just a heads up, the plugin doesn’t seem to be compatible with prettyPhoto lightbox. When images are clicked, nothing happens, when they are supposed to open in a lightbox. Obviously you never claimed it did work with lightbox functionality, but since this is a common feature nowadays, just thought I’d pass it along.

    Nice work though!

  22. Magellan says:

    Your plugin seems to not play well with jQuery Lightbox For Native Galleries

    When I upgraded via the wordpress Back end the images hang on load. As soon as I deactivate your plugin The images begin to load again.

  23. Ken says:

    Was great till last update. Would love to be able to use this plugin. Will not work with any of my galleries. I use NextGen with jQuery colorbox photos would not open at all I tried to switch to other options still wouldnt work till I dropped the no right click plugin. please fix

  24. Reed32 says:

    I loved this plug in, it was one of my favorites. But when I updated to 1.3, when using another plug-in to allow visitors to see larger versions of the photos, it now brings up a window opened to the front page rather than the photo. I’ve had to deactivate the plug-in for the time being. Hopefully you can fix the problem in the next update. But regardless, thanks for one of my favorite plug-ins!

  25. mplunder says:

    same as Magellan… can play anymore lightbox pictures… after I deactivate the plugin, it works again

  26. mplunder says:

    im sorry, i wanted to say CAN’T USE LIGHTBOX ANYMORE with 1.3 version of this script :(

  27. Keith says:

    OK,

    I backed out the changes. I left the code in for anyone who is concerned and wished to turn it back on. This should work now with the sliders and galleries the same as the 1.2 version did.

    Keith

  28. mplunder says:

    1.4 version works great :D thank you very much

  29. Ken says:

    1.4 update Works great thank you. For the 24 hours i did not have this plugin some site posted my photos on a there site of nothingness just to have links to there site. Must have plugin to protect from silly sites posting your work. I know there is always a way around the right click but this helps.

  30. Keith says:

    I’m sorry, I didn’t realize that it broke images displayed with jquery type plugins. I am still trying to fix the original problem, but I will test it with some galleries and sliders before I release it.

    Keith

  31. Z says:

    Hi,

    Great plugin but how can i assign this to all of my pages/gallerys?

    thanks

  32. Keith says:

    Pages should work as long as they have a footer section.

    Galleries and Sliders are out of my control. You have to ask the plugin author to add security to his code.

    Keith

  33. Jennifer says:

    This is a great plugin. Thank you! Just curious if it affects the images SEO at all?

  34. Keith says:

    The changes happen in JavaScript after the page loads. No changes to the underlying html will be seen by the Search Engine spiders. I should be invisible as far as SEO is concerned.

  35. Brett says:

    Hi Keith,

    Is there any reason you can think of that would cause the “no right click plug-in” to not show up as an active plug-in? It is definitely installed (it is listed under my settings drop-down) and working properly but I was wanting to disable it. I can’t because it doesn’t show up in my list of plug-ins!

    Great work by the way. I just want the ability to disable it.

    Thanks

  36. Keith says:

    Brett

    Either the plugin comments are missing or the readme.txt file is gone. Try re-copying the plugin files. Or delete the directory completely and reinstall.

    The plugin is just a few dozen lines of code. There is not really much there except the javascript. I can’t understand why it would disappear.

    Keith

  37. Keith says:

    I guess it can’t be the readme. I thought that wordpress checked it. It has to be wordpress not finding the plugin file itself or the comments in the top of the file are missing.

    Keith

  38. Brett says:

    Strange. I did a search for the plug-in from within WP and it brought up the page under the settings menu. It simply states to disable the plug-in, deactivate it from the plug-in menu. Do you have any idea why WP wouldn’t find the plug-in?

    Sorry to bug you but I have tried everything that I can think of.

    Thanks

  39. Keith says:

    Brett,

    Delete the no-right-click-images-plugin directory. This will get rid of it. It is located in wp-content/plugins. You will probably have to do this through ftp or perhaps your host has a file maintenance utility like webspace explorer for deleting files.

    The file must be corrupt.

    Keith

  40. Brett says:

    Will do. Thanks Keith.

  41. Larry says:

    Two things, this plugin works fine in Firefox as far as I can tell, but in IE all you have to do is double right click and it brings up the context menu, allowing a visitor to save the image. Second, I tried what you said earlier about adding a message when the user right clicks an image – still nothing happens. Looks like it could be a very useful plugin if these issues were fixed.

  42. Keith says:

    I tried double right click with several configurations. It does not bring up a context menu unless some other plugin has reset the JavaScript actions on the image.

    In a clean installation, double right click does nothing in IE 7 and 8.

    Keith

  43. Mark says:

    I’m using NextGen Scrollgallery and WP 3.2.1 – everything is working properly when testing in several browsers, except Firefox 5.0.1 (Mac) .. Right clicking is bringing up the context menu in that one!
    Your work is appreciated!
    -Mark

  44. Keith says:

    My plugin uses some basic JavaScript to disable the context menu, but many gallery or slider plugins display images using css and js that bypasses the normal clicks.

    Keith

  45. Mark says:

    I don’t think it’s the plugin, I think it’s the browser – I wonder if you know if the plugin works with Firefox 5. Thanks!

  46. Mark says:

    Thanks for helping with that Keith – Firefox 5 is definitely working correctly with your plug in … it was my settings under content->javascript->advanced … I had changed the default settings for my Firefox. Good to go!
    -Mark

  47. timur says:

    Great plug-in!

    It doesn’t work if the browser is on the iphone/ipad though.

  48. Keith says:

    I guess that safari on the iphone/ipad is dumbed down. I test on safari, and most things work fine with it.

  49. MyGarageShop says:

    I like the plugin a lot but if you right click on more than one image the prior image does not restore?

    Have you had this before?

    Is there another place you would like me to post this type of question?

  50. Keith says:

    This is the best place.

    Do you mean when you click the second image that it does not restore? I’m not sure how you’d click two images at once.

    I will try it with multiple images and see if there is a bug.

    Keith

Leave a Reply