Steps to protect website content:
- Disable right-click : Implement JavaScript to prevent users from easily copying text or saving images.
Watermark Images: Add watermarks to your visuals to deter theft.
Obfuscate Code: Minimize or obfuscate your website’s source code to make it harder to copy. - Disable CTR+U using Javascript, to prevent visitors from viewing the source code.
- Disable text selection using CSS code.
- Use Copyright and Legal Notices: Display copyright statements and terms of use to clarify ownership and prohibit unauthorized copying.
Use DMCA Protection: Register your site with the DMCA and display a badge to warn potential infringers.
<script type="text/javascript">
document.addEventListener("mousedown", function(e) {
if (e.which === 3) { // if e is 1, it is left click, if it is 3 it is
// right click
alert("© your website 2024"); // this will pop up a message saying you
// click the right button
}
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
document.onkeydown = function(e) {
if (e.ctrlKey &&
(e.keyCode === 67 ||
e.keyCode === 86 ||
e.keyCode === 85 ||
e.keyCode === 117)) {
return false;
} else {
return true;
}
};
$(document).keypress("u",function(e) {
if(e.ctrlKey)
{
return false;
}
else
{
return true;
}
});
</script>
* {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Old versions of Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera and Firefox */
}