To discourage users from downloading images, you can disable right-clicking on your Webflow site, though it's important to note this is not a foolproof method for protecting content.
Go to the Page Settings for any page where you want to apply this, or place the code in a site-wide custom code section.
In the Before
tag section, add this inline JavaScript:
Content:document.addEventListener('contextmenu', event => event.preventDefault());
This script disables the context menu (which appears on right-click) on the entire page.
If you only want to disable right-click on images specifically:
Use this alternate snippet instead:
document.querySelectorAll('img').forEach(img => img.addEventListener('contextmenu', e => e.preventDefault()));
This ensures that right-click is only blocked on <img>
elements.
<img>
elements.To disable right-clicking on images in Webflow, add a small JavaScript snippet via Custom Code that targets the entire page or just <img>
elements. This adds basic protection, but remember it won't prevent determined users from accessing your images.