Note: While our most popular guides have been translated into Spanish, some guides are only available in English.
Disabling scripts in preview

Custom code in your site’s Code Injection area can sometimes prevent you from securely editing your site. You’ll see this message at the bottom of your site if your code is interfering:

We detected an error loading your site preview. This is usually caused by injected code.

To edit securely, we recommend disabling your scripts in preview. This means that you won’t see your custom code while logged into your site, but it won’t affect how your site appears to visitors.

Disable scripts

To continue editing accurately, click Disable Scripts in Preview at the bottom of your site. The message will change to Scripts have been disabled on your site preview

To view your custom code, open a new private or incognito window in your browser and enter your page’s URL.

Disable scripts manually

If the disable scripts message doesn't appear automatically, you can prompt the message to appear. To do this, type /safe at the end of your secure editing URL, then press Enter. Your secure editing URL contains the word "config." If you don't see that word, ensure you're logged in and your full preview is collapsed.

Some types of custom code will prevent the message from appearing. If manually triggering the disable scripts message doesn't work, check any areas where you've added custom code to temporarily remove it while troubleshooting.


Should I click “Enable Scripts in Preview?”

After you’ve disabled your code, you may see an Enable Scripts in Preview? message at the bottom of your site.

We don't recommend clicking this, as it may prevent you from editing your site. In some cases, the code may render, but it can also interfere with your ability to preview or run your site when you're logged in. 

It’s not possible to hide this message, but you’ll only see it when you’re logged into your site—it’s not visible to visitors.

Was this article helpful?
16 out of 114 found this helpful
Disabling scripts in preview