type: service
status: active
timestamp: 2026-06-20
tags: [seo, sitemap, astro, build-time, primary]
status: active
timestamp: 2026-06-20
tags: [seo, sitemap, astro, build-time, primary]
@astrojs/sitemap
Official Astro sitemap integration — generates sitemap.xml at build
@astrojs/sitemap
Role
Generates sitemap-index.xml + sitemap-0.xml for every Astro site
in the family at build time. Output ships in the static bundle on
Cloudflare Pages — no runtime cost, no service to depend on.
Free tier
- MIT-licensed npm package
- No backend, no API, no quota
- Generates sitemap files at
astro buildtime, dropped intodist/
Card / subscription required?
NO. Pure build-time tool.
Configuration
// astro.config.mjs
import sitemap from "@astrojs/sitemap";
export default {
site: "https://blog.oriz.in",
integrations: [
sitemap({
changefreq: "weekly",
priority: 0.7,
lastmod: new Date(),
filter: (page) => !page.includes("/draft/"),
}),
],
};
Site URL passed to site: in the Astro config feeds the
fully-qualified URLs in the output XML.
Alternatives
- Hand-rolled sitemap generator script — works but every site reimplements the same boilerplate
next-sitemap— wrong framework- Algolia / sitemap-as-a-service — paid past trial, no value over the build-step approach
Swap cost
Low — output is plain sitemap.xml, the contract any consumer
reads. Replacing the integration is a build-step change inside one
site repo.
Why this is our pick
It’s the official Astro integration. Every site already runs Astro
(
context), so adding the integration is one line in astro.config.mjs.
Free, OSS, no backend, no card.
Cross-refs
- SEO three pillars decision — sitemap is pillar 1
- IndexNow — pillar 2 (instant indexing)
- JSON-LD structured data — pillar 3 (semantic markup)
- Google Search Console — sitemap submission target
- Bing Webmaster — sitemap submission target