Hide google lens option on my website

Topic summary

A user wants to prevent Google Lens from functioning on their website images, similar to what they’ve observed on other sites. They’re seeking a solution that won’t impact site performance.

Proposed Solutions:

  • Disable right-click using JavaScript to prevent the context menu from appearing
  • Block pointer events on images via CSS (pointer-events: none)
  • Modify image rendering with CSS filters to make images harder for Google Lens to process

Current Status:
The original poster appreciates the suggestions but needs clarification on:

  • Which method is most effective for their goal
  • Where to implement these code snippets (specific sections)
  • Step-by-step implementation instructions, as they lack coding experience

The discussion remains open with the user awaiting more detailed guidance on implementation.

Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

Hi,

I have noticed a couple of websites where I do not find an option of Google Lens on right click to trace the source or similar such styles. I want to implement the same on my website too. Can someone please help how to achieve that. For example: Addery.co.in to quote. I am aware this is not built on shopify but I know of shopify websites as well having the same feature which I do not want to quote here. I know its possible but I do not know how.

Someone please guide me to achieve this.

Hi @Pari12

You can disable the Google Lens option on right-click in Chrome using a combination of JavaScript and CSS. Here’s how you can do it:

1. Disable Right-Click (Basic Method)
If you want to prevent users from right-clicking on images:

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

2. Block Google Lens via CSS
You can use the following CSS to prevent Google Lens from interacting with images:

img {
    pointer-events: none;
}

3. Modify Image Rendering (Advanced)
Google Lens relies on recognizing images directly. You can use CSS to modify how images are rendered, making them harder for Google Lens to process:

img {
    filter: contrast(101%) brightness(99%);
}
1 Like

Thank you so much. I was not sure if I had put the query correctly. But you understood it well. But how do I find out which is best for me? I just do not want customers be able to search or land other options basis the search on google lens. Something that will not affect the overall performance of the site. Moreover I am not a coder myself. If you explain the steps for these in detail would be really helpful. Once again, thanks a lot.

I mean where do i use these codes? which sections?