How to Protect your Website from being Copied

Steps to protect website content:

  1. 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.
  2. <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>
    
  3. Disable CTR+U using Javascript, to prevent visitors from viewing the source code.
  4. <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>
    
  5. Disable text selection using CSS code.
  6. * {
      -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 */
    }
    
  7. 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.