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
- Download the plugin.
- Upload the plugin to your wp-content/plugins directory.
- 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.
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
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
This plugin does’nt work with WordPress 3.01 and Chrome….
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.
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
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.
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
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”);
Simply the most useful plugin I have ever seen,
thank you,
dave.
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
WP 3.1.2 seems to have broken something. I have three plugins affected by this and I am looking into it.
Keith
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
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
That’s actually my theme I’m working on. I’ll fix that.
Thanks a lot!!!
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
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.
Hi
sorry to be a pest, but I have no idea how to do this.
thanks
Roy
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
Hi
thank you so much m8 – you the man.
Roy
Version 1.3 is live on the wordpress repository. Update if you need the new functionality.
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!
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.
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
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!
same as Magellan… can play anymore lightbox pictures… after I deactivate the plugin, it works again
im sorry, i wanted to say CAN’T USE LIGHTBOX ANYMORE with 1.3 version of this script
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
1.4 version works great
thank you very much
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.
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
Hi,
Great plugin but how can i assign this to all of my pages/gallerys?
thanks
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
This is a great plugin. Thank you! Just curious if it affects the images SEO at all?
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.
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
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
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
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
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
Will do. Thanks Keith.
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.
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
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
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
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!
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
Great plug-in!
It doesn’t work if the browser is on the iphone/ipad though.
I guess that safari on the iphone/ipad is dumbed down. I test on safari, and most things work fine with it.
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?
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