Skip to content
All Answers
General

How do I disable right-click on Squarespace?

While disabling right-click isn't a true security measure (determined users can always bypass it), it does discourage casual image downloading. Add a small script to your site's code injection.

This approach uses the contextmenu event listener to prevent the default right-click behavior. Note that this affects all right-click functionality including text selection menus, so use it sparingly.

<script>
document.addEventListener('contextmenu', function(e) {
  e.preventDefault();
});
</script>

/* Optional: also prevent drag on images */
img {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
Find more snippets in our Code Snippets libraryTry it free →

Related Questions

General

How do I find the CSS selector for any element in Squarespace?

General

How do I change the background color of a specific section in Squarespace?

General

How do I hide a specific element by its ID in Squarespace?

General

How do I add a back-to-top button in Squarespace?

A little over your head?

No shame — this stuff is hard. Let the pros handle it.

Long Drive MarketingTalk to Long Drive Marketing →