There’s no doubt that since the inception of the internet, the fight against content theft has always been on the increase as content thieves are always on the rise.
In this short tutorial, I’ll be guiding you through a set of ways you can easily disable right click on your website, blog or webpage using any of the methods below.
Before we continue, one thing you should bear in mind is that disabling right click can be useful in some websites and become useless for others. For instance, disabling right click on this blog (oscarmini.com) would do more harm than good as many people won’t be able to copy various codes I’ve given out here. So use this function wisely.
Disabling Right Click Using HTML Body Tag
After you must have designed a webpage let’s say using DreamWeaver, it is very much easy to disable right click by means of adding oncontextmenu handler in body tag of webpage.
When you view the source code of your newly designed webpage, search for <body>, add the oncontextmenu handler to it as
<body oncontextmenu=”return false;” >
Then Save. It works like charm, your content would be more secured as right click would be disabled.
Disabling Right Click Using CSS
-webkit-user-select: none; /* Chrome all / Safari all */
-moz-user-select: none; /* Firefox all */
-ms-user-select: none; /* IE 10+ */
Add it to your site’s CSS file and save. Right click would be disabled in the selected region.
I hope you find this guide useful. Feel free to let us know any problems you encountered using the comment box below.