How To Disable Copy Paste in Blogger To Protect Content

 How to Protect Your Website Content from Copying and Printing for blogger

Steps to Implement:

  1. Log in to your Blogger account.
  2. Go to the Theme section.
  3. Click on Edit HTML.
  4. Add the following JavaScript code before the </body> tag.
How To Disable Copy Paste in Blogger To Protect Content


<script>
// Disable right-click
document.addEventListener('contextmenu', function(e) {
    e.preventDefault();
    alert('Right-click is disabled on this website.');
});

// Disable text selection
document.addEventListener('selectstart', function(e) {
    e.preventDefault();
});

// Disable Ctrl + U, Ctrl + S, Ctrl + P, and F12 (View Source/Inspect Element)
document.addEventListener('keydown', function(e) {
    if (e.ctrlKey && (e.key === 'u' || e.key === 's' || e.key === 'p') || e.key === 'F12') {
        e.preventDefault();
        alert('This action is disabled on this website.');
    }
});

// Disable Print (Ctrl + P and Print Screen)
document.addEventListener('keydown', function(e) {
    if (e.ctrlKey && e.key === 'p') {
        e.preventDefault();
        alert('Printing is disabled on this website.');
    }
});

// Disable Print Screen (PrtSc)
document.addEventListener('keyup', function(e) {
    if (e.key === 'PrintScreen') {
        alert('Screenshotting is disabled on this website.');
        navigator.clipboard.writeText('Screenshots are disabled on this site.');
    }
});

// Clear Clipboard on Copy Attempt
document.addEventListener('copy', function(e) {
    e.preventDefault();
    alert('Copying content is disabled on this website.');
    navigator.clipboard.writeText('');
});
</script>

How To Disable Copy Paste in Blogger To Protect Content

Explanation of Features:

  1. Disable Right-Click: Prevents the context menu from opening.
  2. Disable Text Selection: Stops users from selecting and copying text.
  3. Disable Dev Tools: Prevents users from accessing developer tools with common shortcuts like Ctrl+U or F12.
  4. Disable Printing: Blocks the Ctrl+P shortcut and alerts users.
  5. Disable Screenshots: Alerts users when the Print Screen key is pressed.

Post a Comment

Thanks for Comment

Previous Post Next Post