Thursday 15 May 2014

How to Disable Right Click and Protect Your Blog Content from Copy Cats

Blogpost content copied/stolen by other blogger is one thing that must be faced by every blogger. This often makes us angry because our works is stolen without permission, however, we can still be able to minimize it. Here, I want to give you tips how to disable right click andprotect your blog content, so, your contents will be more difficult to be copied. Indeed, there will be always a way to outsmart these tricks.
protect your blog content

This is how to protect your blog content from copy cats: (I will give you 2 ways)

First:

1. Login to your blog, we will edit our blog template, go to layout -> edit HTML.
2. Find <body> and replace with this script: <body oncontextmenu=’return false;’ onkeydown=’return false;’ onmousedown=’return false;’>
3. Finish.
It’s easy right? Here is the explanation for the HTML functions.
oncontextmenu=’return false;’  –> it is to disable right click.
onkeydown=’return false;’  –> it is to disable keyboard keys (CTRL+A, CTRL+U, etc…)
onmousedown=’return false;’   –> it is to disable mouse selection.
‘return false’   –> It is to disable function you want.
From three functions above, you can use 1, 2 or all. And this first method is great but it can be outsmarted by disabling javascript in browser. So, you need to add the second method to your blog.

Second

1.  Go to layout -> edit HTML and find </head>.
2. Then add this script above </head>
1
2
3
4
5
6
<script type='text/javascript'>
if (top.location != self.location) top.location.replace(self.location);
</script>
<script type='text/javascript'>
document.ondragstart = function(){return false;};
</script>
3. After that, add this script below <body>  (if you have used the first way, then just add below/after <body oncontextmenu=’return false;’ onkeydown=’return false;’ onmousedown=’return false;’>)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<div align='center'><noscript>
   <div style='position:fixed; top:0px; left:0px; z-index:3000; height:100%; width:100%; background-color:#FFFFFF'>
   <div style='font-family: Tahoma; font-size: 14px; background-color:#FFF000; padding: 10pt;'>To see this page as it is meant to appear, we ask that you please enable your Javascript!</div></div>
</noscript></div>
<script type='text/javascript'>
function mousedwn(e) {
try { if (event.button == 2||event.button == 3) return false; }
catch (e) { if (e.which == 3) return false; }
}
    document.oncontextmenu = function() { return false; }
    document.ondragstart   = function() { return false; }
    document.onmousedown   = mousedwn;
</script>
<style type='text/css'>
* : (input, textarea) {
 
 
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}
 
 
img {
        -webkit-touch-callout: none;
        -webkit-user-select: none;        
    }
</style>
 
 
&lt;script type='text/javascript'&gt;
window.addEventListener(&quot;keydown&quot;,function (e) {
    if (e.ctrlKey &amp;&amp; (e.which == 65 || e.which == 67 || e.which == 85 || e.which == 80)) {
        e.preventDefault();
    }
})
        document.keypress = function(e) {
        if (e.ctrlKey &amp;&amp; (e.which == 65 || e.which == 67 || e.which == 85 || e.which == 80)) {
    }
        return false;
                };
&lt;/script&gt;
If you only use this second method, your visitors still can be able to do right click, CTRL+A and click copy, however, it can’t be pasted. And that script also has ability to protect your blog from copypaste although the javascript is disabled. Because your visitor will be forced to enable their browser javascript. But, for me, I recommend you to use both of these methods.
protect blog from copy paste
Well, above are two easy methods you can use and try for your blog. I have tested and used above methods in this testing blog: http://valentinesdaygiftsz.blogspot.com/. It’s so easy. Hopefully now you can protect your blog from copy cats. Happy blogging!

No comments:

Post a Comment