How to disable right click, image and text copying (without apps)
With the rise of e-commerce, it's natural that competition increases, and competitors start to seek out the best companies in their niche to model their business after them. Using your competitor as an inspiration is good and even healthy to a certain degree, however, when they start to bluntly copy and paste your content and call it theirs, this can become a big problem.
There are many apps out there that serve the purpose to block the ability to copy text and images, but the main issue with these is that:
- The app only starts working after the page is fully loaded: if the person intending to copy your content refreshes the page and starts to spam the “CTRL + C” key, it will bypass the app;
- Apps come with extra bloat code, and inevitably will slow down your website;
- The best ones out there charge monthly fees.
Bearing that in mind, today I'll teach you how to block text copying, image copying, and much more just by pasting a piece of code into your theme.
Downloading the code files
You can download the code files clicking here. (live preview)
Complete details about it can be found here.
Making a backup of your theme
Before diving into the tutorial make sure you download the theme, so in case you face any issues you can easily revert back.
Step 1: opening the code editor
- In your Shopify admin, go to Online Store > Themes > Actions > Edit Code.
- Inside the .zip you downloaded you'll find two files:
- ezfy-anti-theft.txt
- settings_schema.txt
Step 2: creating the anti theft file
- Open the ezfy-anti-theft.txt file and copy all the code in there.
- Now go back to your Shopify code editor and below Snippets click on “Add a new snippet“. Name it exactly: ezfy-anti-theft
- Paste the code that you copied and click on save.
Step 3: adding the code to the website
- Find the file named exactly theme.liquid.
- Inside this file, press CTRL + F (or CMD + F on Mac) and search for:
<body - Paste the following code after the <body tag you found and save:
{% include 'ezfy-anti-theft' %}
4th and final step: updating the settings_schema.txt file
- Open the settings_schema.txt file and copy all the code in there.
- In your Shopify code editor find the settings_schema.json file in your theme.
- Scroll all the way down.
- Paste the code before the last line, after the } sign, as indicated the image below.
So, for example, in this case, the code should be pasted on the line 351 (the quantity of lines may vary depending of your theme, so don't worry if it shows a different number on yours).
- Paste the code to the right of the } character that the arrow is pointing to.
- Save and you're ready to go!
Troubleshooting common issues
Question: It shows me an error after I edit the settings_schema.json file. What do I do?
Answer: You very likely pasted the code at the bottom of the file. Please make sure you paste the code at the penultimate (second last) line as indicated in step 4.
Your file must end with this character: ]
If you're still facing any issues please reach out to us via ezfycode@gmail.com and we'll be more than happy to help you out!
Customizing the anti theft options
- In your Shopify admin, navigate to Online Store > Themes > Customize.
- Scroll all the way down and navigate to Theme settings > EZFY Antitheft
- There you will find all options available for your new EZFY Anti Theft plugin.
Was this article helpful?