x

Disabling RightClick Downloading of Images in Online Store

I'm a photographer selling online prints of my photos, and I'm considering using the online store to host my site. Is there a way to disable right-clicking of images to prevent digital downloads? I'm not a huge fan of watermarks, because I think they detract from the image (which is contrary to the whole point), so I'm hoping there's a way to prevent (or at least make it harder!) for people to right click and save the image I'm selling without me using those.

 

I hope that makes sense! Thanks for your help!

27,540 Views
Message 1 of 24
Report
1 Best Answer

Best Answer

I figured out the answer to my own question, but I'll put it here for anyone else who is looking to do this.

 

In the Online Store Dashboard page, go to Website -> Integrations -> Add Custom Header Code -> Add New Code

 

Add this code:

 

<!-- Following code will prevent right click on images place is just above closing </body> tag -->
<script>

document.oncontextmenu = function(e){
var target = (typeof e !="undefined")? e.target: event.srcElement
if (target.tagName == "IMG" || (target.tagName == 'A' && target.firstChild.tagName == 'IMG'))
return false

}

</script>
<!-- code to prevent right click ends here -->

 

And click on "End of Body" where it asks where the code should be placed. 

 

(Note, I didn't write this code, only grabbed it from another Weebly forum, here: https://community.weebly.com/t5/Vote-on-Features/Disable-Right-Click-On-Photos/idi-p/7662# )

 

Hope that helps someone else looking to protect their images. 😀

View Best Answer >

27,509 Views
Message 2 of 24
Report
23 REPLIES 23
Square Community Moderator

Welcome to the Seller Community, @Emoonbridge

 

Disabling the right-click option will not prevent someone from copying your images, but you can try republishing the site to see if that pushes the code to the live site.

 

If you are concerned about someone taking your images, I recommend adding a watermark to all of your images before uploading to your website. This is the only true way to protect your online content. Watermarkly, for example, offers a free version of their service. 

5,485 Views
Message 22 of 24
Report

It worked for me. Thanks!

5,181 Views
Message 23 of 24
Report

Something no one mentioned was Screen Shots - yes via a script you can stop someone from downloading a photo - we do that on our main web site however, there's nothing to prevent simply doing a screen shot - from there the photo can be edited and separated from the other details of the screen shot.   The use of watermarks can deter someone from getting a good copy but, it's not totally foolproof either.  Just some thoughts from our experience.

5,495 Views
Message 24 of 24
Report
This thread has been archived and locked. Please start a new thread if you would like to continue the conversation.