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.
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
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?
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.
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
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.
http://wordpress.org/extend/plugins/no-right-click-images-plugin/download/
Make sure that you have unchecked the box for allowing logged in users before you test.
Keith
I’m with everyone else…the new update allows right-click.
Sorry…didn’t see you earlier comment. I did what you suggested and it’s working fine. Thank you!
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
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.
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?
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
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!
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.
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!
The plugin activates in the footer. If your template does not call wp_footer then the plugin will not work.
Keith
I just checked your site. The plugin is installing, but the javascript is not loading. It is supposed to be at
http://tracyriddell.com/wp/wordpress-content/plugins/services10/webpages/t/r/tracyriddell.com/public/wp/wordpress-content/plugins/no-right-click-images-plugin/no-right-click-images.js
This is looks very wrong. The installation appears to be very strange, not a standard install.
Keith
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?
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