Skip to main content
GET
Sitemap
Generate a comprehensive XML sitemap for your blog posts, optimized for search engine discovery and indexing. This endpoint creates a standards-compliant sitemap that helps search engines efficiently crawl and index your blog content. SEO Optimization: Produces an XML sitemap following the sitemaps.org protocol that includes post URLs and last modification dates. This helps search engines understand your content structure and discover updated content. Filtering for Focused Sitemaps: Apply category or tag filters to create specialized sitemaps for specific content sections. This is useful for large blogs where you want to submit targeted sitemaps to search engines or create separate indexing strategies for different content types.

Authorizations

Authorization
string
header
required

Set the Authorization header to Token your_read_api_token.

Example: Authorization: Token abc123def456

Note: The header value includes the Token prefix. Authorization: Bearer ... is not accepted and returns 401.

You can access your API token from your settings page.

Query Parameters

auth_token
string

Your ButterCMS read API token

category_slug
string

Filter the sitemap to include only posts from a specific category.

Provide the URL-friendly slug of the category. When specified, only blog posts assigned to this category will be included in the sitemap.

tag_slug
string

Filter the sitemap to include only posts with a specific tag.

Provide the URL-friendly slug of the tag. When specified, only blog posts tagged with this tag will be included in the sitemap.

locale
string

Filter the sitemap to include only posts in the given locale (e.g. en, es). When omitted, defaults to your organization's default locale.

Returns 400 if the value is not a locale configured on your organization.

Maximum string length: 10

Response

XML sitemap generated successfully. Note: despite being a sitemap, the response is application/json, and the XML document is returned as a string under data. Requesting Accept: application/xml returns 406 Not Acceptable; there is no XML renderer on this endpoint. Each <url> entry has only <loc> and <lastmod>; there is no <changefreq>.

data
string

Complete XML sitemap with blog post URLs, as a string