Disable Mouse Right Click Cut Copy and Paste on Website or Blog Are you want to prevent visitors from copying your web page content? In this short article, we’ll show you how to stop content theft from yo...
2018-07-31T07:45:54Z

Disable Mouse Right Click Cut Copy and Paste on Website or Blog

Are you want to prevent visitors from copying your web page content? In this short article, we’ll show you how to stop content theft from your website. For stopping the content copy of your website you can do two things, one is to disable the mouse right click and second is to disable the cut (CTRL+X), copy (CTRL+C) and paste (CTRL+V).

Disable Mouse Right Click Cut Copy and Paste

You can easily disable mouse right click and disable cut, copy and paste from web content.

How to disable right click on blog or website With JavaScript ?


1. Go to your blog or website body or Head selector.
2. Now Copy and Paste below code into it.

<!-- www.howlmeflash.com -->
<script language='JavaScript1.2'>
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>

3. Now save it and you are done disabling right click on your blog or website.

Disable mouse right click, cut, copy and paste using jQuery


At first include the jQuery library.

<script src='//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js' type='text/javascript'/>
Don't add this if you are already using any jQuery.js file

Disable Mouse Right Click


Disable mouse right click will prevent visitors from choosing the cut, copy and paste options. If you want to disable right mouse click for a particular section of a web page, then you can use a selector (#id, .class, etc.) otherwise use body selector for the full page. The following JavaScript code is used to disable mouse right click.

<script type="text/javascript">
$(document).ready(function () {
    //Disable full page
    $("body").on("contextmenu",function(e){
        return false;
    });
    
    //Disable part of page
    $("#id").on("contextmenu",function(e){
        return false;
    });
});
</script>

Disable Cut Copy & Paste


The following JavaScript code will disable cut, copy and paste from your web page or a part of your web page.

<script type="text/javascript">
$(document).ready(function () {
    //Disable full page
    $('body').bind('cut copy paste', function (e) {
        e.preventDefault();
    });
    
    //Disable part of page
    $('#id').bind('cut copy paste', function (e) {
        e.preventDefault();
    });
});
</script>

Disable Mouse Right Click, Cut, Copy & Paste


Full JavaScript code for disabling mouse right click and disable cut (CTRL+X), copy (CTRL+C) and paste (CTRL+V) from the web page.

<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>

Disable Mouse Right Click, Cut, Copy & Paste Using CSS

Disable Copy Paste Using CSS + Enable Copy Paste For Some Content:
/*----- Disable Text Selection with CSS Code ------*/
.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;
}

So this was our guide on Disable Mouse Right Click Cut Copy and Paste on Website or Blog , I hope the methods given above helped you Disable Mouse Right Click, Cut, Copy & Paste.
Share it:

Blogging

Tutorial

Post A Comment:

0 comments: