Blogger

How to Disable Copy Paste in Blogger Blog, Protect Content 2022

So you decided to disable copy-paste function for the Blogger blog? This article will help you to understand the pros and cons of doing so, and how you can disable copy-paste.

When you write a blog on the Blogger content management system and want nobody to copy the content, you can follow this guide. Blogger supports XML theme. We’ve to apply some code to the XML theme file to generate a protected HTML output.

how-to-disable-copy-paste-blogger
disable-copy-paste-blogger

First, we’ll understand how we can disable copy-paste function for the whole page and a specific part. That will give more control over the Blogger blog.

How to disable Copy Paste of Complete Page in Blogger

When you disable copy-paste of complete Blog, your blog will not support right-click, ctrl+c, ctrl+v, or selection tool in mobile.

The following script will disallow any function under the body section. You’ve to edit the Blogger XML file and paste this code just above the </body> tag. The </body> tag can be found in the last lines of the XML Blogger theme.

<script type="text/javascript">
    $(document).ready(function() {
        //Disable cut copy paste
        $('body').bind('cut copy paste', function(e) {
            e.preventDefault();
        });
        //Disable mouse right click
        $("body").on("contextmenu", function(e) {
            return false;
        });
    });
</script>

The above script will perform two actions,

  • The first part will disable copy-paste function from the page,
  • The second part will disable the right click of the mouse.

This code will now will not allows website visitors to copy any content from the page.

The below code is most useful as this will function only for a specific part of the page. You can paste the code just above the </body> tag in the XML theme file of the Blogger blog.

<script type="text/javascript">
    $(document).ready(function() {
        //Disable cut copy paste
        $('article').bind('cut copy paste', function(e) {
            e.preventDefault();
        });
    });
</script>

You’ve to paste save this code into the theme HTML and done. Whatever content you’ll write will be protected. Please note that this code will not give any warning like content is protected, which will irritate the visitors.

Suppose a visitor wants to read a complete article of your blog, and you provided an external link for reference. In that case, the user will right-click from the mouse, and if there is no response of click, it will annoy the user. In that case, the user may leave your website, which is called pogo-sticking. So you’ve to take care of the website visitors too.

If you want to disable right-click too, you can paste the following code instead of the above. But we’ll recommend you to use the above code.

<script type="text/javascript">
    $(document).ready(function() {
        //Disable cut copy paste
        $('article').bind('cut copy paste', function(e) {
            e.preventDefault();
        });
        //Disable mouse right click
        $("article").on("contextmenu", function(e) {
            return false;
        });
    });
</script>

If the above code is not working: you are using a basic HTML theme that is not SEO friendly as the above code will work only with the HTML5 page structure theme. In that case, you can download the Oyedad Blogger theme designed by our SEONeurons Team.

I hope you liked our article on disable copy-paste function in Blogger. In case of any doubt or query, feel free to ask in the comment section provided below.

Ashok Sihmar

Ashok Kumar working in the Search Engine Optimization field since 2015. And worked on many successful projects since then. He shares the real-life experience of best SEO practices with his followers on seoneurons.com. You also can learn Advance level SEO for WordPress, Blogger, or any other blogging platform. Stay tuned.

4 Comments

  1. Sir you know how to do this but you dont applied this to your web. Why? Is there any bada effect if we put this script on our blog? Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button