You are probably part of those blog owners who wants to disable right click or context menu on their images in order to prevent people from stealing your images.
Before I get started with this article, I would like to tell my beloved readers to please always make requests of anything they want regarding a post by dropping their comments on that post. That way other people too and not just only me will be able to address your question. Others might even have a better solution. Only contact me for personal or business purposes. Thank you.
I briefly wrote that because of the number of e-mails I got asking me to post this article as I have already promised in one of my previous article. Thanks, I love you all.
In one of my previous articles, I talked about how to disable right-clicking on a single image on your Blog. Many people complained it’s time-consuming having to insert the code in each img tag one by one which I think is right.
Now let’s go back to our main objective: How to disable right-click context menu on your image. This will take effect on all the images you have on your blog.
Go to your template file and open to edit it. Paste the following script just after the tag
<script type="text/javascript">
// <![CDATA[
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Disable context menu on images by Nigeria's Topmost Technology Blog (Cynamix.net)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
function nocontext(e) {
var clickedTag = (e==null) ? event.srcElement.tagName : e.target.tagName;
if (clickedTag == "IMG") {
alert(alertMsg);
return false;
}
}
var alertMsg = "Image context menu disabled";
document.oncontextmenu = nocontext;
// ]]></script>
The javascript above will disable context menu and whenever someone right click, an alert box will show containing the message in line 15. So, you can replace the message in that line with whatever you want.
You might also want to prevent the alert box from showing. If you don’t want the alert box to show at all, just remove this line (line 15) from the code:
//var alertMsg = “Image context menu disabled”;
You are all done now! Try it out on your website and see how it works!
HOPE THIS HELPS!
If you don't want to miss anything on Cynamix please like us on Facebook and follow us on Twitter You can also subscribe to our updates by email or with your favourite browser. This way, you won't miss any updates from cynamix. If you subscribe by email, make sure to check your email to confirm your subscription.| Follow @cynamix |
Don't keep this to yourself, Share it with your friends with the Buttons below.

It’s really a nice and helpful piece of info. I am happy that you just shared this useful information with us. Please stay us informed like this. Thanks for sharing.