Why Disable Text Selection in Blogger website?

Hello, So today I am gonna to give you a anticopying script for Blogger Templates which is fast and very lightweight.


This would be the best and smallest code I have ever made. I had given 3 methods in which advanced is the best method. So, let's get started.......

Why Disable Text Selection in Blogger website?

You should Disable Copy Paste in Blogger or any other website because there are lots of thieves of your content. while most of the new bloggers don't like to write content due to lack of knowledge and other reasons. 
In my case, our Anand Nawal website we already use this to prevent our unique content, but let me tell you the Most obsessed part is Google takes no action to this. Even sometimes Google assigns a higher rank to that duplicate content. Sad Right! 

 So Use any one of the below methods as per your website needs, Let's Start


Steps to Disable Text Selection & Copy-Paste Function in Blogger

The following are 3 Methods and Steps to use in your Blogger template.



 

METHOD 1: USING PURE CSS - MOST PREFERED METHOD [USE THIS]

In this method, Paste Below CSS Style in your template by following some steps.
  1. Go to Blogger Dashboard
  2. Go to Theme/Template Section
  3. Click Edit HTML
  4. Now Search for  </head>  or Find & Past Below STYLE CSS Code Before ]]></b:skin> 

<style type='text/css'>
body{
display:block;-khtml-user-select:none;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
-o-user-select:none;
user-select:none;
unselectable:on;
}
</style>
Now Save Template and check are you able to select anything? 
No Right! 
(Sorry for those who taught there will be a very difficult and long solution :). 
NOTE: It is applied to complete Website Body If you want to use only for Post content then you just need to change the body tag to your post-class like

<style type='text/css'>
article-content, post-entry, etc {
display:block;-khtml-user-select:none;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
-o-user-select:none;
user-select:none;
unselectable:on;
}
</style>
If the above Disable Text Selection CSS is not working for you then Check Your Post Class for this in your template and put that in style in place or etc.  
Now If you provide CODE or QUOTES in your website then Enable Copy Paste in your pre, blockquote, and code tags. 
By using the above CSS and Below CSS users will only be able to copy from pre, blockquote, and code tags.

<style type='text/css'>
blockquote, pre, code {
user-select: text !important;
-webkit-user-select: text !important;
-ms-user-select: text !important;
-moz-user-select: text !important;
}
</style>

METHOD 2: Using jQuery to disable Copy-paste function in blogger blog [USE THIS ONLY AFTER READING ABOVE METHOD ]

Follow the below steps -
  1. Go to Blogger Dashboard
  2. Go to Theme/Template Section
  3. Click Edit HTML
  4. Now Find & Past Below SCRIPT Code before </body>

<script>
$('body').bind('copy cut drag drop', function (e) { e.preventDefault(); });
</script>
That's It: If you want to target a specific Class or tags then replace 'body' with some other tags or class as '.className'. So, now it's time for a more advanced method.


METHOD 3: Using Advanced Javascript to prevent Copy paste in blogger blog [USE THIS ONLY AFTER READING ABOVE METHOD ]

Follow the below steps -
  1. Go to Blogger Dashboard
  2. Go to Theme/Template Section
  3. Click Edit HTML
  4. Now Find & Past Below SCRIPT Code before </body>
CODE 1: SIMPLE

<script type='text/javascript'>
if (typeof document.onselectstart!="undefined" ) {
document.onselectstart=new Function ("return false" );
}
else {
document.onmousedown=new Function ("return false" );
document.onmouseup=new Function ("return true" );
}
</script>
CODE 2: ADVANCED

<script type='text/javascript'>
// PREVENT CLIPBOARD FOR COPYING CONTENT
document.addEventListener("copy", function(evt){
// Change the copied text if you want
evt.clipboardData.setData("text/plain", "Copying is not allowed on this webpage");

// Prevent the default copy action
evt.preventDefault();
}, false);
</script>
Code 2 is very secure to use as it prevents Shortkey also. Working on this code is
  • We listen to the copy event.
  • If you want, you can change the copied text in the clipboard with evt.clipboardData.setData("text/plain", "WRITE YOUR MSG").
  • Finally, as usual, we prevent the default copy action – evt.preventDefault().

For a complete demo of the script with a proper installation and usage guide please watch the complete video.

Disable Text Selection & Copy Paste in Blogger



In Conclusion of Best Way to Disable Text Selection and Disable Copy in Blogger or any site. 

Indeed, shield your substance from copy-pasters bloggers. so presently in the wake of perusing this article on the best way to Disable Copy paste in blogger. You have effectively Block copy-pastes on your blogger blog. 

I have attempted to be just about as instructive as conceivable in this article. I trust that this stunt will assist you with ensuring your barely composed substance by utilizing any of the previously mentioned techniques. 

In the event that whenever you would prefer not to handicap copy-paste highlights on your blogger blog. You can empower that provisions simply by eliminating the where you paste the code utilizing this instructional exercise. Your blog copy-paste element will be re-empowered then, at that point. 

On the off chance that you have any issues or have any ideas. Tell me them in the remarks area.