DEV Community

Cover image for How to Disable Copy Paste in Blogger Website
Bhavyashah
Bhavyashah

Posted on

How to Disable Copy Paste in Blogger Website

This tutorial explains the process to disable the Copy and Paste of Website, either of WordPress or Blogger. It is useful for those who log on their each each time they want to make a change to their website and they need to be able to make changes. A short tutorial of how you can disable copy and paste in blogger website

Step1) First of all Visit Blogger.com

Step2) Now In Blogger Dashboard go to the theme section

Step3) Now Find </body> tag and paste this script code before the </body> tag.

<script>
        // Code Developed by BlogTriggers Team members
        window.onload = function() {
            document.addEventListener("contextmenu", function(e) {
                e.preventDefault();
            }, false);

            function disabledEvent(e) {
                if (e.stopPropagation) {
                    e.stopPropagation();
                } else if (window.event) {
                    window.event.cancelBubble = true;
                }
                e.preventDefault();
                return false;
            }
        };
        document.onkeydown = function(e) {
            return false;
        }
        navigator.keyboard.lock();
    </script>
Enter fullscreen mode Exit fullscreen mode

Step4) Now Save the Template.

Congratulation you have successfully protect your content in blogger website

Top comments (5)

Collapse
 
jayjeckel profile image
Jay Jeckel

Be warned, disabling copying does nothing but annoy users. If you care at all about your users, then don't ever disable basic internet functionality like copy/pasting.

Collapse
 
tunis profile image
Tunis

True, and if people really want to copy your content they still can do it with devtool, saving the page, or simply disable js 🤣

Collapse
 
bhavyashah profile image
Bhavyashah

But our content is fully protected in mobile device

Collapse
 
jayjeckel profile image
Jay Jeckel • Edited

No, it isn't. There are dozens of ways to get around anti-user designs like this. I'd point out all the ways this could be bypassed, but that would miss the point: disabling basic internet features, like copy/pasting, is bad practice and is rude to users. Just don't do it.

Thread Thread
 
bhavyashah profile image
Bhavyashah • Edited

Ohh, Thanks bro Now I am understand