Back to Posts

Add a sitemap to your Gatsby site

By: Daniel Jimenez | Published on: Apr 05 2020

A sitemap is a file where you provide information about the pages, videos, and other files on your site, and the relationships between them. Search engines like Google read this file to more intelligently crawl your site. A sitemap tells Google which pages and files you think are important in your site, and also provides valuable information about these files: for example, for pages, when the page was last updated, how often the page is changed, and any alternate language versions of a page.

Read more:

How to add a Sitemap on Gatsby

The site map will only generate when run in production


npm install --save gatsby-plugin-sitemap
On Terminal or vscode terminal

On your gatsby-config.js

siteMetadata: {
  siteUrl: ``,
plugins: [`gatsby-plugin-sitemap`]

This is the basic configuration of gatsby-plugin-sitemap read more about the other available options.


2022 © Copyright, Daniel Jimenez