How to Disable Right Click on any Website

Disable right click on websites are very popular nowadays just to ensure that no one can copy the content from their web pages. You can secure your images by disabling right click or by disabling image context menu on images. It also wont allow the users to use right click button So, that copycats have no option to copy the content. This will not only disables the right click but helps you to protect your content and as well as hide your source code.

disable right click

So, today in this article we are going to share you on how to disable right click on any website using two simple methods. the first method is used manually by inserting the line of javascript in between the <body> tags. If you are using  wordpress the other method is for you by adding few plugins on your wordpress site.

I know you are very eager to know how to disable right click and hide ‘view page source’ option. So, Simply follow the guidelines given below

Note : Make sure you have backed-up your Theme’s template before you editing anything as I won’t be liable for any defect in your site’s design. So, why late lets gets started . . . 🙂

Adding Javascript Code Manually :
  • Open your FTP
  • Give username & Passwod
  • Login

Home directory>Public_html>Theme>headerfile> In the header add the below code in between the <head></head> Tag.

<SCRIPT TYPE="text/javascript"> 
//Disable right click script 
var message="Sorry, right-click has been 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") 
// --> 

Disable Right Click Using WordPress :

If you are running a wordpress website. Then disabling the right click on wordpress site is much more easier. Because wordpress has a pack of plugings in its shell. So, I will show you the great plugins for disabling the ability to right-click, and we’ll also discuss whether it’s actually worth doing.

Plugins for Disabling Right-Click :
No right click image Plugin :

disable right click

The No Right Click Images Plugin Plugin uses JavaScript to change the right click action on IMG tags to disable the context menu. It disables the context menu on images only so other right click actions, such as links, should work normally. Images uploaded via the WordPress Media uploader will open in a window if clicked. The image will not be protected, so be sure to indicate that there should be no action if the image is clicked at the time you upload the image.

Smart Phone support is hit or miss. Some web pages rely very much on clickable images and this suppresses some actions, so if an image is large enough to fill a screen, the page may not be able to scroll. It depends very much on your WordPress theme and how it displays images.

Wp content copy Protection & No Right Click :

disable right click

This wp plugin protect the posts content from being copied by any other web site author , you dont want your content to spread without your permission!! The plugin will keep your posts and home page protected by multiple techniques (JavaScript + CSS), this techniques does not found in any other wordpress plugin and you will own it for free with this plugin

Basic Features:

  • Protect your content from selection and copy. this plugin makes protecting your posts extremely simple without yelling at your readers
  • No one can save images from your site.
  • No right click or context menu.
  • Show alert message, Image Ad or HTML Ad on save images or right click.
  • Disable the following keys  CTRL+A, CTRL+C, CTRL+X,CTRL+S or CTRL+V.
  • Advanced and easy to use control panel.
  • No one can right click images on your site if you want

Hey there !! Iam Ajay Bharadwaj a part time blogger from India. Specialized in web designing, front-end web development and WordPress expert since 2012. am well passionate for sharing knowledge that makes an impact. I write articles about on tech ,customizing templates designs and a lot more on wordpress.

What Others Are Reading :

Leave a Reply