# Sitemap & Robots.txt Setup Guide > **SEO Foundation**: Automated sitemap generation and search engine crawl directives for WorkRoot IT Solutions --- ## Overview | File | Purpose | Location | |------|---------|----------| | **sitemap.xml** | Dynamic XML sitemap | `src/pages/sitemap.xml.ts` | | **sitemap-index.xml** | Sitemap index (scalability) | `src/pages/sitemap-index.xml.ts` | | **robots.txt** | Crawl directives | `public/robots.txt` | **Site URL**: `https://workroot.in` --- ## Sitemap Implementation ### Current Coverage | Content Type | Included | Priority | Change Frequency | |--------------|----------|----------|------------------| | Homepage | ✅ | 1.0 | Weekly | | Services | ✅ | 0.9 | Monthly | | Portfolio Index | ✅ | 0.8 | Weekly | | About | ✅ | 0.8 | Monthly | | Blog Index | ✅ | 0.8 | Weekly | | Blog Posts | ✅ | 0.7 | Monthly | | Portfolio Items | ✅ | 0.7 | Monthly | | Contact | ✅ | 0.7 | Monthly | | Legal Pages | ✅ | 0.3 | Yearly | ### Features - ✅ **Dynamic generation** - Automatically includes all published blog posts - ✅ **Draft filtering** - Excludes draft content from sitemap - ✅ **Portfolio support** - Ready for portfolio content collection - ✅ **Last modified dates** - Uses `updatedDate` or `pubDate` from frontmatter - ✅ **Proper namespaces** - Includes news, image, video schemas for future use - ✅ **Caching headers** - 1-hour cache for performance - ✅ **XML formatting** - Valid sitemap protocol --- ## Robots.txt Configuration ### Key Directives ``` User-agent: * Allow: / # Block private areas Disallow: /admin/ Disallow: /private/ Disallow: /_astro/ # Sitemap location Sitemap: https://workroot.in/sitemap.xml ``` ### AI Crawler Support (GEO) The robots.txt explicitly allows **AI search engines** for Generative Engine Optimization: | Bot | Purpose | Allowed | |-----|---------|---------| | GPTBot | ChatGPT training/search | ✅ | | ChatGPT-User | ChatGPT browsing | ✅ | | anthropic-ai | Claude AI training | ✅ | | Claude-Web | Claude search | ✅ | | PerplexityBot | Perplexity AI | ✅ | | Google-Extended | Gemini/Bard | ✅ | | CCBot | Common Crawl (many AIs) | ✅ | | FacebookBot | Meta AI | ✅ | **Why?** AI search engines can cite your content in responses, increasing brand visibility. --- ## Search Engine Submission ### 1. Google Search Console **URL**: https://search.google.com/search-console #### Steps: 1. **Verify ownership**: - Add `google-site-verification` meta tag to `
` - Or upload HTML file to `public/` - Or use DNS TXT record 2. **Submit sitemap**: ``` Property: https://workroot.in Sitemaps → Add new sitemap URL: https://workroot.in/sitemap.xml ``` 3. **Monitor**: - Coverage report (indexed pages) - Enhancement reports (Core Web Vitals) - Performance (search analytics) #### Verification Tag Add to `src/components/SEO.astro`: ```html ``` --- ### 2. Bing Webmaster Tools **URL**: https://www.bing.com/webmasters #### Steps: 1. **Import from Google** (easiest): - Use same Google Search Console account - One-click import 2. **Or verify manually**: - Add `` - Or upload XML file 3. **Submit sitemap**: ``` Sitemaps → Submit sitemap URL: https://workroot.in/sitemap.xml ``` --- ### 3. Yandex Webmaster **URL**: https://webmaster.yandex.com #### Steps: 1. **Add site**: `https://workroot.in` 2. **Verify**: Upload HTML file or add meta tag 3. **Submit sitemap**: ``` Indexing → Sitemap files https://workroot.in/sitemap.xml ``` --- ### 4. IndexNow (Instant Indexing) **What**: Real-time indexing API for Bing, Yandex, and others **URL**: https://www.indexnow.org #### Implementation: ```bash # Generate API key openssl rand -hex 32 > public/[KEY].txt # Submit URLs on publish/update curl -X POST "https://api.indexnow.org/indexnow" \ -H "Content-Type: application/json" \ -d '{ "host": "workroot.in", "key": "YOUR_API_KEY", "urlList": [ "https://workroot.in/blog/new-post/" ] }' ``` **When to use**: After publishing new blog posts or major updates --- ## Sitemap Automation ### Build-Time Generation Sitemap is automatically generated on every build: ```bash npm run build # Sitemap available at: dist/client/sitemap.xml ``` ### Post-Publish Hook (Recommended) Create `.github/workflows/sitemap-ping.yml`: ```yaml name: Ping Search Engines on: push: branches: [main] paths: - 'src/content/blog/**' - 'src/pages/**' jobs: ping: runs-on: ubuntu-latest steps: - name: Ping Google run: | curl "https://www.google.com/ping?sitemap=https://workroot.in/sitemap.xml" - name: Ping Bing run: | curl "https://www.bing.com/ping?sitemap=https://workroot.in/sitemap.xml" ``` --- ## Testing & Validation ### 1. XML Validation **Test locally**: ```bash # Check XML is valid curl http://localhost:10000/sitemap.xml | xmllint --noout - # View in browser open http://localhost:10000/sitemap.xml ``` **Online validators**: - https://www.xml-sitemaps.com/validate-xml-sitemap.html - https://validator.w3.org/feed/ ### 2. Google Sitemap Tester ``` Google Search Console → Sitemaps → Test sitemap ``` ### 3. Check Coverage **Verify all important pages are included**: ```bash curl https://workroot.in/sitemap.xml | grep -o '