Define a site

A number of tasks required for creating and managing sites in a Commerce instance can be done in the Commerce administration UI, though other tasks, such as enabling a site, are developer tasks that must be done via the Admin REST API.

Only users with the Administrator, All Commerce, or Settings roles can create and manage sites. See Configure Internal User Accounts for information about assigning roles to users.

Create a site

This section describes how to create a new site in the administration interface. Sites you create in the administration interface are not automatically enabled. To enable a new site, you must use the Admin REST API. See Configure Sites to learn how to enable sites.

When you create a new site in the administration interface, you must give it a Site Title and Site Base URL. Commerce automatically assigns it an ID, which is not visible in the administration interface, but which you can access with the Admin REST API.

To create a new site:

  1. Click the Settings icon.
  2. Click the + button next to the Setup menu item to display the Create Site dialog.
  3. Enter the following required information for the new site, then click Save:

    Site Title: Provides the default value of the <title> tag for all your store’s pages, including the store’s home page.

    Site Base URL: Provides the base string value for absolute URL link generation, for example, for sitemap URLs.

  4. Enter additional information about the store for the new site. See Enter basic store information for details.

Change the default site

To simplify site creation, Commerce designates one site as the default site. When you create a new site in the administration interface, you must give it a unique Site Title and Site Base URL. Commerce automatically assigns it an ID, which is not visible in the UI. The new site inherits all its other properties from the default site, though you can change them on the Settings Setup page.

In addition to serving as a template for site creation, the default site is used as the destination for requests to your Commerce instance when a URL cannot be otherwise resolved. For example, if a shopper tries to access a store with a URL that does not match the production URL (the primary URL for accessing the site) or any of the additional production URLs (alternate URLs that can be used to access the site), Commerce displays the home page of the default site.

There is always one default site in an individual instance of Commerce. Initially, this is the site included with each Commerce instance. This site’s initial Site Title is Commerce Site and its internal ID is siteUS. Once you have created other sites, you can change which site is the default. A site must be enabled before you can make it the default. Sites you create in the administration interface are not automatically enabled. To enable a new site, you must use the Admin REST API. See Configure Sites in Configure Sites to learn how to enable sites.

To change the default site:

  1. Click the Settings icon.
  2. Select Setup from the list of settings.
  3. Pick a site to make the default from the list that appears above the settings list.
  4. On the General tab, select the Make Default Site checkbox.
  5. On the General tab, select the Make Default Site checkbox.
  6. Click Save on the General tab.

Delete a site

Deleting a site may affect many aspects of your store, including orders, reports, and a number of store settings. You should not delete a site that is currently in use with your production environment. You cannot delete the default site. If you want to delete the site that is currently the default, first make a different site the default.

To delete a site:

  1. Click the Settings icon.
  2. Select Setup from the list of settings.
  3. Pick a site to delete from the list that appears above the settings list.
  4. On the General tab, click Delete.
  5. Click Continue in the Warning box to confirm that you want to delete the site.
  6. Click Save on the General tab.