Back to Documentation

Sitemap

Help search engines discover and index your blog content.

Lightweight automatically generates a sitemap for your blog that includes all your published posts. This helps search engines like Google discover and index your content more efficiently.

Sitemap Location

Your blog's sitemap is available at the following path:

/blog/sitemap.xml

For example, if your domain is example.com, your sitemap would be at:

https://example.com/blog/sitemap.xml

Custom Domain Support

If you have configured a custom domain for your site, the sitemap URLs will automatically use your custom domain instead of the default subdomain.

For example, if your subdomain is mysite.lightweight.dev but you've configured mysite.com as a custom domain, all URLs in the sitemap will use https://mysite.com/blog/....

This ensures search engines index your content under your preferred domain, improving your SEO and brand consistency.

Adding Sitemap to robots.txt

For best SEO results, we recommend adding your sitemap URL to your website's robots.txt file. This helps search engines find your sitemap automatically.

Why add sitemap to robots.txt?

Search engine crawlers check robots.txt first when visiting your site. Including your sitemap URL here ensures crawlers discover it immediately, even before they crawl any pages.

Add the following line to your robots.txt file:

User-agent: *
Allow: /

Sitemap: https://yourdomain.com/blog/sitemap.xml

Replace yourdomain.com with your actual domain.

What's Included in the Sitemap

The sitemap includes:

  • Blog index page/blog
  • All published posts/blog/your-post-slug

The sitemap is automatically updated whenever you publish new posts or update existing ones.

Submitting to Google Search Console

While Google will eventually discover your sitemap through robots.txt, you can speed up indexing by submitting it directly to Google Search Console:

  1. Go to Google Search Console
  2. Select your property (domain)
  3. Navigate to Sitemaps in the left sidebar
  4. Enter blog/sitemap.xml and click Submit

Google typically processes submitted sitemaps within a few days. You can check the status in Search Console to see how many URLs have been discovered and indexed.