Disable Right-click to Protect Your Images on Shopify Using Code - Tutorial

Disable Right-click to Protect Your Images on Shopify Using Code - Tutorial

Image copyrights are a huge deal, and for Shopify store owners looking for ways to disable right-click to protect their images using code, Ecom Experts has got you covered. Disabling right-click protects your product images from being downloaded off your site, ensuring content thieves cannot steal your product images off your website. 

Without doing this, anyone can download your product image and use in whatever manner they deem fit. This then casts a shadow of doubt as potential customers could be left wondering about the authenticity of your brand.

This is a step-by-step guide to "Disable Right-click to Protect Your Images" on your Shopify store using code.

Here's how to "Disable Right-click to Protect Your Images" using code: 

Disable Right-click to Protect Your Images Without App

Step 1: Duplicate your current live theme

From your Shopify admin, go to the Online Store, then click on Themes. To be secure we recommend you make a duplicate of your current live theme. 

Click on actions, and from the drop-down menu choose duplicate. Once the duplicate is made, click on Actions again, but this time choose Edit code.

Step 2: Layout directory 

From the navigation to the left, click on theme.liquid under the Layout directory. A new file should open on the right page.

Paste the following code on a new line above the closing head tag 


/* don't expect this to work on older ie */

window.oncontextmenu = function () { return false; }


Step 3: Check if everything is working properly

Go to your store and give yourself a big pat on the back.

Final Word

However, before opting to use this code, please note that this code might not stop everyone from downloading your product image and may also annoy customers. Some browsers may not fire the code to disable right-click, and touch devices have no concept of a 'right' click, so the js would never fire on those. 

So, from just disabling js to looking at the source of the page, using the browser console, taking a screenshot, using google images, or using a scraping tool like import.io - there's no effective way to stop the image from being captured in this case.

Keep your product images safe and away from the hands of content thieves by making sure you disable right-click on product images on your Shopify store.

If you have any more questions, please contact us at Ecom Experts.

Back to blog