An XML sitemap is one of the most important SEO tools for any website. It tells search engines exactly which pages exist on your site, when they were last updated, and how they relate to each other. For Cloudflare Workers sites, generating a dynamic sitemap requires a different approach than traditional server-based setups.

Why Cloudflare Workers Need Dynamic Sitemaps

Cloudflare Workers run at the edge — your code executes in data centers around the world, not on a single server. This means you can't just generate a static sitemap.xml file at build time and forget about it. Every time you add or update content, your sitemap needs to reflect those changes.

A dynamic sitemap generated at request time ensures search engines always see your latest content. The EmDash Auto Blog/SEO plugin handles this automatically — it queries your D1 database for published posts and generates a valid XML sitemap on every request.

What a Good Sitemap Includes

A proper sitemap should include:

Every published page and post URL

The <lastmod> date so search engines know when content was updated

A <changefreq> hint (daily, weekly, monthly) for crawl priority

<priority> values to signal which pages are most important

The Auto Blog/SEO plugin's sitemap endpoint at /sitemap.xml generates this automatically from your content collections. Submit it to Google Search Console and you're done — no manual updates needed.

Bonus: Robots.txt Integration

The plugin also serves a dynamic robots.txt that references your sitemap URL. This is another common SEO pitfall that EmDash handles automatically — no more forgetting to update your sitemap reference after a domain change.