How to disable Right Click in Blogger Blogs?

Why To Disable Right Click?

We Create Posts For Users to help them and Make Their Work Easier But It takes more time to create Unique or Good Tutorial Posts But If you See Someone is Copying your Work Without Giving Credit To You or not Linking back to your Post then You Need To Disable Right Click.

If you have a Blog with Tutorials which are written by You and Unique but You See Same Posts on Google or Other Search Engines And You See Some Copycats Copied your Posts or tutorials and their posts ranked better than your's and Search engines thinks you have duplicate posts in this case You Need To Disable Right Click This is not 100% protection but a starter to protect your blog and Its unique content.

Is This Script Slow My Site / Blog?

We are sharing two different versions of disable right click Scripts First Will Be JavaScript Which is Shared by Dynamic Drive And Second is ours Jquery Script Which is Lightweight and Of few lines and No It Will Not Make Larger impact on Slowing down your site. Before we write or share any script we check them In many of our Blogs So that If it has any error or cons we can Fix it Before Sharing with our Visitors or Subscribers.

Let Start! How To Add  Disable Right Click in our Blog:

Steps To Disable Right Click:

STEP 1: Log in to your Blogger account and Go to your Blogger Dashboard

Blogger Layout

STEP 2: In The Left Side Bar You will find Layout Section as highlighted in the image above Click on Layout.

Add a Gadget

STEP 3: Click On "Add a Gadget" As highlighted in the image above.



STEP 4:After Clicking on "Add a Gadget" Choose "HTML/JavaScript" from the list 
and Open it as highlighted in the image above.

STEP 5: Now Copy This Below Code And Paste it in The Empty Box of the "HTML/JavaScript" Section.

1. First We are Sharing Jquery Trick.



<script type="text/javascript">
// http://www.trendingwidgets.com
var clickMessage = "Right Click is Disabled";
 $("document").ready(function(){
      $(".post").on('contextmenu', function() {
      alert(clickMessage);
      return false;
      });
});
</script>

2. Second We are Sharing JavaScript Trick.


<script language="JavaScript">
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

 var message="";

///////////////////////////////////
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.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
 document.oncontextmenu=new Function("return false")

// -->

</script>

Customization:

  • The Yellow Highlighted Text is Responsible for Message which you want to Show to Users when they Right Click their Mouse. If you want to Add or change then replace the text in between two inverted commas. If you Don't Want to Show Any Message then Delete every thing in between Inverted Commas and leave it empty like this
var clickMessage = "";
  • The Green Highlighted Text is Responsible For The Section or Elements to which you want to disable Right Click By Default We Have Disable only Posts Section which is Main or important section where unique articles are present. YOu can Change the Value of Green Color to Your Desire Element or if you want to Disable right click for whole Site then Replace value with this.
$("body")

STEP 6:  All Done Save the Gadget and Check it in your site.

That's It Thanks For Following our Tutorial 'How to disable Right Click in 2 Ways in Blogger JavaScript Trick! '' Along With us If you found any difficulty Please Comment and Share Your Valuable Opinion. And Stay tuned for More Tutorials Like This and Share this with your friends.

No comments:

Post a Comment