How to Manage Documentation SEO
This guide shows you how to use DocuMCP's sitemap management tools to improve your documentation's search engine visibility.
Quick Setup
# Generate sitemap for your documentation:
"generate sitemap for my documentation"
SEO Overview
DocuMCP provides basic SEO support through sitemap management:
Available SEO Features
- XML Sitemap Generation: Automatic sitemap creation for documentation
- Sitemap Validation: Verify sitemap structure and URLs
- Link Discovery: Automatic detection of documentation pages
- GitHub Pages Integration: Optimized for GitHub Pages deployment
SEO Benefits
- Search Engine Discovery: Help search engines find your documentation
- Crawling Efficiency: Provide structured navigation for crawlers
- URL Organization: Maintain clean URL structure
- Update Tracking: Track when pages were last modified
Setup Methods
Method 1: Automatic Sitemap Generation
# Generate sitemap for your documentation:
"generate sitemap for my documentation"
This will:
- Scan your documentation directory
- Discover all markdown and HTML files
- Generate XML sitemap with proper URLs
- Include last modified dates from git history
- Validate sitemap structure
Method 2: Manual Sitemap Management
Step 1: Generate Sitemap
# Create XML sitemap:
"create sitemap for my documentation with base URL https://mydocs.com"
Step 2: Validate Sitemap
# Validate existing sitemap:
"validate my documentation sitemap"
Step 3: Update Sitemap
# Update sitemap with new content:
"update my documentation sitemap"
Sitemap Management
Using MCP Tools
// Generate sitemap using MCP tools
import { manageSitemap } from "./dist/tools/manage-sitemap.js";
// Generate new sitemap
const sitemap = await manageSitemap({
action: "generate",
docsPath: "./docs",
baseUrl: "https://mydocs.github.io/repo",
});
// Validate existing sitemap
const validation = await manageSitemap({
action: "validate",
docsPath: "./docs",
});
// Update sitemap with new content
const update = await manageSitemap({
action: "update",
docsPath: "./docs",
baseUrl: "https://mydocs.github.io/repo",
});
Sitemap Configuration
# Sitemap generation settings
sitemap:
base_url: "https://mydocs.github.io/repo"
include_patterns:
- "**/*.md"
- "**/*.html"
exclude_patterns:
- "node_modules/**"
- ".git/**"
update_frequency: "weekly"
use_git_history: true
Best Practices
Sitemap Management
- Regular Updates: Regenerate sitemap when adding new content
- Proper URLs: Ensure all URLs in sitemap are accessible
- Git Integration: Use git history for accurate last modified dates
- Validation: Always validate sitemap after generation
- Submit to Search Engines: Submit sitemap to Google Search Console
URL Structure
- Use clean, descriptive URLs
- Maintain consistent URL patterns
- Avoid deep nesting when possible
- Include keywords in URLs naturally
Content Organization
- Structure content logically
- Use clear headings and navigation
- Maintain consistent documentation patterns
- Link related content appropriately
Troubleshooting
Common Issues
Problem: Sitemap not generating Solution: Check documentation directory permissions and file patterns
Problem: Invalid URLs in sitemap Solution: Verify base URL configuration and file paths
Problem: Sitemap not updating Solution: Ensure git history is accessible for last modified dates
Problem: Search engines not finding pages Solution: Submit sitemap to Google Search Console and verify accessibility
Sitemap Debugging
# Debug sitemap issues:
"validate my sitemap and check for errors"