---
title: SEO Optimization
description: Control titles, descriptions, and meta tags for search engines and social previews. Jamdesk auto-generates sitemaps and Open Graph images.
---

Optimize your docs for search engines and social previews by setting titles, descriptions, and metadata in frontmatter.

## What Jamdesk Does Automatically

<Columns cols={3}>
  <Card title="Meta Tags" icon="tags">
    Title and description from frontmatter become meta tags.
  </Card>
  <Card title="Open Graph" icon="share">
    Social sharing images generated for each page.
  </Card>
  <Card title="Sitemap & Robots" icon="sitemap">
    XML sitemap and robots.txt generated on every build.
  </Card>
  <Card title="JSON-LD" icon="code">
    Schema.org structured data on every page for rich search results.
  </Card>
  <Card title="IndexNow" icon="bolt">
    Changed URLs submitted to search engines after each build.
  </Card>
  <Card title="AI Endpoints" icon="robot" href="/ai/overview">
    `llms.txt` and MCP server for AI tools to read your docs.
  </Card>
</Columns>

## Optimizing Your Content

### Write Effective Frontmatter

```yaml
---
title: User Authentication    # Under 60 characters
description: Set up OAuth, JWT, and session-based authentication  # 120-160 characters
---
```

<Tip>
**Front-load keywords.** "Authentication setup" is better than "How to set up authentication."
</Tip>

### Page Titles

- Keep under 60 characters to avoid truncation in search results
- Include your primary keyword near the beginning
- Make each title unique across your docs

### Descriptions

- Aim for 120-160 characters
- Summarize what the reader will learn
- Include relevant keywords naturally

<Note>
**Auto-generated fallback.** When `description` is missing from frontmatter, Jamdesk automatically extracts the first prose paragraph from your page content (up to 155 characters). Headings, code blocks, images, and MDX components are skipped. This is used for `<meta name="description">`, Open Graph, and Twitter cards. Writing an explicit description is still recommended for best results.
</Note>

## Controlling Indexing

### Site-Wide Settings

In your `docs.json`, configure default robot behavior:

```json docs.json
{
  "seo": {
    "metatags": {
      "robots": "index, follow"
    }
  }
}
```

### Per-Page Control

Override indexing for specific pages in frontmatter:

```yaml
---
title: Internal Notes
noindex: true
---
```

Use `noindex` for:
- Draft or work-in-progress pages
- Internal documentation
- Deprecated content you're keeping for reference

## Canonical URLs

If your docs are accessible at multiple URLs, set a canonical:

```yaml
---
title: Getting Started
canonical: https://docs.example.com/getting-started
---
```

## Open Graph Customization

Override the auto-generated social image:

```yaml
---
title: API Reference
og:image: /images/api-social-card.png
---
```

## Sitemap & Robots.txt

Every Jamdesk site generates `sitemap.xml` and `robots.txt` automatically on each build.

| File | Purpose |
|------|---------|
| `sitemap.xml` | Lists all pages with last-modified dates for search engines |
| `robots.txt` | Allows all crawlers and points them to the sitemap |

### Where to find them

The URLs depend on whether your docs live at a root domain or under a `/docs` subpath:

<Tabs>
  <Tab title="Root domain">
    If your docs are at the root of your domain (e.g., `docs.acme.com` or `acme.jamdesk.app`):

    ```bash
    https://docs.acme.com/sitemap.xml
    https://docs.acme.com/robots.txt
    ```
  </Tab>
  <Tab title="/docs subpath">
    If your docs are under `/docs` on your main site (like this site at `jamdesk.com/docs`):

    ```bash
    https://jamdesk.com/docs/sitemap.xml
    https://jamdesk.com/docs/robots.txt
    ```
  </Tab>
</Tabs>

### What's included in the sitemap

- All published pages (excluding those with `noindex` or `hidden` frontmatter)
- Last-modified dates from frontmatter when available
- Weekly change frequency

### Excluding pages from the sitemap

Add `noindex` to frontmatter to exclude a page from both the sitemap and search engines:

```yaml
---
title: Internal Notes
noindex: true
---
```

Pages with `hidden: true` are also excluded automatically.

## JSON-LD Structured Data

Every page automatically includes [schema.org](https://schema.org) structured data as a `<script type="application/ld+json">` tag with two schemas:

- `WebSite`: your site name, URL, and description (from `docs.json`).
- `BreadcrumbList`: navigation path from Home to the current page, derived from your `navigation` config.

No configuration needed. Search engines use this for rich results like breadcrumb trails in search listings.

<Tip>
**Verify your markup.** Paste any page URL into [Google's Rich Results Test](https://search.google.com/test/rich-results) to confirm the structured data is detected.
</Tip>

## IndexNow

After each build, Jamdesk automatically submits changed page URLs to [IndexNow](https://www.indexnow.org) for faster search engine indexing. This notifies Bing, Yandex, and other participating search engines about your content changes without waiting for their next crawl cycle.

- Fires after every successful build
- Only submits pages that actually changed
- Non-blocking, so it never delays your build
- No configuration required

## Best Practices

<Check>Every page has a unique, descriptive title</Check>
<Check>Descriptions summarize the content accurately</Check>
<Check>Headings use a logical hierarchy (H1 → H2 → H3)</Check>
<Check>Internal links use descriptive anchor text</Check>
<Check>Images have alt text for accessibility</Check>

## Related Articles

<Columns cols={2}>
  <Card title="Frontmatter Reference" icon="file-lines" href="/content/frontmatter">
    All available frontmatter options
  </Card>
  <Card title="docs.json Reference" icon="gear" href="/config/docs-json-reference">
    Site-wide configuration options
  </Card>
</Columns>
