---
title: SEO
subtitle: Every page is complete HTML generated at build time, with canonical, hreflang, Open Graph, and structured data; the sitemap, robots.txt, and redirects are generated automatically.
description: SEO in ButterIX — static HTML, title templates and meta, canonical (including older versions), hreflang, Open Graph and Twitter cards, JSON-LD structured data, sitemap.xml, robots.txt and AI crawler policy, redirects, trailing slashes, 404, preview deployments, and performance.
---

## Static HTML

At build time ButterIX uses React server rendering to output complete HTML for every page, **without relying on client-side JavaScript to render content**. Search engine crawlers, social link previews, and AI crawlers get everything readers see — body text, code examples, and API parameter tables included.

Navigation between pages happens without a full reload via a tiny client script, and links are prefetched with Speculation Rules, but that's only an experience enhancement: with JavaScript disabled, the site is still fully browsable.

## The head of every page

Taking this page as an example, the builder outputs:

```html title="<head> (excerpt)"
<title>SEO · ButterIX</title>
<meta name="description" content="SEO in ButterIX — static HTML, title templates and meta…">
<link rel="canonical" href="https://acme-payments-sites.butterix.com/guides/features/seo">
<link rel="alternate" hreflang="zh" href="https://acme-payments-sites.butterix.com/guides/features/seo">
<link rel="alternate" hreflang="x-default" href="https://acme-payments-sites.butterix.com/guides/features/seo">
<link rel="alternate" hreflang="en" href="https://acme-payments-sites.butterix.com/en/guides/features/seo">
<link rel="alternate" type="text/markdown" href="/guides/features/seo.md" title="Markdown">
<meta property="og:type" content="article">
<meta property="og:site_name" content="ButterIX">
<meta property="og:title" content="SEO · ButterIX">
<meta property="og:url" content="https://acme-payments-sites.butterix.com/guides/features/seo">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@bitidocs">
<script type="application/ld+json">{"@type":"TechArticle", …}</script>
<script type="application/ld+json">{"@type":"BreadcrumbList", …}</script>
```

| Output | Source |
|---|---|
| `<title>` | `seo.title-template` (default `{page} \| {site}`); the page title can be overridden with frontmatter `og:title` |
| description | frontmatter `description` → `og:description` → `subtitle` → body excerpt |
| keywords | frontmatter `keywords` |
| `og:image` | frontmatter `og:image` → `seo.og-image`; with an image, the Twitter card automatically becomes `summary_large_image` |
| `article:modified_time` | frontmatter `last-updated` |
| `robots` | `noindex, nofollow` is output for page `noindex`, `noindex` in the navigation, `seo.noindex`, or preview deployments |

See [Page metadata](../configuration/frontmatter.mdx#seo) and [docs.yml › SEO](../configuration/docs-yml.mdx#seo) for field details.

## canonical

- Defaults to the page's own absolute URL, on the site's [primary domain](../deploy/custom-domains.mdx#after-activation).
- **Older version pages** point canonical to the same page in the default version, so similar content across versions doesn't compete for ranking. See [Versions](./versions.mdx#matching-the-same-page-across-versions).
- Set it manually with frontmatter `canonical-url`.

## Structured data

Every page outputs two JSON-LD blocks:

- `TechArticle`: title, description, URL, language (`inLanguage`), `dateModified` (when `last-updated` is set), and the parent `WebSite`.
- `BreadcrumbList`: generated from the section path in the navigation, matching the breadcrumbs on the page.

## sitemap.xml

`/sitemap.xml` contains every page (all languages and versions, except `noindex` pages and changelog date detail pages), and each URL carries `xhtml:link` entries for its other language versions:

```xml title="sitemap.xml (excerpt)"
<url>
  <loc>https://acme-payments-sites.butterix.com/guides/features/seo</loc>
  <xhtml:link rel="alternate" hreflang="zh" href="https://acme-payments-sites.butterix.com/guides/features/seo"/>
  <xhtml:link rel="alternate" hreflang="en" href="https://acme-payments-sites.butterix.com/en/guides/features/seo"/>
</url>
```

## robots.txt and AI crawlers

The default `robots.txt` allows all crawlers and declares the sitemap:

```text title="robots.txt"
User-agent: *
Allow: /

Sitemap: https://acme-payments-sites.butterix.com/sitemap.xml
```

### Declare content use

`seo.content-signal` outputs `Content-Signal` in `robots.txt`, saying what your content may be used for. All three are optional booleans; ones you leave out aren't output:

```yaml title="docs.yml"
seo:
  content-signal:
    search: true      # building a search index
    ai-input: true    # input for AI answers
    ai-train: false   # training models
```

```text title="robots.txt"
User-agent: *
Content-Signal: search=yes, ai-input=yes, ai-train=no
Allow: /
```

### Block AI crawlers

With `seo.ai-crawlers: disallow`, the following AI training and retrieval crawlers are additionally blocked:

<Columns cols={3}>
  <Column>
    - GPTBot
    - ChatGPT-User
    - OAI-SearchBot
    - ClaudeBot
    - Claude-User
  </Column>
  <Column>
    - Claude-SearchBot
    - anthropic-ai
    - PerplexityBot
    - Google-Extended
  </Column>
  <Column>
    - Applebot-Extended
    - CCBot
    - Bytespider
    - meta-externalagent
  </Column>
</Columns>

### Use your own robots.txt

```yaml title="docs.yml"
agents:
  robots-txt: robots.txt   # relative to docs.yml
```

The file is published as it is; `ai-crawlers` and `content-signal` no longer apply.

With `seo.noindex: true` or on preview deployments, `robots.txt` is always `Disallow: /`, even with your own file.

<Info>
  Docs usually want to be read by AI: developers increasingly learn about an API through ChatGPT, Claude, and Cursor. ButterIX allows AI crawlers by default and provides `.md` and `llms.txt` so they read more accurately; see [Agent-friendly](./agents.mdx).
</Info>

## Redirects

When restructuring, use `redirects` to keep the ranking of old links:

```yaml title="docs.yml"
redirects:
  - source: /docs/getting-started
    destination: /guides/get-started/quickstart
  - source: /api/v1/:endpoint
    destination: /api-reference/:endpoint
```

- 301 permanent redirects by default; `permanent: false` gives 302.
- Redirects keep the query string; `.md` and `.mdx` URLs go to the Markdown of the target page.
- When the home page isn't `/`, the root URL automatically 302-redirects to the home page.

## URL normalization

- Page URLs have no trailing slash; the runtime 308-redirects `/guides/` to `/guides` to avoid duplicate URLs.
- Nonexistent URLs return a real **404 status code** and `404.html` (with `noindex`); requests for Markdown get a [Markdown 404](./agents.mdx#redirects-and-missing-pages).

## Performance

Speed is itself a ranking factor:

- Zero hydration: pages don't need to re-render in the browser.
- Code highlighting happens at build time, and icons are combined into an in-page SVG sprite with no icon fonts loaded.
- `.br` and `.gz` are precompressed at build time, and the runtime returns them directly based on `Accept-Encoding`.
- Hashed static assets (styles, scripts, fonts) use a one-year `immutable` cache; HTML is revalidated every time.

## Preview deployments

Every page of a preview deployment (pull requests, editor previews, `biti deploy --preview`) carries `noindex`, `robots.txt` blocks crawling, and a "Preview" banner appears at the top of the page, so previews never compete with the production site for indexing.
