---
title: "Manually configure the sites in a multisite application"
slug: "manually-configure-the-sites-in-a-multisite-application"
abstract: "Configure the Multisite add-on to statically generate a subset of sites or override the site configuration for all your sites."
---
# Manually configure the sites in a multisite application

By default, the Next.js Multisite add-on fetches a list of site information directly from your Sitecore instance, and all sites are statically generated at build time.

In some situations, you might want to reduce the number of statically generated sites or specify which sites to include in your multisite JSS Next.js application.

You can apply both procedures simultaneously.

## Configure a subset of sites for static generation

All [sites are statically generated by default at build-time](https://doc.sitecore.com/xp/en/developers/hd/23/sitecore-headless-development/preparing-the-list-of-pages-for-static-generation-or-export-in-jss-next-js-apps.html "Preparing the list of pages for static generation or export in JSS Next.js apps"), but you can configure the Multisite add-on to generate only a subset of sites statically.

To change the list of statically generated sites:

- In the root directory of the Next.js application, in the `src\lib\sitemap-fetcher\plugins\graphql-sitemap-service.ts` file, for the `sites` parameter, provide a list of specific site names. For example:

    ```json
    ['foo', 'bar']
    ```

> [!important]
> Ensure all sites passed to the `MultisiteGraphQLSitemapService` options are on your Sitecore instance.
>
> If a site (either passed manually or inherited from the `JSS_APP_NAME` environment variable) does not have a content tree, the static generation will fail for all sites.
>
> See [how the SiteResolver generates site lists in a JSS Next.js app with the Multisite add-on](https://doc.sitecore.com/xp/en/developers/hd/23/sitecore-headless-development/the-next-js-multisite-add-on.html#UUID-c605671a-b384-5039-2caa-7581787df45c_section-idm4631468383044833551516396218 "APIs") for more information.

## Override the JSS site configuration for all sites

The Next.js Multisite add-on sets the JSS config `sites` at build-time in the provided JSS `config` plugin defined in the `/scripts/config/plugins/multisite.ts` file.

By default, a multisite-enabled application fetches site information (type `SiteInfo`) directly from Sitecore using the `GraphQLSiteInfoService` service, but you can provide a list of sites instead.

To override or set the list of sites:

- Provide the list of sites to the `SITES` environment variable as an array of JSON-formatted objects matching the `SiteInfo` type. For example:

    ```json
    [{"name":"foo","hostName":"foo.com","language":"en"},{"name":"bar","hostName":"bar.com","language":"en"}]
    ```

This method is suitable for a small number of sites. For a more extensive list, you can modify the plugin to retrieve sites from another source, such as a static JSON file instead.