How To Disable Right Click Using jQuery

Posted by Lasantha Bandara on October 28th, 2015 File Under : java script, jquery17 Comments

This article explains to you how to disable right click function using a simple jQuery code snippet. If you like to add this feature to your site, then follow the steps below.

1.Login to your blogger account and go to "Edit HTML".

2.Scroll down to where you see </head> tag .

3.Copy below code and paste it just before the </head> tag.

<script src='' type='text/javascript'></script>
<script src=''></script>

<script type='text/javascript'>

jQuery(document).ready(function($) {
    $(document).bind("contextmenu", function(e) {
        return false;


NOTE : If jQuery is already included into your theme remove these lines from the above code:

<script src='' type='text/javascript'></script>
<script src=''></script>

4.Now save the template. Refresh your site and try to right click on your website or blog.

File Under : java script, jquery

17 Responses to “How To Disable Right Click Using jQuery”

  1. Beben says:

    hehehe...some people added no right click trick, you created disable creative...good good

  2. maddy says:

    didn't work for me Lasantha Bandara,

  3. Rodrigo Medeiros says:

    It works! I love it! ^^

  4. ehtrthj says:

    tanks for this! how did u put the reply at comments?

  5. Injun Jim says:

    didn't work for me

  6. Rojin Giri says:

    It didn't work with my blog

  7. Desibaba says:

    Great simple code. Thank you. It is working.

  8. Bon Jovi says:

    it rocks !!! work for me ..

  9. isare says:

    work for me..thanks

  10. Anonymous says:

    works for me


  11. KiranKumar Roy says:

    thanks a lot.
    it works for me..

  12. KK says:

    Superb Works For me

  13. Maarja says:

    Works perfectly!

  14. Varinder Pal Singh says:

    Wow Amazing It 100% Works Thankssss

  15. travelonashoestring says:

    YEHEY! It worked for me!

    Thank you Lasantha! You're the best!

  16. Pakualam says:

    Nice trick to disabling the text on blogger.. I intend to apply on my blog then, thanks for the tutorial 🙂

  17. Colin says:

    It works but if you hit F5 and then quickly right click you can bypass the script before it gets a chance to re-load. It's impossible to protect images without a watermark anyway but nice simple code example :O)

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.