Many people these days, will visit your blog, highlight your content, right-click they copy and repeat. They still termed themselves, blogger.
However, disabling right-click on a website only stop some real human from copying your content. It can not prevent the sophisticated scrapper available in the market today.
It cannot even stop all human. If any geek wants your content at all cost, there are always ways to get it. Even after you’ve deactivated right click on your website or page.
Also keep in mind that, disabling right-click on any webpage can annoy most of your legit user’s who are not there to copy your content. It sometimes affects the accessibility of your website, has user may not be able to navigate & interact easily with your content.
For example, deactivating right-click on your site also means your user cannot open another link in a new tab. So, therefore, use it wisely.
Deactivate/disable right click using HTML
You can use a simple HTML tag to stop right-click on any element on your website, or any CMS system, e.g. WordPress, Blogspot etc.
Add the below code to the HTML body of your website & it will prevent /stop right-click from working on such page.
<body oncontextmenu="return false;">
The on the context menu is an Html attribute that disables right-click on an Html document, just set its value to “return false”. It works fine.
Deactivate text selection with CSS
This one is my favourite method of protecting your website post by disabling right-click with CSS code.
Though we are not deactivating right-click here, we are just using the user-select CSS property to disable the ability to select text.
So when you right-click, on the context menu you won’t see the copy option.
Add the CSS snippet below to your site CSS code to disable right click and test selection.
To me, it is no longer a reliable method; you may need to combine it with other Html and CSS trick to be safe.
This post is just a short guide on content protection; A definite guide is coming soon that will cover almost all aspect of online content safety.
If you find this tutorial informative, Feel free to share with your family and friends.
Do you face any problems while trying to implement this technique, kindly use the comment box below to get help.