Course lesson
Generate a Sitemap in Astro with the sitemap Integration
Astro provides a sitemap integration to make it easy for you to set up your websites sitemap.
- Duration
- 7 min
- Access
- Included
- Transcript
- Retained from source evidence
Astro provides a sitemap integration to make it easy for you to set up your websites sitemap.
Sitemaps are important for allowing search engines to efficiently crawl and index the pages of your website.
To add the sitemap integration you just need to run npx astro add sitemap and add the integration to the integrations array in the config.
From there you can configure your sitemap how you'd expect. You can filter out any pages you don't want in there, add custom pages, adjust the change frequency, modify date, and priority.
You can also serialize your urls (e.g. remove the trailing slash) and add localization properties.