How to disable right click on impact theme?

Topic summary

A user seeks to disable right-click functionality on their Shopify store using the Impact theme. Multiple developers provide similar solutions:

Proposed Solution:

  • Navigate to Online Store → Themes → Edit Code
  • Open the theme.liquid file
  • Insert JavaScript code above the </body> tag that prevents the context menu from appearing

Code Variations Offered:
Two slightly different JavaScript implementations were shared:

  1. Using oncontextmenu="return false;" in a script tag
  2. Using document.addEventListener('contextmenu', function(event) { event.preventDefault(); });

Current Status:
The discussion remains unresolved. The original poster tested the suggested solutions but reported they “doesn’t work,” indicating the code snippets failed to disable right-click as intended. One responder requested the store URL for further troubleshooting, but no follow-up solution has been provided yet.

Summarized with AI on November 2. AI used: claude-sonnet-4-5-20250929.

Thanks!!

1 Like

Hey @zeyna111

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag


If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

Hi @zeyna111 Please add the below code:

document.addEventListener('contextmenu', function (event) {
    event.preventDefault();
});

Please follow the steps:

  1. Login in shopify admin.
  2. Click on the Online Store.
  3. Then click on the button next to Customize in live Theme.
  4. Click Edit Code.
  5. Search theme.liquid in the code in left hand side in your theme.
  6. Add the following code in the bottom of the file above tag

Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!

Best Regards

Sahil

Hello, @zeyna111
Please share “Store URL”
Thanks!

Hello @zeyna111 ,

Here are the steps to apply the necessary changes in your Shopify store:

In your Shopify Admin, navigate to Online Store > Themes > Actions > Edit Code.
Locate layout>theme.liquid and paste the following code just before the closing tag:


Let me know if you need further assistance!

doesnt work…

doesn’t work…