Skip to content

sitemap missing (Astro)

No @astrojs/sitemap integration, no sitemap endpoint in src/pages/, and no static public/sitemap.xml. Without a sitemap, search engines rely on link discovery alone, which is unreliable for sites with more than a handful of pages.

@astrojs/sitemap is the right approach. It generates a sitemap automatically from your routes at build time and requires no manual maintenance.

Terminal window
npx astro add sitemap

That command installs the package and adds it to astro.config.ts. You must also set site in the config — the integration cannot generate absolute URLs without it.

astro.config.ts
import { defineConfig } from 'astro/config'
import sitemap from '@astrojs/sitemap'
export default defineConfig({
site: 'https://example.com',
integrations: [sitemap()],
})

After the next build, the sitemap appears at /sitemap-index.xml.

Terminal window
curl https://yourdomain.com/sitemap-index.xml

Confirm the response is valid XML. Then re-run orino audit.