To disable right-click on Shopify, add a small script that returns false on the contextmenu event - either by editing theme.liquid or, more safely, through an app like Kedra Shield that also blocks copy-paste, image dragging and developer-tool shortcuts. This deters casual image theft, though it cannot stop a determined thief.
That last clause matters more than merchants expect. Right-click blocking is a deterrent, not a vault. Over 2.5 billion images are stolen online every day, according to image-tracking firm Copytrack, and roughly 85% of the ~3 billion images shared online daily are used without a license. For a Shopify store, your product photography is both your most expensive asset and your most exposed one - a single right-click can lift it in seconds.
Table of contents
- What does disabling right-click actually do?
- Why bother if it can be bypassed?
- How to disable right-click on Shopify with code
- App vs. code: which protection method should you use?
- What client-side protection can and cannot stop
- How to disable right-click and protect images with Kedra Shield
- Frequently asked questions
What does disabling right-click actually do?
Disabling right-click removes the browser’s context menu - the small pop-up that appears when a visitor right-clicks a page. That menu is where “Save image as…”, “Copy image”, “Copy”, and “View page source” all live. Turn it off and you close the single easiest path a casual visitor uses to grab your product photos, text, and code.
A complete content-protection layer usually disables four things at once:
- Right-click / context menu - blocks “Save image as…” and “Copy image”.
- Text selection and copy-paste - stops shoppers highlighting and lifting product descriptions.
- Image dragging - prevents dragging a photo straight to the desktop.
- Developer-tool shortcuts - deters
F12,Ctrl/Cmd+Shift+I, andCtrl/Cmd+U(view source).
Each of these is a client-side control: it runs in the visitor’s browser. That makes it fast and free to deploy, and it’s why it deters the majority of theft, which is opportunistic rather than technical.
Want the fastest, no-code path? Kedra Shield turns on right-click, copy-paste, drag and dev-tool blocking with a single toggle - no theme edits.
Why bother if it can be bypassed?
Because most content theft is casual, not sophisticated. The typical offender is a competitor, a dropshipper, or a social-media reseller looking for a quick, free image - not someone willing to open developer tools or write a scraper. Removing the right-click menu stops that entire group at the first click.
The scale of the problem justifies the friction. Copytrack’s tracking of 2.5 billion daily image thefts and the finding that 64% of professional photographers reported their work stolen more than 200 times show how routine copying has become. On Shopify specifically, stolen product photos fuel knockoff listings and cloned stores that compete against you using your own creative. Even an imperfect deterrent that stops the easy 80% meaningfully shrinks that exposure - and it signals to visitors that your brand guards its assets.
How to disable right-click on Shopify with code
You can disable right-click on any Shopify plan by editing your theme. Always duplicate your theme before editing, so you can roll back instantly.
- In your Shopify admin, go to Online Store → Themes.
- On your live theme, click the ⋯ (three-dot) menu → Duplicate. Work on the copy.
- On the duplicate, click ⋯ → Edit code.
- In the Layout folder, open
theme.liquid. - Paste this just above the closing
</head>tag:
<script>
// Disable the right-click context menu
document.addEventListener('contextmenu', function (e) {
e.preventDefault();
});
// Block image dragging
document.addEventListener('dragstart', function (e) {
if (e.target.tagName === 'IMG') e.preventDefault();
});
// Deter view-source and dev-tools shortcuts
document.addEventListener('keydown', function (e) {
if (
e.key === 'F12' ||
(e.ctrlKey && e.shiftKey && ['I', 'J', 'C'].includes(e.key.toUpperCase())) ||
(e.ctrlKey && e.key.toUpperCase() === 'U')
) {
e.preventDefault();
}
});
</script>
- Save, preview the duplicate, and confirm right-click and dragging are blocked.
- When you’re satisfied, publish the duplicated theme.
The minimal version is a single line - window.oncontextmenu = function () { return false; } - as EcomExperts documents in its Shopify tutorial. Keep two caveats in mind: touch devices “have no concept of a ‘right’ click,” so the script never fires on mobile, and any theme update can overwrite your edit, quietly turning protection off.
App vs. code: which protection method should you use?
The code route is free but brittle: it breaks on theme updates, skips mobile, and covers only the events you personally scripted. A purpose-built app maintains the protection for you, extends it to more vectors, and survives theme changes. Here’s the honest comparison.
| Factor | Manual theme code | Content-protection app (e.g. Kedra Shield) |
|---|---|---|
| Setup | Edit theme.liquid (needs care) | Toggle on, no code |
| Right-click + copy-paste | Yes, if you script each | Yes, built in |
| Image drag + dev-tools shortcuts | Only what you add | Included |
| Survives theme updates | No - often wiped | Yes - app-managed |
| Blocks scraper bots / VPNs | No | Yes (server-side layer) |
| Ongoing maintenance | You | The app |
| Cost | Free | Free plan available |
If you only need a quick deterrent and are comfortable in the code editor, the script is fine. If you want protection that stays on, covers more actions, and pairs client-side deterrence with real bot blocking, an app is the sturdier choice. For a deeper look at that trade-off, see our guide on server-side vs. client-side blocking.
What client-side protection can and cannot stop
Be clear-eyed about the limits so you set the right expectations. Client-side blocking is a lock on the front door, not on every window.
What it reliably stops:
- Casual “Save image as…” and copy-paste by ordinary visitors.
- Drag-to-desktop image grabbing.
- The impulse theft that makes up the bulk of real-world copying.
What it cannot stop:
- A user who disables JavaScript, then right-clicks freely.
- Anyone opening developer tools or reading the raw HTML source.
- Screenshots - no browser can block the operating system’s screen capture.
- Automated scraper bots, which ignore the context menu entirely and pull your images directly from their URLs.
As EcomExperts concludes bluntly, “there’s no effective way to stop the image from being captured” completely. That is why serious protection is layered: client-side blocking deters humans, while a server-side layer blocks the bots and anonymized traffic that client-side scripts can’t touch. If theft has already happened, our Shopify post-breach recovery plan walks through DMCA takedowns and de-indexing the clones.
How to disable right-click and protect images with Kedra Shield
Kedra Shield bundles the client-side deterrents and the server-side bot defense into one app, so you don’t stitch scripts together or lose protection on the next theme update. Setup takes minutes:
- Install Kedra Shield from the Shopify App Store and open the app from your admin.
- Under Content protection, toggle on Disable right-click and Disable copy-paste. This removes the context menu, blocks text selection, and stops image dragging across your storefront.
- Enable Secure images to prevent unauthorized image downloads, and turn on Blur content when user is inactive to hide content from idle sessions - a subtle deterrent against screen-scraping tools.
- Move to the Bot & traffic settings and enable Bot detection plus VPN & proxy blocking, so automated scrapers that ignore right-click never reach your images in the first place.
- Optionally add a country, city, or IP blocker to shut out regions that generate the most scraping and abuse.
- Review the blocked-visitor statistics dashboard to see which threats Kedra Shield is stopping.
Because the settings are app-managed, they persist through theme edits and updates - and they apply the copy, drag, and dev-tool rules consistently instead of relying on a script you have to maintain by hand. Merchants using the full stack report a 95% reduction in security threats after implementation. To protect the SEO value of your original images at the same time, pair this with the tactics in protect your Shopify images to boost SEO.
Frequently asked questions
Does disabling right-click hurt SEO or conversions?
No. A lightweight contextmenu script adds negligible page weight and is invisible to search crawlers, so it doesn’t affect rankings. It can mildly annoy power users who copy text legitimately, so keep the deterrent light-touch. The bigger conversion risk is bot-driven slowdowns, which content protection actually helps reduce.
Can people still steal my images after I disable right-click?
Yes - a determined user can disable JavaScript, view the page source, take a screenshot, or run a scraper bot. Disabling right-click stops casual, opportunistic theft, which is the majority of cases. For the rest, add a server-side layer that blocks scraper bots and anonymized VPN/proxy traffic before they reach your images.
Will disabling right-click work on mobile devices?
Touch devices have no right-click, so the context-menu script effectively doesn’t apply there. Long-press “save image” behavior varies by browser and is harder to intercept reliably with client-side code. An app-based approach like Kedra Shield applies image-protection rules more consistently across desktop and mobile than a hand-rolled script.
Do I need Shopify Plus to disable right-click?
No. Right-click and content protection work on every Shopify plan. You can add the script to theme.liquid yourself, or install an app such as Kedra Shield that enables it with a toggle and no code - neither approach requires the Plus tier.
Is editing theme.liquid safe?
It’s safe if you duplicate your theme first and edit the copy, so you can revert instantly. The real drawback isn’t safety but durability: theme updates and redesigns frequently overwrite manual edits, silently disabling your protection. An app avoids that because the settings live outside the theme.
Protect your images before the next competitor copies them
Disabling right-click is the fastest, highest-leverage step you can take to stop casual image and content theft on Shopify - but it’s a deterrent, and real protection is layered. Combine client-side blocking (right-click, copy-paste, drag, dev tools) with server-side defense against the scraper bots and VPN traffic that ignore it entirely.
Kedra Shield turns on all of it from one dashboard, no theme edits, on any Shopify plan. Install Kedra Shield free and protect your product photography today.