331A96E0-3037-43FC-8D93-543B900B11C9

😍 Loving this theme? Download

Please enter at least 3 characters.

Disable Copy Function On Blogger With CSS or JavaScript

A lot of copycats simply copy and share your works without permission and credit. Disable copy function in your blogger with a small script or through
Disable Copy Function On Blogger With CSS or JavaScript
Disable Copy Function on blogger
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.



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

Disable Text Selection On Blogger With JavaScript Code

 
Go to Blogger→ Template→ Edit Template→ Backup Your Template Code First. Now search for <head> and paste the JavaScript Code below.
<!--Disable Copy Paste--- TwistBlogg.com-->
<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> and paste the CSS code before it.
/*----- Disable Text Selection with CSS Code--- TwistBlogg.com----*/
.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.

Share this post

Explore more articles by Satbir

69 comments

Please leave comments related to the content. All comments are highly moderated and visible upon approval.

Comment Shortcodes

  • To insert an image, add [img]image_link[/img]
  • To insert a block of code, add [pre]parsed_code[/pre]
  • To insert a link, add [link=your_link]link_text[/link]
  • To insert a quote, add [quote]quote_text[/quote]
  • To insert a code, add [code]parsed_code[/code]
  1. Enjoy :)
  2. Thank you admin. I was in search of CSS code to do it and found this one.
  3. We have to get something else, this does not work with the Chrome Allow Copy Extension.
  4. Thanks it works but not for all browsers. Opera Mini can still copy the from my blog
  5. this is really helpful! thank you!
    1. @DORE:: You're most welcome :)
  6. Thank you so much Satbir, many people been copying my articles (word to word) and been sharing them on forums.. Then the forum due to higher rank and traffic and DA will outrank me in SERPS.

    But now.. not anymore.. thanks to you
  7. thanks man. i am much in love with your template can you please help with it or give me some customization code thanks
    1. Muideen Samuel:: Contact us for blogging queries :)
  8. thanks
  9. Wonderfull, Thanks for this post.
  10. Thanks...the second css code works for me
    1. Happy Blogging :)
  11. Thank you for this usefull post. using your code on my 3 blogs.

    but i have seen that when i enable reader mode in firefox than the css code does not work and i can copy data . also same happens in rss feed.
  12. Thanks Its working in my blogger blog but how to allow to copy only singe words in paragraph like ]]> in your article when i use backquote some spaces are occur pls solve this
    1. Maruthi Hacker:: We've used a separate tag < code>... and enabled text selection using the same method we discussed on the article:)
  13. Thanks i found this really helpful :) . . Thanks a lot
  14. 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?
  15. uc browser is useless. can't stop these losers from copying
  16. thanks bro its really work for me. can you suggest me some best javascript tools that minify javascript without any loosing in property
  17. Hey, I use java scrypt + css, and now I cant click any function when using mobile
  18. worked earlier but suddenly stops working. please suggest something.
  19. tell me the way how to disable the image download from blogger
  20. The first code is not working for me
  21. Very helpful tips for restricted copy paste in blogger
  22. 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?
  23. any trick to stop right click by css to prevent image theft
  24. Thanks for share. Awsome Tips.
  25. Done! thanks for help bro, best wishes for you and keep helping others.
  26. thanks this works, any css to stop screen capture of your blogposts to stop thieves posting them on youtube
  27. Thanks satbir for this awesome article. its working perfect for me. thanks again
  28. Hai thank for the tutorial
    its very work

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

    thanks alot
  29. Thank you for this. :)
  30. 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!
  31. bro i want to enable some contents but how is possible some posts contents enable slection
  32. 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.
  33. how to apply this code. in my template i have 4 headrs where i applied this.iam applying first head it shows error
  34. 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.. :'(
  35. It's not work in Opera and IE browsers
  36. 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
    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!
  37. How do You do the same on the mobile version of blogger?

    Thanks!
    1. Thank you!
  38. what is blockquote hhhhhhhhhhhhhhh stupid question.
  39. Thank You very much ! it worked Android Tricks Hub
  40. someone continually stealing my all blog post.what to do? i have complained to google,but they did help me yet.
    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!
  41. Thank you! for right information. I have use it for my blog and it works well.
  42. 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
    1. .post img {
      pointer-events: none;
      }

      The script above works best
  43. its a great article bro, i applied it for my blog. than you for giving this article to us!
  44. 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
    1. Hafiz Shahid:: hi,
      Sorry I did not get you. What do you actually want? Are you unable to use these codes?
  45. Its working but when i right click, it still shows select all.
    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.
    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"
    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
    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.
  46. Thank you very much!
    1. Aleksandra Zobic :: You're welcome!
  47. Thank you very much!!! Is it working also when we use the code in textarea? hmmm... just wondering :)
    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
  48. gonna try this one!!!
    True-Speak
  49. Thanks Now if people even block JavaScript they cant copy thanks dude much appreciated
    1. Thanks for your appreciation Aaryan..!! Nice name :)
  50. Thanks, finally found something what's working (Y)
    1. Your welcome!!
    2. 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
    3. 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!
Post a Comment