Skip to content

design: SEO foundation (identity, connected structured data, canonical URLs, discovery) - #4765

Open
swissky wants to merge 6 commits into
emdash-cms:mainfrom
swissky:design/seo-foundation
Open

swissky wants to merge 6 commits into
emdash-cms:mainfrom
swissky:design/seo-foundation

Conversation

@swissky

@swissky swissky commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Design proposal

Proposal: proposals/seo-foundation.md

EmDash's SEO output is spread over several separate pieces. Social links are limited to six fixed keys. Authors have no identity in structured data. JSON-LD is one unconnected block that plugins can only replace as a whole, and canonical URLs depend on the template. This RFC proposes a shared foundation in two phases that can be shipped independently:

  1. Identity: site:identity (Organization or Person), an open list of profile links with separate sameAs and rel="me" switches, handle-only platforms such as WeChat, profile links on users and guest bylines, and job titles on bylines. site:social keeps working in both directions.
  2. Connected graph and canonical URLs: one URL resolver for canonical, sitemap, og:url and JSON-LD; an @id-linked @graph; jsonld-node contributions so plugins can replace, merge or remove single nodes.

Robots controls, IndexNow, sitemap providers and editorial tooling are separate proposals that link this one:

Proposal type

  • Feature plan
  • RFC
  • Amendment, supersession, or withdrawal

Related work

Discussion: #4621, #4614, #2990

Supersedes the social-links scope of #4714 (its author, @Evgenii-Zinner, co-authors this RFC, and Phase 1 starts from his prototype branch). Builds on #4341 for sitemaps. Related: #4155, #4131, #4471, #4529, #2291.

Readiness

  • The proposal identifies its author and, for an RFC, its champion and Maintainer sponsor
  • The proposal describes observable behavior, compatibility, failure handling, and verification in proportion to its risk
  • Conflicting accepted or pending proposals are reconciled in this pull request
  • This pull request contains no implementation code
  • The proposal status is accepted (check only when ready to merge)

AI assistance

  • This proposal used AI assistance — model/tool: Claude Opus 5.5

…, discovery)

Co-authored-by: Evgenii Zinner <121451298+Evgenii-Zinner@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bbcabd2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Evgenii-Zinner Evgenii-Zinner left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on the Open Questions:

  1. Emit sameAs for legacy site:social by default?
    Yes, by default. Sites currently emit zero sameAs output. Automatically emitting sameAs: true for the six standard platforms (as the prototype does) gives upgrading sites an immediate, Knowledge Graph boost without waiting for an editor to re-save settings.

  2. profile_links per locale vs. shared across translations?
    Per locale, as proposed. Creators and organizations frequently have region-specific profiles (e.g. Weibo/WeChat for Chinese locales, localized Twitter/X handles for French or German). The proposed "Copy to all translations" action in the admin UI prevents redundant data entry for shared links.

  3. seo.schemaType location?
    Collection admin config. It’s an SEO mapping preference rather than a core capability toggle (unlike drafts or i18n in supports).

  4. IndexNow in core vs. first-party plugin?
    In core. Since Phase 3 already houses sitemap providers and canonical URL resolution in core, bundling IndexNow keeps the discovery toolset unified and avoids requiring a separate plugin install for basic real-time search engine pinging.

Comment thread proposals/seo-foundation.md Outdated
IndexNow tells participating search engines about changed URLs ([IndexNow documentation](https://www.indexnow.org/documentation)). The protocol's [list of participating engines](https://www.indexnow.org/searchengines.json) includes Bing, Yandex, Naver, Seznam, Yep, Internet Archive and Amazonbot. Google is not on the list, so IndexNow has no effect on Google Search.

- **Key.** An administrator enables IndexNow in the SEO settings. Core then generates a key of 32 hexadecimal characters (the protocol allows 8 to 128) and stores it in `site:indexnow`, which is target-local: site transfer doesn't copy it, so a cloned site gets its own key.
- **Key file.** Core serves the key at `/indexnow-{key}.txt` as UTF-8 plain text and sends that URL as `keyLocation`. Because the file sits at the root of the host, it authorizes every URL on the host. Requests for any other key return 404.

This comment was marked as outdated.

Comment thread proposals/seo-foundation.md Outdated
- **Invalid stored identity.** Values that fail validation on read, such as a link with an unsupported scheme written by an older client, are left out of the output and logged with the prefix `[seo]`. They stay in storage, and the admin shows them with an error so an administrator can fix them.
- **Graph builders.** A builder that throws is skipped and logged; the rest of the graph renders. A plugin contribution that fails to serialize is dropped, as `jsonld` contributions are today.
- **Sitemap providers.** A failing provider is left out of the index and logged, and its route returns 500. Other sitemaps are unaffected.
- **IndexNow.** 200 and 202 count as success. On 429 the URLs are kept and sent with the next submission. On 403 (key not valid) automatic submissions stop and the settings screen asks the administrator to check the key file. Other errors are logged and recorded in `emdash:indexnow_status`. No failure affects the save or publish that triggered it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On HTTP 429, the RFC currently states "the URLs are kept and sent with the next submission". The IndexNow FAQ instructs clients to inspect the Retry-After header and wait before resubmitting. If an editor publishes another post 10 seconds later, retrying immediately would breach the backoff window. We should parse Retry-After, store a cooldown timestamp in emdash:indexnow_status, and suppress outgoing calls until the window expires.

Comment thread proposals/seo-foundation.md Outdated
- **Invalid stored identity.** Values that fail validation on read, such as a link with an unsupported scheme written by an older client, are left out of the output and logged with the prefix `[seo]`. They stay in storage, and the admin shows them with an error so an administrator can fix them.
- **Graph builders.** A builder that throws is skipped and logged; the rest of the graph renders. A plugin contribution that fails to serialize is dropped, as `jsonld` contributions are today.
- **Sitemap providers.** A failing provider is left out of the index and logged, and its route returns 500. Other sitemaps are unaffected.
- **IndexNow.** 200 and 202 count as success. On 429 the URLs are kept and sent with the next submission. On 403 (key not valid) automatic submissions stop and the settings screen asks the administrator to check the key file. Other errors are logged and recorded in `emdash:indexnow_status`. No failure affects the save or publish that triggered it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should treat 422 the same as 403 here.
According to the IndexNow FAQ, HTTP 422 (Unprocessable Entity) is returned when the key file is inaccessible/missing (/{key}.txt returns 404, redirect, or WAF block) or when the submitted domain doesn't match the key.
Automatic submissions should stop on both 403 and 422, prompting the administrator to check that the key file is accessible and matches the site domain.

Comment thread proposals/seo-foundation.md Outdated

IndexNow tells participating search engines about changed URLs ([IndexNow documentation](https://www.indexnow.org/documentation)). The protocol's [list of participating engines](https://www.indexnow.org/searchengines.json) includes Bing, Yandex, Naver, Seznam, Yep, Internet Archive and Amazonbot. Google is not on the list, so IndexNow has no effect on Google Search.

- **Key.** An administrator enables IndexNow in the SEO settings. Core then generates a key of 32 hexadecimal characters (the protocol allows 8 to 128) and stores it in `site:indexnow`, which is target-local: site transfer doesn't copy it, so a cloned site gets its own key.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also specify a "Regenerate key" action in the SEO settings here.
If submissions is halt due to a 403 or 422 error, the administrator needs a way to rotate the key and re-verify without having to toggle the entire IndexNow integration off and on (or manipulate database options directly).


Properties per node come from Google's documentation for the matching feature:

- **Article:** `headline`, `datePublished`, `dateModified`, `image`, and every author listed separately with `url` or `sameAs`. The author `name` holds only the name; `jobTitle` carries the title ([Article: author markup best practices](https://developers.google.com/search/docs/appearance/structured-data/article#author-bp)). Dates are ISO 8601 with a time zone offset, computed from the site time zone.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Article node properties, should we also map entry.excerpt to description? Google uses description alongside headline for snippet generation.

Comment thread proposals/seo-foundation.md Outdated
- **Search and social preview.** The SEO panel shows how the entry's title, description and URL may appear in a search result, and how its Open Graph image, title and description look when shared. The preview uses the same resolved values as the head output, including fallbacks, and states that search engines choose their own snippets.
- **Robots controls.** The SEO panel shows **Hide from search results** (`noIndex`) and **Don't follow links** (`noFollow`) as separate switches. The SEO settings expose `defaultRobots`.
- **Redirect import and export.** CSV import and export for the existing redirects, with validation per row and a report of rejected rows ([issue #2291](https://github.com/emdash-cms/emdash/issues/2291)). The 404 log gains a **Create redirect** action.
- **Content checks.** Warnings in the SEO panel and in a site-wide report, each tied to a concrete fix: missing or duplicate SEO title, missing description, missing image alt text, an article image below the 50K pixels Google recommends, a canonical that points at a redirect or a 404, `noindex` on an entry linked from a menu, entries no other entry links to, and titles or descriptions beyond a configurable length. Checks never block a save, and plugins can add checks.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while 50K total pixels is Google's minimum for standard Search, Google Discover specifically requires width >= 1200px when paired with max-image-preview:large. We might want the content check to flag images narrower than 1200px.

areaServed?: string[];
foundingDate?: string;
/** Organization only. */
identifiers?: Array<{ propertyID: string; value: string }>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make sure the JSON-LD graph builder emits these as PropertyValue items:

{
"@type": "PropertyValue",
"propertyID": "VAT",
"value": "..."
}


Kevin Kyburz (@swissky) and Evgenii Zinner (@Evgenii-Zinner) implement the phases. Each phase is one or more implementation PRs that link this RFC.

Phase 1 starts from Evgenii's prototype on the [`feat/dynamic-social-links`](https://github.com/Evgenii-Zinner/emdash/tree/feat/dynamic-social-links) branch of his fork. It already synthesizes the link list from `site:social` on read, converts stored handles to profile URLs with `relMe: false`, merges legacy writes without dropping custom links, and keeps `site:social` in sync on every write, with unit and render tests. The implementation PR keeps that engine, moves the list into `site:identity.links`, adds handle-only platforms and the separate `sameAs` switch, and moves `sameAs` from `WebSite` to the publisher node. The admin editor is rebuilt for the identity screen.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where should the Identity UI live in the admin navigation?

Currently we have Settings -> General, Settings -> Social, and Settings -> SEO. Does Settings -> Identity replace Settings -> Social (since identity encompasses social links), or do you envision it as a dedicated new tab /settings/identity?

Evgenii-Zinner added a commit to Evgenii-Zinner/emdash that referenced this pull request Nov 8, 2026
…-cms#4765 Phase 1)

- Centralize platform registry with patternUrlBuilder factory, handle extractors, and registerPlatform() hook.
- Support handle-only platforms (wechat) that never generate public URLs.
- Add SiteIdentity type and schemas supporting Organization and Person publisher types, address, policies, and identifiers.
- Implement bidirectional sync between authoritative site:identity and legacy site:social.
Evgenii-Zinner added a commit to Evgenii-Zinner/emdash that referenced this pull request Nov 8, 2026
IndexNow root key file, Retry-After, 422, key regeneration; Discover image
check; iso6523Code; one SEO settings screen; user-level profile links with
measured query counts; settle open questions.
@github-actions github-actions Bot removed the query-count changed PR diff modifies query-count snapshot files label Nov 13, 2026
@swissky

swissky commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

Thanks a lot for the careful review, @Evgenii-Zinner, these are really helpful. I've pushed an update to the RFC that covers them.

Key file: agreed. The protocol recommends the root location and the FAQ expects the file to be named exactly {key}.txt, so core now serves /{key}.txt and still sends keyLocation.

429: agreed. Core reads Retry-After, stores the end of the wait in emdash:indexnow_status and sends the queued URLs after it.

422: agreed, automatic submissions now stop on 422 as on 403.

Regenerate key: added to the SEO settings. It also resumes submissions that stopped on a key error.

Discover images: added as a separate check for article images narrower than 1200 px when max-image-preview:large is set, next to the 50K-pixel check.

Article description: Google's Article documentation doesn't list description, and snippets come from the page title and meta description, so I left it out of the article node. Happy to revisit if we find a feature that uses it.

Identifiers: known schemes keep their own properties (vatID, taxID), and unknown ones become identifier entries of type PropertyValue, as you suggested. Google now prefers iso6523Code over leiCode and duns, so LEI and DUNS go through iso6523Code.

Identity screen: the SEO settings become one screen with sections for the publisher, search appearance and discovery. The publisher section replaces Settings > Social, and the old route redirects.

Open questions: I recorded your answers on 1, 3 and 4. On 2, I went a different way after looking at how authors would maintain their links: profile links now live on the user and are shared across locales, so an author enters them once in their own profile. Guest bylines keep their own links, and job titles stay per locale. I measured the extra users join on SQLite and D1 and query counts stay unchanged. Your Weibo/WeChat case would need a per-locale override, which I left out until a site actually needs it. Does that work for you?

@swissky
swissky marked this pull request as ready for review November 13, 2026 07:30
@github-actions

Copy link
Copy Markdown
Contributor

Approval status

The current revision does not meet the approval requirements yet.

  • ❌ 1 human Maintainer approval from someone other than the author (normal change); found 0.
  • ✅ The RFC sponsor @swissky opened this pull request.
  • ❌ Support from a Maintainer other than the author and the Project Lead.
  • ❌ The Project Lead @ascorbic has not accepted the RFC.
  • ✅ No outstanding change requests.

This comment updates as reviews arrive. See MAINTAINING.md and the proposal process for the rules.

@github-actions github-actions Bot added the review/needs-review No maintainer or bot review yet label Nov 13, 2026
@Evgenii-Zinner

Copy link
Copy Markdown

Got it, thanks for the updates!

  • Article description: My bad, I mixed up <meta name="description"> with the JSON-LD Article node. Leaving it out of Article makes total sense.
  • SEO screen & Profile UI: I'll update my work to follow this layout.
  • Open Question 2: Works for me.

@MA2153 MA2153 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Kevin. I believe this RFC is trying to do too many things at once. Can we split it?

For example:

  1. SEO foundation RFC (Phase 1 and 2): identity, profile links, author identity, resolveEntryUrl, canonical rules, @graph, jsonld-node
  2. Robots: noFollow column, defaultRobots, the editor panel switches
  3. Sitemap providers and news sitemap: add it into #4341 or make it a follow-up
  4. IndexNow: a small RFC
  5. Phase 4: can be made into feature plans

You don't have to restate resolveEntryUrl and @id. RFCs can link to each other and amend existing ones. This would make it easier to review each piece on its own.

@emdashbot emdashbot Bot added review/needs-review No maintainer or bot review yet and removed review/needs-review No maintainer or bot review yet labels Nov 13, 2026
@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-review No maintainer or bot review yet labels Nov 13, 2026
Robots controls, IndexNow, sitemap providers and editorial tooling move to
separate proposals that link this RFC.
@github-actions github-actions Bot added the review/needs-rereview New commits since the last review label Nov 14, 2026
@swissky

swissky commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Thanks @MA2153, that's a fair point, and you're right that RFCs can link to each other instead of restating resolveEntryUrl and the @id scheme. I've split it up:

  • This PR now covers only identity and the connected graph with canonical URLs (former Phases 1 and 2). Robots are out of it.
  • Robots controls: feature plan in #ROBOTS (separate noindex and nofollow, defaultRobots, the migration for existing entries).
  • IndexNow: small RFC in #INDEXNOW, with the review points from @Evgenii-Zinner carried over.
  • Sitemap providers, news and video sitemaps: a follow-up to design: list extra sitemaps in the built-in sitemap index #4341 once that one is settled.
  • Editorial tooling (former Phase 4): separate feature plans later.

The follow-ups link back to this RFC for the shared pieces. Does this split work for you?

@MA2153

MA2153 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Yes, thanks Kevin. I'll submit another review for the narrowed RFC specifically.

@danielmlr danielmlr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Kevin! A few ideas came up , mostly small, so they're inline below. Happy to take another look once these are in!


#### Head output

`<link rel="me">` is emitted for every site link with `relMe` that resolves to an https URL, and on an author archive also for the links of that byline, or of its user when it has one. `PageMetadataLinkRel` gains `"me"`, so plugins can contribute such links.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With "me" in PageMetadataLinkRel, any sandboxed plugin could add a rel="me" link and get any Mastodon profile verified as the site's own. Maybe me could stay core-only?

Phase 2 depends on one function that returns an entry's public URL:

```ts
function resolveEntryUrl(entry: {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctx.content.getPublicUrl() already resolves an entry's public URL, and my RFC in #4723 pulls it out into a shared function. Right now the two don't quite line up: getPublicUrl() returns null without a site URL or for collections that aren't routable, and it passes the publish date that patterns like /{year}/{slug} need, which isn't taken here. It'd be great if this could just be that shared function, with one set of rules for when null comes back.


1. Every content page emits `<link rel="canonical">`. Without an editor override, it points at the page itself. Google: "Do include a rel="canonical" link on the canonical page itself".
2. The URL is absolute and has no fragment. Google asks for absolute rather than relative paths and generally doesn't support fragments in canonical URLs. Graph `@id` values keep their fragments, because they identify nodes, not pages.
3. Query parameters are removed, so `?utm_source=…` and `?gclid=…` variants point at the clean URL. Pagination is the exception: page 2 of an archive is its own canonical and doesn't point at page 1. Templates pass the page number in the page context.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the shipped templates page through archives with ?cursor= rather than a page number, every archive page after the first would end up with its canonical pointed back at page 1. Maybe templates could name the query parameters that make a page distinct, like cursor?

5. An editor's override in the SEO panel resolves to an absolute URL, as today. When it points at another URL, the entry is left out of the sitemap, so the site never submits a URL whose page names a different canonical.
6. Core emits the canonical in the HTML head only, not also as a `Link` header. Google recommends choosing one method because two can disagree.
7. A page with `noindex` keeps its self-referencing canonical. Google advises against using `noindex` to choose a canonical.
8. Custom Astro routes pass `canonical` to `createPublicPageContext`, as today. When they don't, core uses the request URL without query string, under the same rules.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the request URL is used as is, /about and /about/ could end up with two different canonical URLs, since Astro serves both by default. Maybe the path could be normalized with the trailingSlash setting here, the way getPublicUrl() already does?


#### Author data in the page context

`createPublicPageContext` accepts `authors?: BylineSummary[]`. Templates pass `entry.data.bylines`, which `getEmDashEntry` already hydrates. When `authors` is absent, the article node falls back to `articleMeta.author` as a name-only `Person`, which is today's output. Core never queries bylines during a page render to build the graph.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With authors typed as BylineSummary[], sandboxed page:metadata hooks would also see the userId and custom fields that BylineInfo leaves out. Maybe BylineInfo plus the new link fields could be used here instead?

- **Writing legacy.** A client that writes `site:social` updates the first link of each matching platform in `site:identity` and leaves every other link and switch untouched. An empty string removes that platform's first link.
- **Rollback.** An older version ignores `site:identity`. `site:social` still holds the current six values, because every write kept it in sync.

Site transfer exports `site:identity`. An older version that imports it ignores the unknown setting.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the code, an older version would actually reject the unknown setting name rather than ignore it (settingRecordSchema in transfer/format/kinds.ts), so the import gets blocked. The byline record is strict too, and user profile links wouldn't be carried over at all, since the users table isn't part of site transfer and a principal record only holds a name and an email. Maybe a short Transfer subsection could cover this, e.g. an optional package feature like comment_reactions, with the links on the principal record and column classes for the new byline fields in transfer/format/columns.ts?


## Performance

The logged-out render path keeps its query count:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The users join covers the author links nicely, but from the code a few other inputs for the head aren't there yet: the page context only carries the entry's collection, id and slug, and the URL pattern takes a query per request unless the object cache is configured. A logo stored as its own media reference would also add a lookup to the settings load on a cold start. Could it be spelled out how each input reaches the head, maybe by folding the URL pattern and routable into _emdash_entry_metadata the way the title field already is?

@emdashbot emdashbot Bot added review/needs-rereview New commits since the last review and removed review/needs-rereview New commits since the last review labels Nov 18, 2026
@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-rereview New commits since the last review labels Nov 18, 2026
Evgenii-Zinner added a commit to Evgenii-Zinner/emdash that referenced this pull request Nov 18, 2026
…-cms#4765 Phase 1)

- Centralize platform registry with patternUrlBuilder factory, handle extractors, and registerPlatform() hook.
- Support handle-only platforms (wechat) that never generate public URLs.
- Add SiteIdentity type and schemas supporting Organization and Person publisher types, address, policies, and identifiers.
- Implement bidirectional sync between authoritative site:identity and legacy site:social.
Evgenii-Zinner added a commit to Evgenii-Zinner/emdash that referenced this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: signed review/awaiting-author Reviewed; waiting on the author to respond size/XL type/design

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants