Disable Lightbox Right click?

Hi Guys,

Is there any known way to disable “right click” on the lightbox element in webflow?
It’s nice that you can hit next with the left click but right click should do nothing


I am also really keen to know the answer to this as my clients are largely artists and protecting their work from being downloaded / saved is super important.

@Jessica_Gatt while I do not know how to disable right click (although I do have some vague ideas involving this technique), you can prevent images from being right-clickable by not having them as images - but as backgrounds.

I almost never use image divs for this very reason. I just create a regular div and set the background to the relevant image. Mind you, this only prevents amateur “Save As” robberies… Anyone with the slightest bit of web dev knowledge can download the image source from the browser’s developer tools.

I’ve seen some sites go out of their way to avoid even that (using Flash and the like), but it risks breaking the site for a lot of users and, considering how you could simply screenshot the images, it’s not really worth the trouble.

Copyright laws and watermarks are your only real weapons in this, I’m afraid.

I hope this was useful, feel free to shoot me a DM if you need help with specific cases.

Thanks so much @Moscangelo that’s good advice. I’ve layered a transparent div over the top of my images on the page so they are now fine it’s the image that appears in the lightbox that is the problem…

Happy to help!

Shouldn’t that be solved with the background image trick? If not, I can give you specific directions if you share your site’s read-only link; go here if you don’t know how to do that.

At any rate, I would suggest against overlaying transparent divs over important elements, since that prevents Editors from changing the image just as much as it prevents users from downloading it. Background images, however, can be still accessed by Editors while remaining inaccessible to amateur users.

To disable right click on normal and lightbox images, add this code to the footer:

 $('img').bind('contextmenu', function(e) {return false;});
 $(document).on('contextmenu', 'img', function() {return false;})

(first line disables it on all images, second line disables it on lightbox)


Hey Lewis,

That seemed to do the trick!! Thankyou so much!! :slight_smile:

1 Like

@lewis You really only need this, does the same as the first

$(document).on('contextmenu', 'img', function() { return false; });

Can you explain where the custom code is?

Much thanks.

Looking to make this work as well… I placed this in the custom code field for the head and page, but still able to see “save image as” on right click in preview mode. Ideas on what I’m doing wrong?

Custom code does NOT work while in the designer. Publish your site.


Thx for your help, but…
To the footer…!? How do you add it to “the footer”?

In the Project Settings > Custom Code, there is a Footer Code section. Just paste it there :ok_hand:

Hi everyone,

The code for images works great, thank you!

Is there possibly a code that would work to disable right click on videos too?

This worked like a charm! Thanks :slight_smile:

I’ve tried pasting this in the footer area and still seem to be able to right click and see save image. I’ve only published to the webflow.io, does it need to be published to the actual domain to see the effect? My main goal is to stop the casual user from saving images…