Website Building » Squarespace » How Do I Disable Right Click on Squarespace?

How Do I Disable Right Click on Squarespace?

Last updated on December 25, 2022 @ 10:36 am

There are a few different ways to disable right click on your Squarespace website. The first way is to add a bit of code to your site’s CSS file.

This code will disable right-clicking anywhere on your site.

To add this code, go to the Design tab, click Edit CSS, and paste the following code into the box:

PRO TIP: Right-clicking on a Squarespace website can result in unexpected results, including opening up the site’s source code or triggering a pop-up menu. It is therefore advised to avoid right-clicking on Squarespace websites.
body {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

The second way to disable right click is to add a bit of code to your site’s JavaScript file. This code will also disable right clicking anywhere on your site.

To add this code, go to the Settings tab, click Advanced, and then click Code Injection. Paste the following code into the box labeled “Footer”:

<script type="text/javascript"> 
document.oncontextmenu=RightMouseDown; 
document.onmousedown = mouseDown; function mouseDown(e) { 
   if (e.which==3) return false; 
   } 
   function RightMouseDown() { 
   return false;
 }</script>

Conclusion:

These two methods should successfully disable right click on your Squarespace website. If you want to re-enable right click at any time, simply remove the code that you added.

Madison Geldart

Madison Geldart

Cloud infrastructure engineer and tech mess solver.