How to Disable Text Selection on Your Website- Restrict Users from Copying Your WEB Content

So the question is, how to disable text selection ? So lets learn about some different scenarios of preventing pages from being copied on your websites and blogs-

Few reasons i can think of restricting people from copying your content-
  • Fist and foremost benefit, prevent copying text
  • You can prevent downloading of images on your blog or website
  • Restrict people from viewing your source code via right click menu
  • Restricts saving pages and post via right click feature


  1. Disable Right Click Menu on Your Website-

This is the very simple procedure that helps you in securing your text from being copied, the problem with this feature is, it disables right menu on the other hand the same menu help’s you in featuring many other things on your site, this right click menu allowing your visitors to easily access your blog. This feature can be very useful on some pages like privacy policy, about us or on pages where your don’t need to use right click menu, mmmm……. funny! but true people on web also copying these pages from your site because the are not creative the way you are, so here you should have a disabled right click feature on some pages.

Note-  Disabling right click menu does not guarantee you to beat these content scrappers cause they still have alternative options to do same things with your pages. even though right click menu is the most common way of copying your content in this scenario, Implement this feature on sensitive area of your site only cause a disabled menu going to be a annoying experience for your visitors. So if you are implementing this feature on sensitive pages only than its going to be fruitful for you.


How it Works?-
This is possible using an easy process of implementing a script that allows you to disable right click feature on your blog. This script blocks right click menu when your visitors on these pages try to use it, a user friendly message shows (You can customize your message)
Steps to implement the script-
You are require to install an easy script in body tag of your website or on specific posts or pages where you want privacy and security. This script go just right before </body> tag on your website.
Go to HTML of your website and add the script just before the closing body tag </body>
<script type=”text/javascript”>
var message=”Right Click Menu is Not Allowed!“;
function clickIE4(){
if (event.button==2){
return false;
function clickNS4(e){
if (document.layers||document.getElementById&amp;&amp;!document.all){
if (e.which==2||e.which==3){
return false;
if (document.layers){
else if (document.all&amp;&amp;!document.getElementById){
document.oncontextmenu=new Function(“alert(message);return false&quot;)
||| – Customize Message
Here you can make changes with your message to your visitor by replacing “Right Click Menu is Not Allowed!
Credits-  The credits of serving this utility “The right click disabled menu” goes to designers at
How to Implement the script on Specific pages And URLs- Read This

2. Disable Text Selection –

The above given way of disabling right click menu could harm reputation of website, cause its going to be an irritating and annoying experience for your visitors, implementing the feature some pages helps you in taking care of sensitive content from content scrappers however its not a best choice if you are planning to implement this on your whole-

How to disable Text Selection

Your blog should not be irritating and buggy experience for you visitors, this is the reason am popped up for the another scenario of saving you content from being copied, so here is the best alternative choice available for you “Disable Text Selection


Go to HTML body of your site via template from edit layout option-

and paste the code just before the </head> given below-

<script type=”text/javascript”>

* Prevent Text Selection code- © Dynamic Drive DHTML code library (
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at for full source code

function disableSelection(target){
if (typeof target.onselectstart!=”undefined”) //IE route
target.onselectstart=function(){return false}
else if (typeof!=”undefined”) //Firefox route”none”
else //All other route (ie: Opera)
target.onmousedown=function(){return false} = “default”



||| – document.body = By customizing this code you can specify the elements for restriction, the default code will help you restricting users from copying your content site wide but if you wish to make it on specific location, portion or only some part of you content you can do this by customizing-

Here you need to replace this with

document.getElementById(“[Division Id]“)

[Division Id] give reference to div ID here


i.e: Assume, the div you want to select for restriction is


<div id=”Paragraph“>
<p>Put the text that you wish to disable here</p>
<img src=”DisableImage.jpg” alt=”Text Selection”/>

Reference would be-


27 thoughts on “How to Disable Text Selection on Your Website- Restrict Users from Copying Your WEB Content

  1. I have been browsing on-line greater than three hours lately,
    but I never found any interesting article like
    yours. It is beautiful value sufficient for me.
    Personally, if all web owners and bloggers made excellent
    content material as you probably did, the web shall be a lot more useful than ever before.

  2. I feel this is one of the such a lot important info for me.
    And i’m satisfied reading your article. But want to commentary on few common issues, The site style is ideal, the articles is actually great : D. Good job, cheers

  3. Do you mind if I quote a few of your posts as long as I provide credit and sources back to your webpage?
    My blog is in the exact same niche as yours and my users would genuinely benefit from a lot of the information you provide here.

    Please let me know if this okay with you. Thank you!

  4. Having read this I thought it was really enlightening.
    I appreciate you finding the time and energy to put this content together.

    I once again find myself personally spending way too much time both reading and posting comments.

    But so what, it was still worth it!

  5. Usually I don’t learn post on blogs, but I wish to say that this write-up very forced me to take a look at and do so! Your writing taste has been surprised me. Thanks, quite great article.

  6. Right here is the perfect site for anyone who wants to find out about this topic.

    You realize a whole lot its almost tough to argue with you
    (not that I really will need to…HaHa). You certainly put a new spin
    on a subject that has been written about for a long time.

    Excellent stuff, just great!

  7. Hi there! This is kind of off topic but I need some guidance from an established blog.

    Is it very hard to set up your own blog? I’m not very techincal but I can figure things out pretty fast. I’m thinking about making
    my own but I’m not sure where to begin. Do you have any points or suggestions? Many thanks

  8. Do you mind if I quote a few of your posts as long as I provide credit and sources back to your blog?
    My blog is in the very same area of interest
    as yours and my visitors would definitely benefit from some of the information you provide here.
    Please let me know if this okay with you.

  9. Pretty portion of content. I simply stumbled
    upon your web site and in accession capital to claim that I get in fact enjoyed account your weblog posts.
    Any way I will be subscribing for your augment or
    even I success you access consistently fast.

  10. Hello, i believe that i noticed you visited
    my website thus i came to return the prefer?.I am attempting to find issues
    to improve my website!I guess its ok to make use of some of
    your concepts!!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s