How To Disable Right Click on Website? Through these 5 steps.

If you are a blogger and website owner. And you have built a website on HTML, PHP, and WordPress Etc. Want to know more about, “How to Disable Right Click on Website“, then keep reading this post today. Because today I will tell you about how to disabling right-click on any website.

As you all know, websites and blogs are also a good way to earn money from the Internet. But here most of the new bloggers, website owners, and developers, etc. get a good content copy from any other popular website and not indexed on Google.

And then they publish that content on their website and blog etc. without giving any credit. So that the real owner of that content does not get many benefits from it.

How To Disable Right Click on Website

If you also want to protect your website. Want to know more, How To Disable Right Click on Website, so let’s start.

How To Disable Right Click on Website?

In this post today, I am going to give you some JavaScript code to avoid people who steal content and modify your website. By using which you can protect your website from those content-copying bloggers etc.

In today’s times, some new bloggers use online to modify a copy of content already published on another blog and website in the greed to make money. Because they think. Will your website have that much content? So you will get more money from Google AdSense.

Whereas most surveys do not. And fail in it. Therefore, you should write your content yourself. And make a pattern of your own. So that your users and customers understand your pattern and identify it and identify that the content is yours.

Well, leave it? Let us now know about these steps to disable the mouse right button on our website and blog. And you can use any one of these codes.

1. How To Disable Right Click on Website In HTML!

If you have created your website using HTML, CSS & Javascript, etc, you can use this code in your <body> tag.

<body oncontextmenu="return false">
How To Disable Right Click on Website In HTML

2. How To Disable Right Click on Website In PHP!

And if you have your own website built in PHP, then you can use this code anywhere within your body part.

<script>
	window.oncontextmenu = function () {
				return false;
			}
			$(document).keydown(function (event) {
				if (event.keyCode == 123) {
					return false;
				}
				else if ((event.ctrlKey && event.shiftKey && event.keyCode == 73) || (event.ctrlKey && event.shiftKey && event.keyCode == 74)) {
					return false;
				}
			});
</script>
How To Disable Right Click on Website In PHP

3. How To Disable Right Click on Website In Blogger!

If you have created your website and blog using blogspot.com, then you can use this code.

<script language=javascript>
	function blockOne() { 
		if (document.all) {				
				return false;
			}
			}
	function blockTwo(e) {
		if (document.layers||(document.getElementById&&!document.all)) 
		{
		if (e.which==2||e.which==3) {			
			return false;
		}
		}
		}
	if (document.layers){
		document.captureEvents(Event.mousedown);
		document.onmousedown=blockTwo;
	}
	else {
		document.onmouseup=blockTwo;
		document.oncontextmenu=blockOne;
	}
		document.oncontextmenu=new Function("return false");
</script>
How To Disable Right Click on Website In Blogger

4. How To Disable Right Click on WordPress Website!

If you want to disable the mouse right button on your WordPress website, you can use a plugin called “WP Content Copy Protection“. And right button can be disabled on your WordPress website.

How To Disable Right Click on WordPress Website

5. How To Disable Right Click n WordPress Website Without Plugin!

If you want to disable the mouse right button in your WordPress website without a plugin, you can use this code. You can use this code by adding it to a file named function.php of your website.

function your_function() {
   ?>
<script>
jQuery(document).ready(function(){
    jQuery(document).bind("contextmenu",function(e){
        return false;
    });
});
</script>
<?php
}
add_action('wp_footer', 'your_function
How To Disable Right Click n WordPress Website Without Plugin

So friends, in this way you can block the mouse right button on any website. Apart from this, now you can also read this post if you want.

Read Also:)

So I hope that you have liked all the codes that we have posted, and have used them. So if you have any questions and suggestions related to it right now, then you can tell us in the comment box below. Thank you for reading the post.

1 thought on “How To Disable Right Click on Website? Through these 5 steps.”

Comments are closed.