Disable Copy Function On Blogger With CSS or JavaScript

SHARE
Disable Copy Function

Most of the genuine bloggers on BlogSpot platform face the problem of their blogs' content being copied or duplicated by newbies who are just entering in the blogosphere with the goal of making money without making real efforts and understanding the value of original/unique content. Sometimes the content copied by them gets higher rankings in search engines than your original content and this is unfair which lowers the motivation of genuine bloggers. So it is important to protect your blog content from these content thieves and this is the agenda of this post. We will disable the copy function by disabling the mouse right click and CTRL+A. We have two options for doing this i.e., via a JavaScript Code if you want to disable whole text area of blog or via CSS code if you share some codes/text on your blog posts and your readers need to copy them.



Disable Text Selection On Blogger With JavaScript Code

Recommended Article: Change Scrollbar color and Text Selection Color in Blogger

Go to Blogger→Template→Edit Template→Backup Your Template Code First.
Now search for <head> and copy paste the JavaScript Code given below after <head> tag.
(Note: - use Ctrl+F in Windows and Cmd+F in Mac to search for code in template)

<!--Disabe Copy Paste--- TB-->
<script language='JavaScript1.2'>
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function (&quot;return false&quot;)
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>

Now save your template and view your blog to check the results.


Disable Text Selection Except Specified Codes/Text With CSS


This is the magic code we are using on this blog because we are sharing tutorials where readers need to copy some codes we share like CSS/JavaScript/Html etc. So on the same time we do not let readers copy our posts' text area other than codes/Text we want to share. This is possible with this simple CSS code where we enabled the copy paste of text/code we post in "blockquotes" only. Go to Blogger→Template→Edit Template→Backup.
Now search for ]]></b:skin> this code line and copy paste the CSS code given below before this ]]></b:skin> code line.
(Note:- use Ctrl+F in Windows and Cmd+F in Mac to search in template code)

/*----- Disable Text Selection with CSS Code--- TB----*/
.post blockquote {
-webkit-user-select: text !important;
-moz-user-select: text !important;
-ms-user-select: text !important;
user-select: text !important;
}
body {
-webkit-user-select: none !important;
-moz-user-select: -moz-none !important;
-ms-user-select: none !important;
user-select: none !important;
}

Important Note:- In the above CSS code we have enabled the copy/selection of text/code we post using blockquotes by enabling .post blockquote but it may not work for you if your template is using different CSS class for blockquote for e.g., Our template using .post blockquote where your template may be using .post-body blockquote or blockquote. So in that case you need to replace .post blockquote with .post-body blockquote or blockquote in above CSS code.  If you do not share any codes or content than just copy paste this little piece of CSS code to disable all text area on your blog.

/*----- Disable Text Selection with CSS Code--- TB----*/
body {
-webkit-user-select: none !important;
-moz-user-select: -moz-none !important;
-ms-user-select: none !important;
user-select: none !important;
}

Note:  You can add CSS codes by simply going to Template Designer >> Add custom CSS and paste your code then save.

Benefit of using CSS Code rather than JavaScript ?

1) When we use JavaScript code, do you know what does a copy cat do? Simply disables JavaScript code inside browser and reload the page. Then everything goes into normal and anyone can copy the whole content.

Using CSS code we eliminate this factor as user usually can not disable the CSS. However, an experienced user can do it simply by inspecting elements and finding our CSS code snippet then delete it in browser but this task is far away from newbies. Experienced users rarely do that.

2) CSS codes are far better than JavaScripts as they do not lower the speed of your blog/website where JavaScript codes consume much time to load and make your blog load speed very low and overall you lose Visitors=Money. Avoid using JavaScripts.

Let us know where these codes worked for you or you are having problems with these codes? We will serve you our best. Thank You.
Author

Article By: Satbir Patial

I manage this blog and post tutorials related to Blogger, SEO, Plugins, Widgets, Software Tools, CSS/HTML and Social Media. Did you find this blog helpful? Would You Please Socialize? Thanks for Your Support Buddy :)


Stay connected, You'll not be disappointed!

Newer Post
Previous
This is the last post.

52 Replies so far - Join Conversation

  1. Thanks, finally found something what's working (Y)

    ReplyDelete
    Replies
    1. Thanks Dude.. But i'm new here I just disable copy function with your CSS code. but how to enable copy /pest that I wanna share?? please help me..
      Thanks

      Delete
    2. Mr. Franch:: Hi,
      It's easy, all you have to do is add -webkit-user-select: text; to the class you share your codes in. For example, I share my codes using blockquotes so I have added it to my .post .blockquote class in my template code.

      If you did not get it, then just contact me via the contact us form and I will do my best.
      Thanks for leaving your comment!

      Delete
  2. Thanks Now if people even block JavaScript they cant copy thanks dude much appreciated

    ReplyDelete
    Replies
    1. Thanks for your appreciation Aaryan..!! Nice name :)

      Delete
  3. Thank you very much!!! Is it working also when we use the code in textarea? hmmm... just wondering :)

    ReplyDelete
    Replies
    1. We need to specify in CSS code about what we want to share or not... If you have blocked the whole textarea and use no CSS class to share the code, it will not work as the code you shared is also a part of textarea. So by using a CSS class, we allow the content within that particular CSS class to be copied while disabling other textarea of your post. And sorry if I did not get you :D

      Delete
  4. Replies
    1. Aleksandra Zobic :: You're welcome!

      Delete
  5. Its working but when i right click, it still shows select all.

    ReplyDelete
    Replies
    1. Christopher :: You must be trying JavaScript code and in JavaScript code, right click function is disabled but it will not let the user select the text on page. I recommend you to use CSS code because if users will disable the JavaScript or visit your web page from older version of IE, it will not work.
      Thanks for taking time to leave a comment.

      Delete
    2. I have also tried the css codes too. When i left click to copy, it does not copy but when i right click and select all, it selects all the post. Meanwhile on your blog, when i right click and choose select all, it only selects the blockquotes. Besides i have changed '.post blockquote" to ".post-body blockquote" and "bodyquote"

      Delete
    3. Wow, it has finally worked... Dam, I'm so happy.... I used the template designer>>add custom css and it is working perfectly fine, thanks for the code bro

      Delete
    4. Christopher :- Happy to know that finally it worked for you :)

      in reply to your previous comment-
      You said that you changed the .post blockquote class to ".post-body blockquote" and "bodyquote" right? and it did not work because-

      Actually you had to find the css class your temeplate is using for blockquotes in post area. You could not make it to work by changing classes randomly.

      Delete
  6. Dear friends please help me when i use script in blogger post than not show in my blog please help me my blog url is
    http://www.tricksweb.net/2015/06/how-to-disable-of-copying-text-in.html

    ReplyDelete
    Replies
    1. Hafiz Shahid:: hi,
      Sorry I did not get you. What do you actually want? Are you unable to use these codes?

      Delete
  7. its a great article bro, i applied it for my blog. than you for giving this article to us!

    ReplyDelete
  8. Hi,

    I am implemented this css code in my site instrumentationtools.com

    Working Excellent. Now i am searching for CSS code to disable the right click on images only to avoid copying of images only. Please help.

    Thanks'
    S Bharadwaj Reddy

    ReplyDelete
  9. Thank you! for right information. I have use it for my blog and it works well.

    ReplyDelete
  10. someone continually stealing my all blog post.what to do? i have complained to google,but they did help me yet.

    ReplyDelete
    Replies
    1. Admin1:: Try contacting him who is stealing your content, talk to him about that normally. Report it to DMCA if nothing helps!

      Use some scripts explained above n the article to block copying of content for future.

      Hope it helps buddy!

      Delete
  11. Anonymous22:19

    what is blockquote hhhhhhhhhhhhhhh stupid question.

    ReplyDelete
  12. Anonymous00:20

    How do You do the same on the mobile version of blogger?

    Thanks!

    ReplyDelete
  13. I found most of your codes fake look the line bellow


    this was error on my template i had to remove the above line since i had little knowledge og html now what if i was not knowledgable of the fact that does not affact my codes?? i would be stranded also The pop up feed burner email worked ony once when i just installed the codes till today that script is fake please check codes before publishing your blogs

    ReplyDelete
    Replies
    1. Sam Bennet :: Hi,
      I don't see any code you want to show which caused the error..?

      Pop Up Feed burner did work for once..? Then did you read the guidelines carefully? I have provided the popup code with cookies enabled with 15 days which means it will not show up next time to same user for fifteen days. You can also change the time or disable the cookies so it will popup with every page reload.

      My codes are not fake because I share what I use on my blog. If you have some problems then you could ask me via email using contact form before making such statement.

      Regards!

      Delete
  14. It's not work in Opera and IE browsers

    ReplyDelete
  15. hello, I didn't get about text area, Can you explain more how to enable text selection on text area??
    because I have put like this in edit html
    textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -khtml-user-select: text !important;
    user-select: text !important;
    }

    But , it doesn't work.. :'(

    ReplyDelete
  16. how to apply this code. in my template i have 4 headrs where i applied this.iam applying first head it shows error

    ReplyDelete
  17. Hi Dude I have tried with every class (CSS Class) you said but it does not work. But it works only with JavaScript. And I want to let people to select my post code and rest of the other will be out of selection. Please can you solve my problem if possible. Thanks for informative posts/tutorial.

    ReplyDelete
  18. bro i want to enable some contents but how is possible some posts contents enable slection

    ReplyDelete
  19. Satbir, you are just awesome!!! It is so wonderful that I found your page! I appreciate if you send me the link to the template you've created. I definetly buy it!

    ReplyDelete
  20. Thank you for this. :)

    ReplyDelete
  21. Hai thank for the tutorial
    its very work

    visit my blog : http://altsona.network.blogspot.com

    thanks alot

    ReplyDelete
  22. Thanks satbir for this awesome article. its working perfect for me. thanks again

    ReplyDelete
  23. Anonymous12:57

    thanks this works, any css to stop screen capture of your blogposts to stop thieves posting them on youtube

    ReplyDelete
  24. Done! thanks for help bro, best wishes for you and keep helping others.

    ReplyDelete
  25. Thanks for share. Awsome Tips.

    ReplyDelete
  26. Anonymous18:50

    any trick to stop right click by css to prevent image theft

    ReplyDelete
  27. Hi!! Have tried so many codes but only yours work for me. Thanks a lot!! you are a savior!
    I also need a suggestion, i want to add posts under different pages created on my blog. Just like as they come in Home page, i want them separately under different titles. Can you help me please?

    ReplyDelete
  28. Very helpful tips for restricted copy paste in blogger

    ReplyDelete
  29. The first code is not working for me

    ReplyDelete
  30. tell me the way how to disable the image download from blogger

    ReplyDelete
  31. worked earlier but suddenly stops working. please suggest something.

    ReplyDelete
  32. Hey, I use java scrypt + css, and now I cant click any function when using mobile

    ReplyDelete
  33. thanks bro its really work for me. can you suggest me some best javascript tools that minify javascript without any loosing in property

    ReplyDelete
  34. uc browser is useless. can't stop these losers from copying

    ReplyDelete
  35. If someone has an allowcopy extension on his-her browsers does not works!

    Is any other solution that works although has any browser extension like copyallow?

    ReplyDelete
  36. Thanks i found this really helpful :) . . Thanks a lot

    ReplyDelete