Blogs Eye

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 the 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 plugins 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.

Smart Phone support is hit or miss. Some web pages rely very much on clickable images and this suppresses some actions, so if an image is large enough to fill a screen, the page may not be able to scroll. It depends very much on your WordPress theme and how it displays images.

Images uploaded via the WordPress Media uploader will open in a window if clicked. The image will not be protected, so be sure to indicate that there should be no action if the image is clicked at the time you upload the image.

Some browsers prevent javascript from altering the context menu behaviour. The plugin tries to get around this by using a replacement image that briefly replaces the clicked image.

Download

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

Installation

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

FAQ

Q. I click on an image to open it and then I can save it
A. When you added the image to WordPress you specified this behavior. When you insert an image you have to specify that you don’t want to have a click on the image open the image. It is up to you to protect your images by not opening the image on a click.
If you are able to click on an image to display the image in a new window, it is then outside of WordPress and can’t be protected.

Q. I have a Slideshow or Gallery and users can right click on the images in the gallery.
A. Special image presentation plugins that use jQuery or other Javascript systems override the behavior of this plugin. When they load they take over and my plugin can’t help you. You need to contact the authors of the gallery and ask they they disable the right click event and drag events inside their plugin.

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 users were indicating on the WordPress plugin page that it didn’t work.

2.3

  • Added support for longclick and touch interface for android and ipad/iphone.

2.4

  • Added alternate replacement image url for webmasters who don’t like the o-slash
  • Added an option to turn off IOS Android events that screwed up some web sites.
  • Added an extra Security check on plugin load.

2.5

  • added Cell phone styles to javascript for Cell phones. I hope that his helps with Cell phone images. Tested on an old iPad – it may work. Works mostly in iPad, android phone works on some images.
  • This readme file did not update on the WordPress site so I have reloaded it.

85 Responses to “No right click images plugin”

  1. CJ Truax says:

    No problem man, perhaps that could be a feature in a paid version? hint hint. haha. I made my own little workaround in the meantime. Thanks a ton man, keep up the great work!

  2. Keith says:

    I am sorry, but there is no way right now to disable it on a page by page basis.

    Keith

  3. CJ Truax says:

    Works great now! One question though, is there a way to disable it on an individual page? If not that’s totally fine. Thanks man for an awesome plugin!

  4. CJ Truax says:

    AH! It’s under the general settings menu on the main wp admin page. I was looking for it under the plugins/installed-plugins directory. Thanks a ton man!

  5. Keith says:

    It is in the settings. There is an option where you type in the url of the new image.

    Keith

  6. CJ Truax says:

    Quick response! Where would I do this keith? Like what line do I replace or how do I add that in? I really appreciate it!

  7. CJ Truax says:

    I see one of the recent updates allows me to change the replacement image (instead of that big red “cross out”) How would I be able to do it? I looked through the coding and didn’t see an location for an image to replace, what must I do? I’d rather it just make the picture all white instead of that red cross. Thanks a ton!

  8. Alan says:

    Dear Keith,

    Thanks for this plugin. We have been using it without issue for a year or so. We work wit some vulnerable young people so we wanted to deter people from saving images from the site. I have just discovered that the plugin has the side effect of stopping the plugin Sweet Captcha from working (unable to click and drag icons, despite this being a left click action). I have also e-mailed the developer of that plugin. If there’s any way in which the two could live harmoniously I’d be most grateful.

    Best Regards,
    Alan Govan
    Sistema Scotland

  9. Pamela says:

    I’ve been using no right click for about a year with no problem. I updated it and now my blog stops scrolling on mobile devices. I deactivated the plugin and it worked fine on my phone.
    I hate to stop using the plug in, but I need my site to be mobile friendly. Any advice?
    Thanks!

  10. Paul says:

    In this website I am using your no-right-click-images-plugin which works on the pages. In each page I have an image, which is protected, and when one clicks on it is taken to a larger version of the image. This larger version does permit right hand click.
    Is there any way I can make the plug in work on such images.
    Thanks

  11. abraham says:

    Is it possible that this plugin does not work with the magazine theme? I downloaded the plugin and it does not appear to be working.

    • Keith says:

      I works on standard WordPress installations. It works on images that that do not use flash and are not loaded with jQuery.

      It will work with images that use the standard img tag and it will work with most images loaded as background. It will no work with sliders, albums and other dynamically loaded images. It will not work on images inside of iframes.

      Firefox has an option to disable web pages from interacting with JavaScript that disables the right click.

  12. Dean says:

    First off, thanks for the awesome plugin.

    My question is, is there a possibility to make the plugin work on certain posts only?

    (i.e. A check box if you want a post to be right click protected or not, kind of way.)

    Again, thank you for the sharing this amazing plugin.

    • Keith says:

      Right now the plugin is dead simple. It installs on every page. I don’t think that I want to create a complicated system to determine where it goes.

      Keith

  13. Tracy says:

    Hi Keith, thanks for checking. I see the no-right-click-images.js in tracyriddell.com/public/wp/wordpresscontent/plugins/no-right-click-images-plugin/. not the extra directories as you have listed above. I can’t even see services10/webpages/t/r on my ftp site…so I’m not sure where this is coming from?

    • Keith says:

      I use this code to find the javascript:

      $dir = WP_PLUGIN_URL.’/’.str_replace(basename( __FILE__),””,plugin_basename(__FILE__));

      WP_PLUGIN_URL and plugin_basename are part of wordpress.

      What I think is happening is that WP_PLUGIN_URL is wrong. There is something about your host or the wordpress installation that is screwy.

      Try finding the line above and right after it add the line:

      $dir=”/wp/wordpresscontent/plugins/no-right-click-images-plugin/”;

      See if it works.

      Keith

  14. Tracy says:

    I have this plug-in installed and activated. It says it is working properly, yet I can right-click on any image. I have the box unchecked to allow logged in users to do this. This images do not open in a separate window. I don’t see any code added to the footer of any of my pages. Help, please!

  15. Daniel Wild says:

    Hey Keith,

    Great Plugin! Works perfectly thankyou : )

    I would also like to implement this plugin on another plain html site, but my js is rubbish.

    I have tried to put your widgets code in a js file and load it into my html page but to no effect…is there a function call or something that I need to place within the page or something? Do you have another version available? ..all I can find right now are these scripts that show an alert popup : /

    Thanks again!

    • Keith says:

      You have to modify this code to make it work. Basically all you have to do is copy the js file and the gif included with the plugin to a directory on the other website (I used the /js/ folder). Then add this code to the web pages:

      <script language=”javascript” type=”text/javascript”>
      var kpg_nrci_image=”http://www.yoursite.com/js/no-right-click-images-plugin/not.gif”;
      var kpg_nrci_extra=”Y”;
      var kpg_nrci_drag=”Y”;
      </script>
      <script language=”javascript” type=”text/javascript” src=”http://www.yoursite.com/js/no-right-click-images.js”></script>

      Change YOURSITE to your domain in both places.

      kpg_nrci_extra can be changed to “N” if you don’t want to use the replacement image.

      I have javascript in the js folder. You might want to change it.

  16. MERIC BAYGIN says:

    I’m using the latest version of wordpress.New No Right Click Image does not work.I have tried five separate web site.Didn’t catch the cause.I wanted to inform.
    Please send mail about why the plugin is not working?

    • Keith says:

      The reason it is not working is because you have the box checked that allows logged in users to copy images. You are the admin and logged in. Uncheck the box and save the settings and it will work. If you log off it will work, too.

      Keith

  17. MyGarageShop says:

    Keith,

    I also sent this to you this via email in addition to this post because I can format and explain my 2 issues more completely in the email.
    I hope this detail in the email helps.

    I have 2 issues with No Right Click…
    The first is a need to have the second is a nice to have.

    First: (need to have)
    I use simple forum which uses this Captcha Form
    No right click is disabling this form…

    If I disable the No Right Click plug in the form works if I enable it the form does not work.

    I have enclosed a screen shot of what this object looks like when you inspect it if that helps

    Second: (nice to have)

    I use Highslide and everything works together very nicely… with one exception.
    Highslide as most image expanders show a thumbnail and when you click they show he full image.
    They also show the thumbnail in a thumbnail strip.

    What happens when you right click is you seem to replace the image (src=””) that was a thumbnail with the full size image (href=””) … (see the items in the div below)

    You don’t notice because the div controls the size, but when you click and see the thumbnail bar…
    The thumbnail (src=””) is replaced by the full size image (href=””).



    The finished product.

  18. Tim says:

    Sorry…didn’t see you earlier comment. I did what you suggested and it’s working fine. Thank you!

    • Keith says:

      I think I have to fix this to make it so that logged in users can’t click by default. I am getting too many people reporting that it doesn’t work.

      Keith

  19. Tim says:

    I’m with everyone else…the new update allows right-click.

  20. EAP says:

    Only working in blog area of wordpress site. Do you have a link to the old version it was working fine for me. Now not working in some sections after updating.

  21. Reed32 says:

    Never mind my first post. I’m an idiot. I’m a complete idiot. Please ignore my idiocy. Again, news flash – I’m an idiot. Thanks.

    • Keith says:

      I was going to say that by default logged in users can right click images – perhaps an idiot move on my part. I expect to see lots of messages like yours. Next release will have it off by default.

      Keith

  22. Reed32 says:

    Just updated to the new version, and now, even with the plugin installed and activated, you can download images from my website by right clicking. Any chance at a quick fix for this?

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

    • 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

    • Keith says:

      OK, I figured it out. There is a 5 second wait after the block image shows up. If you click on another image in that time the first one does not block.

      This should not be so bad a thing, but I see where it can be annoying.

      I will come up with a fix and see if I can make it work.

      If I think of a good way, there will be a new version of the plugin early next week.

      Keith

  24. timur says:

    Great plug-in!

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

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

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

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

    • 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

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

    • 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

  29. Brett says:

    Will do. Thanks Keith.

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

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

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

    • 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

    • 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

  33. Jennifer says:

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

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

  34. Z says:

    Hi,

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

    thanks

    • 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

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

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

  37. mplunder says:

    1.4 version works great :D thank you very much

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

  39. mplunder says:

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

  40. mplunder says:

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

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

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

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

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

  45. Keith says:

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

  46. roy says:

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

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

  48. Roy says:

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

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

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

  50. Pascal says:

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

    Thanks a lot!!!

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

    • 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

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

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

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

    • 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”);

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

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

  56. Mario says:

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

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

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

    • 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

Leave a Reply

Login Forum
Info