How To Disable Right-click And Copy-past In A Website

Published : November 29, 2018

Disable Any Option In The Website

Hello friends, today I will tell you how to save your website’s content from being stolen and how you can rank your website, first of all, you have to disable right-click the mouse on your website and You will also have to disable copy-paste option so that no one can copy your contain and steal your website’s code. For this, you have to add a javascript to your website header. You can also add this script to the Blogger, WordPress, and local website and secure your website.

In this post, you will be given two types of javascript

(1)   block right-click

        <script language=javascript>
//Disable right click script - By
var message="Function Disabled";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
document.oncontextmenu=new Function("return false")
// -->

(2)   block copy-past

<script src='demo-to-prevent-copy-paste-on-blogger_files/googleapis.
js'></script><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 false"); } </script>

How To Add These Code In Website


Open your website’s source code and go the header section then past these code there

After Past these Code save your website

These codes are valid for any type websites such as Blogger, WordPress, Localhost etc.

  • Meta:-  how to disable right-click and copy-paste on the blogger website
  • Meta:-  how to disable right-click and copy-past on WordPress website
  • Meta:-  how to disable right-click and copy-past on website

leave a comment for any type of problem to code related thanks:-