It's More than a Technology blog...

Liked us?

Pin It

Disable Right Click Menu on Images in Blogspot Blog.

Images is the most important factor, which brings huge amount of traffic to your blog. They gives your content a new look and fills life in it. Images plays an important role in SEO of every blog, every blogger must know about image optimization.

So guys well if you are a blogger and wants to keep your content away and safe from content copiers then this trick will really work for you. Installing the below provided HTML code disable the right click menu, so if the menu is disabled then the copier is unable to reach till the copy option included in Right Click Menu.


So there's zero chances of getting your image stolen by content copiers and hence it's a awesome to be protected and safe from content copiers. To disable Right Click Menu on your blog's images then just follow below simple steps :

1. Go to Draft.Blogger.com and login to your blogger dashboard.

2. Then navigate to template and click on Edit HTML.

3. Now press Ctrl + F keys to open the find dialog box and search for tag and paste the below provided script right above it.

<script type="text/javascript">
///* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Disable context menu on images by GreenLava (BloggerSentral.com)
Version 1.0
You are free to copy and share this code but please do not remove this credit notice.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
    function nocontext(e) {
        var clickedTag = (e==null) ? event.srcElement.tagName : e.target.tagName;
        if (clickedTag == "IMG") {
            alert(alertMsg);
            return false;
        }
    }
    var alertMsg = "Right Click Menu on Images is disabled";
    document.oncontextmenu = nocontext;
//]]></script>

4. Now after pasting the above script, Save your template and view your blog to test this newly installed script.

5. You can also change the error message highlighted in red color according to your wish.



Disabling Right Click Menu on Specific Images

If you want to use this feature in some specific posts of your blog, then you can use this to disable right click on specific images in specific blog posts. This code will only work for specific images, it will not work for all images on your blog.

All you have to do is just paste the below code in image tag of the specific image in your blog post.

oncontextmenu='alert("Image context menu is disabled");return false;'

Your normal image tag will look as shown below :

<img border="0" 
src="http://lh3.ggpht.com/-hFLv1pMH67s/T7HbM_Zy-3I/AAAAAAAADt8/6YTHSZg4VhY/knowledge%25255B8%25255D.jpg"
 />

Now after adding the above right click disabling code for specific images, your image tag will look like below :

<img oncontextmenu='alert("Image context menu is disabled");return 
false;' border="0" 
src="http://lh3.ggpht.com/-hFLv1pMH67s/T7HbM_Zy-3I/AAAAAAAADt8/6YTHSZg4VhY/knowledge%25255B8%25255D.jpg"
 /> 

So now you are ready to fight against content copiers, the above trick will disable right Click Menu on images in your blog post and also works fine for specific images.


Twitter Delicious Facebook Digg Stumbleupon Favorites More