How to prevent copying of articles from your webpage?

How to prevent copying of articles from your webpage? [STEP BY STEP]☑️

Today in this documentation we will guide you how to prevent copying of articles from your webpage. Here we will explain you how to prevent copying of articles from your HTML website.

Video Tutorial– “How to prevent copying of articles from your webpage?”

In order to prevent copying of articles from your HTML website you need the add the codes given in the link below in your HTML page:

Code for Disabling 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 for Disabling 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 for Disabling 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>

Insert these codes in your html page and check that page from your web browser.

You will find that all the features which are used to copy something from your webpage have been successfully disabled. In fact, no one will be able to select any line on your website not even by dragging and dropping.

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

For more information, kindly follow us on social media like Twitter and Facebook, and for video tutorials, subscribe to our YouTube channelhttps://youtube.com/redserverhost

Facebook Page https://facebook.com/redserverhost

Twitter Pagehttps://twitter.com/redserverhost

If you have any suggestions or problems related to this tutorial, please let us know via the comment section below.

Tags: cheap Linux hostingbuy linux hostingcheap reseller hostingbuy reseller hostingbest reseller hostingcheap web hostingcheapest web hostingcheapest reseller hosting,  cheap reseller hostcheap linux hostcheapest linux hostingbest linux hostingbest web hosting

Scroll to Top