- Meta tag generation
- Sitemap and
robots.txtfile generation - Semantic HTML structure
- Mobile optimization
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. This improves SEO when your documentation is accessible from multiple URLs and prevents issues with duplicate content.
Page-specific meta tags
To set page-specific meta tags, add them to a page’s frontmatter. The following meta tags are supported at the page level:title- Page titledescription- Page description appears below the title on the page and in some search engine resultskeywords- Comma-separated keywordsog:title- Open Graph title for social sharingog:description- Open Graph descriptionog:image- Open Graph image URLog:url- Open Graph URLog:type- Open Graph type like “article” or “website”og:image:width- Open Graph image widthog:image:height- Open Graph image heighttwitter:title- Twitter card titletwitter:description- Twitter card descriptiontwitter:image- Twitter card imagetwitter:card- Twitter card type like “summary” or “summary_large_image”twitter:site- Twitter site handletwitter:image:width- Twitter image widthtwitter:image:height- Twitter image heightnoindex- Set totrueto prevent search engine indexingrobots- Robots meta tag value
Meta tags with colons must be wrapped in quotes. The
keywords field must be formatted as a YAML array.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.
Only pages included in your docs.json are included by default. To include hidden links, add seo.indexing to your docs.json:
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.
Disabling indexing
If you want to stop a page from being indexed by search engines, you can include the following in the frontmatter of your page:noindex for all pages in your docs by setting the metatags.robots field to "noindex" in your docs.json:
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
- Make each page title and description unique
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
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
- Use the automatic cross-referencing features
Image SEO
Image SEO
- Use descriptive file names for images
- Always include alt text for accessibility and SEO
- Optimize image file sizes for faster loading
- Use relevant images that support your content