SocialEngine 4: Prevent Right Clicks on Website

Andrew - SocialEngine

Some webmasters like to protect their sites and its users content.

One method of doing this is disabling the right click of the mouse button.

The script below is a cross browser DHTML script that will prevent the default right menu from popping up when the right mouse is clicked on the web page.

Webmasters can use it to stop users from easily saving your web page content, viewing its source, or lifting images off your site

<script language=JavaScript>

//Disable right mouse click Script

var message="Function Disabled!";

function clickIE4(){
if (event.button==2){
return false;

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
return false;

if (document.layers){
else if (document.all&&!document.getElementById){

document.oncontextmenu=new Function("alert(message);return false")

// --> 

To insert this code into your SocialEngine Site you can Go to your Admin Panel > Select Layout > Select Header

Once on the header page, drag over a HTML box into the header.

Once the dialog box opens insert the above coed and click on save

now you have finished editing the page you can click on save changes.

This will now enable the coding to prevent any right clicks within the site.

You do not need to insert the code into the header if you only wish to protect a page on its own. you can follow the same process on the required page.


Looking for quality SocialEngine Hosting? Look no further than Arvixe Web Hosting



Tags: , , , , | Posted under SocialEngine | RSS 2.0

Author Spotlight

Andrew Cross

Hi, I'm Andrew. A am a 26, ICT Administrator which offers support to company's around the South Wales Area. I have created a few social sites for myself and other company's. So far 2 out of 3 have been successful using the powerful SocialEngine Script. I continue to try and help the community of SocialEngine by giving Support and Technical Help where possible.

Leave a Reply

Your email address will not be published. Required fields are marked *