Here I am sharing you a code snippet which you can use to protect your specific page to be copied. This Code will disable Right Click, CTRL+C and CTRL+V etc. I got this code from StackOverflow.com and modified it a little so that you can use it for your WordPress Page.
Just change the Page ID in the code with your own page ID which you want to be protected.
<?php
if(is_page('YOUR PAGE ID')){?>
<script>
jQuery(document).ready(function() {
jQuery(function() {
jQuery(this).bind("contextmenu", function(e) {
e.preventDefault();
});
});
});
// Disable Right click
document.addEventListener('contextmenu', event => event.preventDefault());
// Disable key down
document.onkeydown = disableSelectCopy;
// Disable mouse down
document.onmousedown = dMDown;
// Disable click
document.onclick = dOClick;
function dMDown(e) { return false; }
function dOClick() { return true; }
function disableSelectCopy(e) {
// current pressed key
var pressedKey = String.fromCharCode(e.keyCode).toLowerCase();
if ((e.ctrlKey && (pressedKey == "c" || pressedKey == "x" || pressedKey == "v" || pressedKey == "a" || pressedKey == "u")) || e.keyCode == 123) {
return false;
}
}
</script>
<?php } ?>
All anyone has to do in order to overcome this is to just disable Javascript, so… pretty useless really.
LikeLike
Hi Tim
thanks for your opinion, but this technique may help someone.
Regards
Om
LikeLike