# Visibility: Technical SEO & AI (AEO)

> Configure robots.txt, XML sitemaps, RSS 2.0 feeds, JSON-LD identity, AI crawler policies, and llmstxt.org (/llms.txt & /llms-full.txt) artifacts directly from your Content Models.

OvertCMS generates all of your site's **Technical SEO** and **AI / Answer Engine Optimization (AEO)** artifacts directly from your published Content Models—cached in L2 (in-memory or Redis/Valkey) with `ETag`, `Cache-Control`, and `Surrogate-Key` invalidation whenever entries are published, updated, or unpublished.

Manage everything visually under **Manage → Visibility** in the Admin UI, or via `/admin-api/v1/sites/{siteSlug}/visibility`.

---

## Public Visibility Endpoints (Delivery Plane)

| Artifact | Endpoint(s) | Format | Notes |
| :--- | :--- | :--- | :--- |
| **`robots.txt`** | `GET /robots.txt`<br/>`GET /delivery/v1/robots.txt` | `text/plain` | Generated from indexing shield, disallow paths, AI crawler rules, custom rules, and `Sitemap:` directive. |
| **XML Sitemap** | `GET /sitemap.xml`<br/>`GET /delivery/v1/sitemap.xml` | `application/xml` | Standard `sitemaps.org` XML built from published entries in sitemap-enabled models (plus JSON at `/delivery/v1/sitemap.json`). |
| **RSS 2.0 Feed** | `GET /rss.xml`<br/>`GET /delivery/v1/rss.xml` | `application/rss+xml` | Combined RSS 2.0 feed across all RSS-enabled collections, newest first. |
| **Per-Model RSS Feed** | `GET /delivery/v1/{postType}/rss.xml` | `application/rss+xml` | Dedicated RSS 2.0 feed for a single RSS-enabled collection (e.g., `/delivery/v1/posts/rss.xml`). |
| **Public `llms.txt`** | `GET /delivery/v1/llms.txt` | `text/markdown` | Clean `llmstxt.org` site summary and grouped links to published AEO-enabled entries (zero internal CMS details). |
| **Full AI Corpus** | `GET /llms-full.txt`<br/>`GET /delivery/v1/llms-full.txt` | `text/markdown` | Full plain-text/Markdown digest of published AEO-enabled entries, safely bounded by max entries and a 2 MiB ceiling. |
| **SEO & JSON-LD Metadata** | `GET /delivery/v1/visibility` | `application/json` | Default title template, description, resolved OG image URL, ready-to-embed Schema.org `Organization` / `Person` & `WebSite` JSON-LD blocks, and active artifact paths. |

<Note>
  Draft, scheduled, archived, and trashed entries are **never** included in `sitemap.xml`, `rss.xml`, `llms.txt`, or `llms-full.txt`. When `OVERTCMS_DELIVERY_REQUIRE_API_KEY=true`, all visibility Delivery routes enforce `public_read` Bearer authentication and suppress public `Surrogate-Key` headers.
</Note>

---

## Technical SEO Controls

Configure under **Manage → Visibility → SEO**:

- **Search Indexing Shield (`allowIndexing`)**: Toggle off for staging environments to immediately emit `User-agent: * / Disallow: /` in `robots.txt`.
- **Site Metadata Defaults**: Set `titleTemplate` (e.g., `%s | Acme`), `defaultDescription`, `defaultOgImageAssetId`, and `twitterHandle`. Clients fetch these in one cached request via `GET /delivery/v1/visibility`.
- **`robots.txt` Rules**: Toggle automatic `Sitemap:` directive, add disallowed paths (e.g., `/preview/`, `/api/`), or append custom rules.
- **Sitemap & RSS Defaults**: Enable/disable `sitemap.xml` and `rss.xml`, set default `changefreq` (`weekly`, `daily`, etc.), `priority` (`0.0`–`1.0`), and RSS feed title, description, and max items (`1`–`100`).

---

## AI Visibility (AEO) Controls

Configure under **Manage → Visibility → AEO**:

- **AI Summary & Custom Markdown**: Write a concise summary describing your product or publication plus optional Markdown links/facts rendered directly at the top of `/delivery/v1/llms.txt` and `/llms-full.txt`.
- **AI Crawler Policy (`crawlerPolicy`)**: Automatically emits clean per-bot rules into `robots.txt` without editing raw files:
  - `allow_all` — Allow all crawlers.
  - `search_only` — **Allow AI Search/Citation bots** (`OAI-SearchBot`, `PerplexityBot`, `Claude-SearchBot`) while **blocking AI model training scrapers** (`GPTBot`, `ClaudeBot`, `Google-Extended`, `CCBot`, `Bytespider`, `Applebot-Extended`).
  - `block_all` — Disallow all known AI crawlers.
  - `custom` — Choose `allow` or `disallow` individually for each crawler.
- **Entity Identity (JSON-LD)**: Configure `Organization` or `Person`, display name, logo media asset, and `sameAs` profile URLs (GitHub, X, LinkedIn, Wikidata) so clients can drop `visibility.jsonLd` straight into `<script type="application/ld+json">`.

---

## Per-Content-Model Visibility Matrix

Every Content Model automatically inherits sensible defaults (collections with a `urlTemplate` are included in Sitemap, RSS, `llms.txt`, and `llms-full.txt`; helper models without a `urlTemplate` are excluded by default).

You can override any model cleanly in `visibility.models[slug]`:

- `includeInSitemap`, `changeFreq`, `priority`
- `includeInRss`, `summaryField`, `bodyField`
- `includeInLlmsTxt`, `includeInLlmsFull`

---

## Admin API & Live Previews

All visibility configuration endpoints require the `site:manage` capability (`owner` or `admin` role):

- `GET /admin-api/v1/sites/{siteSlug}/visibility` — Returns current settings, resolved per-model overview, canonical AI crawler catalog, active endpoint paths, and 301 redirects count.
- `PATCH /admin-api/v1/sites/{siteSlug}/visibility` — Validates and saves updates, writes an `site.visibility.updated` Audit Log entry, and immediately invalidates L2 delivery caches.
- `GET /admin-api/v1/sites/{siteSlug}/visibility/preview/{artifact}` — Renders a live preview of `robots.txt`, `sitemap.xml`, `rss.xml`, `llms.txt`, or `llms-full.txt` directly inside Admin.

Visibility settings are secret-free and automatically included in portable NDJSON site backups (`export` / `import`).
