How to prevent copying of articles from your webpage? Serverhosthub – The Hosting Platform Made For You – Go Online With Hosting serverhosthub | free hosting | Linux shared hosting | Hosting | Free domain | Life time Free ssl certificate | Chepest web hosting | Low price hosting | Domain Transfer

Today in this document we will guide you how to stop copying articles from your webpage. Here we will show you how you can prevent copying of articles from your HTML website.

video tutorial– “How to prevent copying of articles from your webpage?”

To prevent copying of articles from your HTML website you need to add the code given in below link in your HTML page:

Code to disable selection on your webpage

<html>
<head>
<style>
body, html{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>
</head>
<body oncontextmenu="return false;">
Here is my code. Select me.
</body>
</html>

Code to disable right click on your webpage

<html>
<head>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></s
cript>
<script>
jQuery(document).ready(function(){
jQuery(function() {
jQuery(this).bind("contextmenu", function(event) {
event.preventDefault();
alert('Right click is disabled on this site!!')
});
});
});
</script>
</head>
<body>
Here is my code. Right click on me.
</body>
</html>

code to disable ctrl key combination on your webpage

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Disable Ctrl Key Combinations </title>
<script language="JavaScript">
function disableCtrlKeyCombination(e)
{
//list all CTRL + key combinations you want to disable
var forbiddenKeys = new Array('a', 'n', 'c', 'x', 'v', 'j' , 'w');
var key;
var isCtrl;
if(window.event)
{
key = window.event.keyCode; //IE
if(window.event.ctrlKey)
isCtrl = true;
else
isCtrl = false;
}
else
{
key = e.which; //firefox
if(e.ctrlKey)
isCtrl = true;
else
isCtrl = false;
}
//if ctrl is pressed check if other key is in forbidenKeys array
if(isCtrl)
{
for(i=0; i<forbiddenKeys.length; i++)
{
//case-insensitive comparation
if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
{
alert('Key combination CTRL + '+String.fromCharCode(key) +' has been disabled.');
return false;
}
}
}
return true;
}
</script>
</head>
<body onkeypress="return disableCtrlKeyCombination(event);" onkeydown="return disableCtrlKeyCombination(event);">
Press ctrl and you can check various key is disable with CTRL. like — 'a', 'n', 'c', 'x', 'v', 'j' , 'w' Just add key in above the array and disable key as you want.
</body>
</html>

Put these codes in your html page and check that page with your web browser.

You will find that all the features used to copy something from your webpage have been successfully disabled. In fact, no one will even be able to drag and drop any line on your website.

Thanks for reading this article!!! We hope this was helpful to all of you.