About Testing Your Code in Preview Mode

You can test the code on your site before publishing using Preview mode. You can perform any actions in Preview mode that you would be able to perform on your live site. When testing your site, you can check if any errors appear in the Wix Developer Console.

Supported IDEs

Preview mode is available in Wix Studio and Wix Editor. If you're developing in the Wix IDE or the Local IDE, you can open your site in Wix Studio or Wix Editor to use Preview mode.

Enter Preview mode

To enter Preview mode in Wix Studio, either click the Run button in the code editor toolbar, or the preview button on the top right.

To enter Preview mode in Wix Editor, either click on the Run button in the code editor toolbar, or the Preview button in the Editor on the top right.

Collections in Preview mode

When you've finished previewing and return to the Editor, interactions you had with your site aren't maintained. Your site returns to the state it was in before you entered Preview mode. The only exception is your optional sandbox collection, which is disabled by default.

The sandbox collection is useful when you want to test your site without affecting your site's data. When the sandbox collection is enabled and you interact with data from your collections, you'll be using the optional sandbox version of your collections, not the live version. Changes to data that result from interactions with your site in Preview mode persists in your optional sandbox database.

Differences between Preview mode and published sites

Although your can view your pages and interact with your site and data in Preview mode, the site doesn't behave exactly as it does when published:

  • When previewing your site, you are assigned the Admin role. That means you are granted all possible permissions. Users of your live site might have different permissions and therefore have more restricted access.
  • When previewing your site with sandbox enabled, you're working with the data in your site's optional sandbox database. Users of your live site work with your live database. Wix app collections, however, only have the live database version. Any changes you make to these collections in Preview mode are reflected in your published site.  
  • Backend events and several other APIs don't necessarily work when previewing your site. We note when this is the case in the reference.

You can try out a test version of your published site on a small percentage of visitors using the Release Manager. This is helpful for testing functionality that only works on a published site without exposing that functionality to all site visitors.

Handling errors

If you see errors or your site isn't running as expected, there are tools you can use to debug the code in your site.

See also

Did this help?