How to disable mouse right click on blogger website - HTML code to disable right click on any page

Learn how to disable right-click on your website using JavaScript. Find out how to protect your content by preventing users from accessing the context menu and saving or viewing the source code of your pages. Explore the pros and cons of disabling right-click and alternative methods for protecting your content.

Context menu Right-click menu Context menu disable Disable right-click Right-click blocking Right-click protection Right-click prevention Right-click prevention JavaScript Right-click prevention code Right-click prevention script
How to disable mouse right click on blogger website - HTML code to disable right click on any page

  Follow Us  

What is Right Click Disable?


Right-click disable refers to a feature that prevents users from accessing the context menu when they right-click on a webpage. 

The context menu is a menu that appears when a user right-clicks on a webpage and typically includes options such as "Save Image", "View Page Source", and "Inspect Element". 

By disabling right-click, a website can prevent users from accessing these options and make it more difficult for them to save or view the source code of the page. 

This can be used as a means of protecting content on the website, although it is not a fool proof method and can be bypassed by advanced users or through the use of browser extensions or other tools. 

Disabling right-click is typically done using JavaScript code that listens for the contextmenu event and cancels the default action, which is the display of the context menu. 

It is important to note that disabling right-click can be seen as a form of user-unfriendly behaviour, as it can prevent users from accessing certain features or functions that they may rely on. 

Therefore, it is generally recommended to allow right-click and instead consider other methods for protecting your content.

How it protects your content?


There are a few ways in which disabling right-click can be used to protect content on a website: 

  1. Preventing users from accessing the context menu: By disabling right-click, users will not be able to access the context menu, which typically includes options such as "Save Image" or "View Page Source". This can make it more difficult for users to save or view the source code of your content.
  2. Disabling text selection: In addition to disabling right-click, you can also use JavaScript to disable text selection on your website. This can make it more difficult for users to copy and paste text from your site.
  3. Disabling the ability to save images: You can use JavaScript to disable the ability to save images from your website by preventing the browser from displaying the "Save Image As" dialog when an image is right clicked.
It is worth noting that these methods are not fool proof and can be bypassed by advanced users or through the use of browser extensions or other tools. Therefore, it is generally recommended to use other methods for protecting your content, such as watermarking images or using digital rights management (DRM) technologies.

Steps to disable right click


This code uses the contextmenu event, which is triggered when the user right-clicks on the page. The preventDefault() method is used to cancel the default action of the event, which in this case is the display of the context menu. 

To disable right click follow the following steps

  1. Go to blogger dashboard.
  2. Go to theme.
  3. Click on edit html from the drop-down menu.
  4. Press Ctrl + F and search <body>
  5. Copy the following code
  6. Paste it below the <body> tag.
  7. Save the theme.

Video Tutorial



Previous Post Next Post