- Meta tag generation: Automatic creation of essential meta tags from page frontmatter
- Sitemap and
robots.txtfile generation: Automatic generation and updates on deployment - Semantic HTML structure: Proper heading hierarchy and semantic elements
- Mobile optimization: Responsive design that works across all devices
- Fast page loads: Optimized assets and efficient rendering
- Clean URLs: SEO-friendly URL structure based on file paths
metatags field to your docs.json or a page’s frontmatter.
Global meta tags
To set default meta tags for all pages, add themetatags field to your docs.json.
Set a canonical URL
If you’re using a custom domain, set thecanonical meta tag to ensure search engines index your preferred domain. A canonical URL tells search engines which version of your documentation is the primary one.
Why canonical URLs matter:
- Prevents duplicate content issues when docs are accessible from multiple URLs
- Consolidates ranking signals to your preferred domain
- Helps search engines understand which version to index
- Essential when using custom domains, subdomains, or CDN URLs
The canonical URL should be the primary domain where you want search traffic directed. Don’t include the page path—Mintlify automatically appends it.
Page-specific meta tags
To set page-specific meta tags, add them to a page’s frontmatter.Meta tags with colons must be wrapped in quotes.
Common meta tags reference
Below is a comprehensive list of meta tags you can add to yourdocs.json. These meta tags help improve your site’s SEO, social sharing, and browser compatibility.
The
og:image adds a background image that Mintlify automatically overlays with your logo, page title, and description when generating social media previews.Sitemaps and robots.txt files
Mintlify automatically generates asitemap.xml file and a robots.txt file. You can view your sitemap by appending /sitemap.xml to your documentation site’s URL.
Sitemap configuration
Only pages included in yourdocs.json navigation are included by default. To include hidden pages, add seo.indexing to your docs.json:
"navigable"(default): Only pages in your navigation structure"all": All pages, including hidden pages and those not in navigation
Submitting your sitemap
After deploying your documentation:- Visit Google Search Console
- Add and verify your property (domain or URL prefix)
- Navigate to “Sitemaps” in the left sidebar
- Enter your sitemap URL:
https://yourdomain.com/sitemap.xml - Click “Submit”
Custom sitemaps and robots.txt files
To add a customsitemap.xml or robots.txt file, create a sitemap.xml or robots.txt file at the root of your project. Adding a custom file will override the automatically generated file of the same name. If you delete a custom file, the default file will be used again.
When to use custom files:
- You need specific sitemap formatting for third-party tools
- You want to exclude specific user agents in robots.txt
- You need multiple sitemaps for different content types
- You want to add custom crawl delays or directives
Disabling indexing
Control which pages search engines can index using thenoindex directive.
Per-page noindex
To prevent a specific page from being indexed, addnoindex to the page’s frontmatter:
- Internal or draft documentation
- Deprecated pages that should remain accessible but not searchable
- Staging or preview environments
- Pages with duplicate content
Site-wide noindex
To prevent all pages from being indexed, set themetatags.robots field in your docs.json:
Other robots directives
You can use additional robots meta tag directives:index/noindex: Allow or prevent indexingfollow/nofollow: Allow or prevent following linksnoarchive: Prevent cached copies in search resultsnosnippet: Prevent text snippets in search resultsnoimageindex: Prevent images from being indexed
SEO best practices
Write descriptive titles and descriptions
Write descriptive titles and descriptions
- Use clear, descriptive page titles (50-60 characters)
- Write compelling descriptions (150-160 characters)
- Include relevant keywords naturally
- Make each page title and description unique
- Place primary keywords near the beginning
- Match user search intent
- Avoid keyword stuffing or clickbait
Optimize your content structure
Optimize your content structure
- Use proper heading hierarchy (H1 → H2 → H3)
- Write for humans first, search engines second
- Include relevant keywords in headings and content
- Keep URLs short, descriptive, and organized hierarchically
- Break up long content with subheadings and lists
- Use bullet points for scannable information
- Add code examples and practical demonstrations
- Include visual aids (diagrams, screenshots, videos)
Internal linking strategy
Internal linking strategy
- Link to related pages within your documentation
- Use descriptive anchor text instead of “click here”
- Create topic clusters by linking related concepts
- Ensure all important pages are linked from at least one other page
- Add contextual links within body content
- Use relative paths for internal links
- Fix broken links promptly
Image SEO
Image SEO
- Use descriptive file names:
oauth-flow-diagram.pngnotimage1.png - Always include alt text for accessibility and SEO
- Keep alt text under 125 characters
- Optimize image file sizes for faster loading
- Use modern formats (WebP, AVIF) when possible
- Implement lazy loading for images below the fold
- Use relevant images that support your content
- Compress images without sacrificing quality
Technical optimization
Technical optimization
- Ensure fast page load times (under 3 seconds)
- Optimize Core Web Vitals (LCP, FID, CLS)
- Use semantic HTML elements
- Implement structured data (schema markup)
- Ensure mobile responsiveness
- Enable HTTPS for security
- Minimize JavaScript and CSS
- Use a CDN for faster content delivery
Content freshness
Content freshness
- Update outdated content regularly
- Add publication and update dates where relevant
- Refresh underperforming pages
- Remove or redirect obsolete pages
- Monitor for broken links and fix them
- Keep code examples current with latest versions
- Add new content targeting high-value keywords
Advanced SEO techniques
Schema markup
Add structured data to help search engines understand your content:Open Graph tags
Optimize social media sharing with Open Graph tags:International SEO
For multi-language documentation, use hreflang tags:Backlink strategy
Build authority through quality backlinks:- Create valuable, shareable content
- Contribute to developer communities (Stack Overflow, Reddit, Dev.to)
- Write guest posts on relevant blogs
- Get listed in developer resource directories
- Engage with your community on social media
- Create tools or resources others want to link to