Multi-Sitemap Support

Organize your sitemaps by content type with named sitemaps and automatic sitemap index

Why Multiple Sitemaps?

As your site grows, organizing URLs into separate sitemaps provides several benefits:

  • Better GSC insights - Track indexing status by content type (products vs blog)
  • Targeted optimization - Update product sitemaps hourly, blog sitemaps daily
  • Cleaner organization - Separate image-heavy pages from text content
  • Easier debugging - Find and fix indexing issues faster

SitemapHost automatically generates a sitemap index that references all your named sitemaps, compliant with Google's sitemap protocol.

How It Works

  • Named Sitemaps -- Create separate sitemaps for different content types using the sitemapName parameter.
  • Auto Sitemap Index -- SitemapHost automatically creates and maintains a sitemap index containing all your sitemaps.

Common Sitemap Names

Some commonly used sitemap names:

  • pages -- General website pages
  • images -- Pages with image metadata
  • products -- E-commerce product pages
  • blog -- Blog posts
  • categories -- Category/collection pages
  • locations -- Location-based pages
  • news -- News articles

API Usage

Use the sitemapName parameter to create or update a named sitemap:

{
  "domain": "sitemap.yoursite.com",
  "sitemapName": "pages",
  "urls": [
    { "loc": "https://yoursite.com/" },
    { "loc": "https://yoursite.com/about" },
    { "loc": "https://yoursite.com/contact" }
  ]
}
{
  "domain": "sitemap.yoursite.com",
  "sitemapName": "images",
  "urls": [
    {
      "loc": "https://yoursite.com/gallery",
      "images": [
        { "loc": "https://cdn.yoursite.com/img1.jpg", "title": "Product Photo 1" },
        { "loc": "https://cdn.yoursite.com/img2.jpg", "title": "Product Photo 2" }
      ]
    }
  ]
}

Auto-Detection

If you don't provide a sitemapName, SitemapHost automatically detects the best name based on your content:

Content TypeAuto-Detected NameDetection Logic
Image-heavy contentimages>50% of URLs have images array
E-commerceproductsURLs contain /product/ or /products/
Blog contentblogURLs contain /blog/ or /post/
Category pagescategoriesURLs contain /category/ or /collection/
General contentpagesDefault fallback

Pro tip: For best organization, we recommend explicitly setting sitemapName rather than relying on auto-detection.

Generated File Structure

Your domain will have a clean, organized sitemap structure:

https://sitemap.yoursite.com/
  sitemap-index.xml      # Master index (auto-generated)
  sitemap-pages.xml      # General pages
  sitemap-images.xml     # Image-focused pages
  sitemap-products.xml   # Product pages
  sitemap-blog.xml       # Blog posts

Sitemap Index Output

The auto-generated sitemap index references all your named sitemaps:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://sitemap.yoursite.com/sitemap-pages.xml</loc>
    <lastmod>2024-01-15T10:30:00Z</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://sitemap.yoursite.com/sitemap-images.xml</loc>
    <lastmod>2024-01-15T09:15:00Z</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://sitemap.yoursite.com/sitemap-products.xml</loc>
    <lastmod>2024-01-15T11:00:00Z</lastmod>
  </sitemap>
</sitemapindex>

Updating Named Sitemaps

When you upload to a named sitemap, only that sitemap is replaced -- other named sitemaps remain unchanged. This allows you to update different content types independently.

# Update only the products sitemap (pages and images remain unchanged)
curl -X POST https://dash.sitemaphost.app/api/sitemap/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "sitemap.yoursite.com",
    "sitemapName": "products",
    "urls": [...your product URLs...]
  }'

Best Practices

  • Consistent naming - Use the same sitemap names across updates
  • Separate by update frequency - Products that change hourly vs static pages
  • Keep image sitemaps separate - Easier to track image indexing in GSC
  • Use descriptive names - "products-electronics" instead of "sitemap2"
  • Submit the index to GSC - Point Search Console to sitemap-index.xml

Next Steps