Disable right click without using JavaScripts

Disabling right click on websites and blogs are very popular nowadays just to ensure that no one can copy content from their website.
Using JavaScripts provided by many websites on blog or website to protect content from being copied is very popular. JavaScripts can be of different types depending on it's author, they can put whatever they want and block right click on webpages.
But JavaScripts have it's own bad effect on blogs, because most the JavaScripts provided to disable right click on webpages sends out an alert message whenever someone right clicks and it is irritating. And JavaScripts can be easily bypassed and allow the right click.
So what you want is a hassle free way to stop peoples from right clicking on your page and copy your contents.

One benefit of having right click disabled is that you can stop most visitor from copying your contents, but there can be some people knowing ways to bypass it, but hope you don't have such visitors who will copy your content.

The real trick

Almost everywhere you will see tricks to disable right click using JavaScript, but if the user disables JavaScript they can easily use right click on your website without any difficulties. JavaScript is not an ideal way to do it.
We have got a new way to disable right click without any implementation of JavaScripts that can slow down your page. I came to knew about this while I was in a net banking site, just used the chrome developer tool tools to inspect what they used to disable right click and found it.
It was a small attribute in the body tag of the document. So follow the steps to do it on Blogger, this can implemented on any website, just find your main HTML and add this attribute in the <body> tag.


For Blogger Users - 

  1. Go to Blogger Dashboard
  2. Select Template tab
  3. Click on Edit HTML > Proceed
Now click CTRL+F and find enter this <body into the search box, you will find something similar to this

<body> tag is just below the ending </head> tag. Now when you find it, copy this small code snippet or a short code word.
oncontextmenu="return false;"

When copied, go back to the Edit HTML of your Blog and paste this after
<body with a space in between. So it must look something like this

Once you have added the attribute in the body tag refresh your blog with CTRL+F5 and try to right click, now you have right click disabled on your blog/website ! Great, people can't copy your content.

Negative points in using JavaScript for this ?

You can rank JavaScript 2nd to play the trick of disabling right click on a website but there are some negative points of JavaScript. Read those below
  • Most JavaScripts uses alert message which can annoy regular users
  • If the page load is interrupted when the page is loading then JavaScript don't work which will result in letting others copy your contents with right click.
  • Those who want to copy the content they can disable JavaScript in their browser and they can copy the content again. 
  • JavaScript slows down the page loading speed 
So, these were some negative points of using JavaScript to disable right click, simply use the small attribute to make it work like the JavaScript does.

Will it completely disallow the user to copy contents ?

You must accept the bitter truth that there's no technique which can keep everyone from copying contents or pictures from a site. They can use many ways to do this, but if you don't have some wicked minded people on your blog then it's guaranteed that your content will be less copied from your site. Using this trick is better than not using it.
  • Additionally you may also disable text and image selection on your page for better protection - Click to know about it

Your feedback

As always your opinions and feedback is important for us because you are the one who makes our post more valuable and worth reading. Drop your comments to express your thought on this tutorial.