How to stop users from copy pasting content from my web page

If you are a web master of a blog or a company owner who doesn’t want employees/customers/visitors copy pasting (literally) your content then there is a nice solution you can use to discourage and maybe stop them from doing so.

A simple CSS code will help you to stop the user from selecting and copying your content. The user will neither be able to use Ctrl-A (selecting all content) nor select the specific content on the web page through their mouse.

Add the following code in the <head> section.

<style type="text/css">
.unselectable {      
 -webkit-user-select: none;       
-webkit-touch-callout: none;      
 -moz-user-select: none;       
-ms-user-select: none;       
user-select: none;          
}
 </style>

You can then add this class to any tag and it will disallow any selecting of text on the web page. If you apply it on the <body> it will be applied all the content inside the body tag.

<body class="unselectable">

However I would like to point out that it is impossible to think that you can stop others from copying your content all the time as there are various tools and work around which can be used to bypass your solution completely like scraping or using inspect element on Google Chrome or other browsers to bypass this CSS class. So look to use it where you feel the technical acumen of your user audience is not that high. If you are planning to use it on the internet then be prepared to be disappointed.

Hope the above helped.

Please follow and like us: