Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 52 additions & 2 deletions docs/features/schema/schema-aggregator/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,59 @@ curl https://example.com/wp-json/yoast/v1/schema-aggregator/get-schema/post/2

---

### Get XML Schemamap
### Get XML Schemamap — site-root URL (since 28.3)

Retrieve an XML sitemap of all available schema endpoints.
Starting with Yoast SEO 28.3, the schemamap is also served at the site root as a plain XML file:

```
GET https://example.com/schemamap.xml
```

This URL is served by WordPress's rewrite layer (no REST API required) and returns the same XML document as the REST endpoint below. AI crawlers and NLWeb-compliant consumers can fetch it without knowing the WordPress REST API path prefix.

**Response Format:**

```xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url contentType="structuredData/schema.org">
<loc>https://example.com/wp-json/yoast/v1/schema-aggregator/get-schema/page</loc>
<lastmod>2026-01-01T14:03:56Z</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
<url contentType="structuredData/schema.org">
<loc>https://example.com/wp-json/yoast/v1/schema-aggregator/get-schema/post</loc>
<lastmod>2026-01-01T14:03:56Z</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
</urlset>
```

**Response Headers:**

```
Content-Type: application/xml; charset=UTF-8
Cache-Control: public, max-age=300
X-Robots-Tag: noindex, follow
```

**Example Request:**

```bash
curl https://example.com/schemamap.xml
```

:::note
The site-root URL and the REST endpoint both serve the same cached XML. Yoast SEO automatically flushes the cache when relevant content changes, so both URLs stay in sync.
:::

---

### Get XML Schemamap — REST endpoint

Retrieve an XML sitemap of all available schema endpoints via the REST API.

**Endpoint:**
```
Expand Down
29 changes: 20 additions & 9 deletions docs/features/schema/schema-aggregator/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,29 @@ The Schema Aggregator implements a dynamic caching strategy:

### Schemamap (XML map for structured data)

The schemamap provides an XML index of all available schema endpoints:
The schemamap provides an XML index of all available schema endpoints. Starting with Yoast SEO 28.3, the schemamap is accessible at two URLs:

- **Site-root URL** (new in 28.3): `https://example.com/schemamap.xml` — a plain URL served by WordPress's rewrite layer, designed for AI crawlers and NLWeb-compliant consumers.
- **REST endpoint**: `https://example.com/wp-json/yoast/v1/schema-aggregator/get-xml` — the original REST API path.

Both URLs return the same cached XML document:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema>
<loc>https://example.com/wp-json/yoast/v1/schema-aggregator/get-schema/post</loc>
</schema>
<schema>
<loc>https://example.com/wp-json/yoast/v1/schema-aggregator/get-schema/page</loc>
</schema>
</schemalist>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url contentType="structuredData/schema.org">
<loc>https://example.com/wp-json/yoast/v1/schema-aggregator/get-schema/post</loc>
<lastmod>2026-01-01T14:03:56Z</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
<url contentType="structuredData/schema.org">
<loc>https://example.com/wp-json/yoast/v1/schema-aggregator/get-schema/page</loc>
<lastmod>2026-01-01T14:03:56Z</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
</urlset>
```

### External source support
Expand Down