Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
VTEX IO Apps
Store Framework
Navigation and search
Sitemap
Official extension
Version: 2.18.6
Latest version: 2.18.6

Source code

The Sitemap app generates a sitemap.xml file for your store website, helping search engines like Google discover and index your pages more efficiently.

Once the app is installed and configured, your sitemap is automatically generated and kept up to date based on your store's routes and settings.

Before you begin

Use Edition App 3.x or later

Sitemap is available for stores using vtex.edition-store@3.x or a later version of the Edition app.

To check which Edition App is installed on your account, run vtex edition get. If it's an older edition, please open a ticket with VTEX Support to request the installation of the vtex.edition-store@5.x Edition App.

Configure sitemap content

Adjust the products, navigation, and custom routes that will be included in the sitemap. Check the Advanced configuration section for more information.

Instructions

For all stores

  1. Using your terminal and the VTEX IO CLI, log in to your account.

  2. Run vtex use {workspaceName} --production to use a production workspace or create a production workspace from scratch.

    Remember to replace the values in curly brackets with the values that apply to your scenario.

  3. Run vtex install vtex.store-sitemap@2.x to install the Sitemap app.

    If you are using vtex.edition-store@5.x, skip step 3, as the vtex.store-sitemap@2.x app is installed by default with this version. Check our Edition App documentation to learn more about the different versions.

  4. Choose your path:

Cross-border setup

Skip this section if your store is not cross-border. For non-cross-border stores, these steps are performed automatically when you install vtex.store-sitemap@2.x.

  1. Run vtex install vtex.admin-graphql-ide@3.x to install the GraphQL Admin IDE.

  2. In your browser, access the Admin and go to Store Settings > Storefront > GraphiQL IDE.

  3. From the dropdown list, choose the vtex.routes-bootstrap@0.x app.

  4. If this isn't the first time you're generating the store sitemap or if no changes have been made to the store routes since the last time you generated the store sitemap, go to step 5. Otherwise, run the following query:


    _10
    {
    _10
    bootstrap {
    _10
    brands
    _10
    categories
    _10
    }
    _10
    }

    The expected response body is:


    _10
    {
    _10
    "data":{
    _10
    "bootstrap": {
    _10
    "brands": true,
    _10
    "categories": true
    _10
    }
    _10
    }
    _10
    }

  5. Now, from the GraphQL IDE dropdown list, select the vtex.store-sitemap@2.x app.

  6. Run the following query:


    _10
    {
    _10
    generateSitemap
    _10
    }

    The expected response body is:


    _10
    {
    _10
    "data": {
    _10
    "generateSitemap": true
    _10
    }
    _10
    }

    This means your sitemap will be available in a few minutes after it's processed and saved in our database.

    The time taken to generate a sitemap is proportional to the number of products. For example, 60k products take about 30 minutes, while 5k products take about 5 minutes.

    If you attempt to send a new request to the Sitemap API during store sitemap generation, the following message will be displayed:


    _10
    Sitemap generation already in place
    _10
    Next generation available: <End-date>

    To force a restart, add the force argument to the query, as in generateSitemap(force: true). This will cancel the previous process.

Verify your sitemap

  1. Check the sitemap generated for the current workspace you're working on by accessing https://{workspace}--{account}.myvtex.com/sitemap.xml in your browser.

    Different .xml files are generated based on their entity type (product, category, subcategory, user routes, brand, and department), and each .xml file supports a maximum of 5k routes. If you have a cross-border store, you'll first see an index with a sitemap for each locale.

  2. If you're happy with the results, run vtex promote to promote your workspace and include your sitemap in your master workspace.

    Once you've promoted your workspace, no further action is needed on your part: You're ready to check the store sitemap by accessing https://{account}.myvtex.com/sitemap.xml in your browser.

Advanced configuration

Managing routes

You can decide whether to include products, navigation, apps, and/or routes that contain a specific term in your sitemap. To do that, follow the instructions below:

  1. In your browser, type {workspace}--{account}.myvtex.com/admin, replacing the values in curly brackets with values that apply to your scenario, to access the VTEX Admin of the production workspace you're working on.

  2. Go to Account settings > Apps > My apps and search for the Sitemap app.

  3. Enable or disable products, navigation, apps, or routes containing a specific term for your scenario.

    {"base64":"  ","img":{"width":3024,"height":1885,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":478142,"url":"https://github-production-user-asset-6210df.s3.amazonaws.com/112641072/299387054-649f7dcf-583d-497f-a69c-4cfc3d8a805a.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20260330%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260330T182057Z&X-Amz-Expires=300&X-Amz-Signature=c16322f1860614375d0b2602866ca8e5002d7da3660d0cc0a31983c2eebec45d&X-Amz-SignedHeaders=host"}}

Enabling custom routes

If you have custom pages configured in a routes.json file and want them included in the store sitemap, add isSitemapEntry=true as a prop of the routes you want to include in the sitemap. Example:


_10
{
_10
"store.custom#about-us": {
_10
"path": "/about-us",
_10
"isSitemapEntry": true
_10
}
_10
}

Once everything is set up, return to the Instructions and follow the steps for your store type.

Extending the sitemap

To add custom routes created by an app (for example, the ones created by store-locator) to the store sitemap, the app must respond to an XML file containing a list of the routes created by that app. Finally, add the path of your app's XML file to the store sitemap index.

For implementation details, check the following instructions:

  1. Create or modify your app to respond to the following route /sitemap/{index-name}.xml and return an XML file containing the data you want the search engine (for example, Google) to index. Replace the values inside the curly brackets based on your scenario.

    We recommend using a pre-generated XML file. Otherwise, the XML file will be built from scratch for every request, which will take longer to complete.

  2. Publish and install your app in a production workspace.

  3. To make your index available in the sitemap root file (/sitemap.xml), access the VTEX Admin of the workspace you're working on, and select the GraphQL IDE.

  4. From the dropdown list, choose the vtex.store-sitemap@2.x app and run the following mutation, adapting it to your scenario:


    _10
    mutation {
    _10
    saveIndex(index: "{index-name}")
    _10
    }

    If you have a cross-border store, the saveIndex mutation also accepts the binding ID as an argument, which means that by specifying the binding ID, you can add your new index to the sitemap of the desired binding. If the binding ID is not specified, the mutation will consider the default binding of the store.

  5. Check the updated sitemap for the current workspace you're working on by accessing https://{workspace}--{account}.myvtex.com/sitemap.xml in your browser.

  6. If you're happy with the results, run vtex promote to promote your workspace and include the sitemap in your master workspace.

Removing a custom route

If you want to remove a custom route, execute the following mutation, which takes the same arguments as saveIndex:


_10
mutation {
_10
deleteIndex(index: "{index-name}")
_10
}

Fetching custom routes in JSON format

The vtex.store-sitemap app exposes an API endpoint that allows you to retrieve route data in JSON format. This endpoint is useful for external sitemap generation or custom indexing workflows.

The endpoint returns a combination of routes defined via CMS and internal pages, and those defined by installed apps in their build.json files.

Product, brand, and category routes are not included.

MethodEndpoint
GET/_v/public/sitemap/custom-routes

Example request:


_10
GET https://{workspace}--{account}.myvtex.com/_v/public/sitemap/custom-routes

Example response:

Custom route generation is subject to internal limits. If you notice missing routes in the response, please contact VTEX Support.


_10
[
_10
{
_10
"name": "apps-routes",
_10
"routes": ["/store-locator/ny", "/store-locator/ca"]
_10
},
_10
{
_10
"name": "user-routes",
_10
"routes": ["/about-us", "/contact", "/faq"]
_10
}
_10
]

See also
VTEX App Store
VTEX IO Apps
CUSTOM_ROUTES_ARCHITECTURE
VTEX IO Apps
Was this helpful?