Adds an SEO button to the editor toolbar of configured collections that opens a drawer running the Yoast engine in the browser on the current unsaved form values. Title, meta description and slug are read from configured dot-paths, and body content comes from an extractor you write and register. Requires Payload 3.90 or later and the companion guard plugin for an access policy. Optional OpenAI generation of titles and descriptions is available.
Installation
npm i @focus-reactive/payload-plugin-seo37
Stars
5
Forks
33
Open Issues
Today
Last Updated
884
Weekly Downloads
v4.0.1
npm Version
1.2 MB
Unpacked Size
6
Dependencies
37+22 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 37 |
| Dec 5, 2026 | 37 |
| Dec 4, 2026 | 37 |
| Dec 3, 2026 | 37 |
| Dec 2, 2026 | 37 |
| Dec 1, 2026 | 36 |
| Nov 30, 2026 | 35 |
| Nov 29, 2026 | 35 |
| Nov 28, 2026 | 34 |
| Nov 27, 2026 | 34 |
| Nov 26, 2026 | 34 |
| Nov 25, 2026 | 34 |
| Nov 24, 2026 | 34 |
| Nov 23, 2026 | 34 |
| Nov 22, 2026 | 34 |
| Nov 21, 2026 | 34 |
| Nov 20, 2026 | 33 |
| Nov 19, 2026 | 32 |
| Nov 18, 2026 | 32 |
| Nov 17, 2026 | 32 |
| Nov 16, 2026 | 32 |
| Nov 15, 2026 | 32 |
| Nov 14, 2026 | 32 |
| Nov 13, 2026 | 32 |
| Nov 12, 2026 | 32 |
| Nov 11, 2026 | 32 |
| Nov 10, 2026 | 32 |
| Nov 9, 2026 | 31 |
| Nov 8, 2026 | 31 |
| Nov 7, 2026 | 31 |
| Nov 6, 2026 | 31 |
| Nov 5, 2026 | 31 |
| Nov 4, 2026 | 30 |
| Nov 3, 2026 | 30 |
| Nov 2, 2026 | 30 |
| Nov 1, 2026 | 30 |
| Oct 31, 2026 | 30 |
| Oct 30, 2026 | 30 |
| Oct 29, 2026 | 30 |
| Oct 28, 2026 | 30 |
| Oct 27, 2026 | 30 |
| Oct 26, 2026 | 30 |
| Oct 25, 2026 | 30 |
| Oct 24, 2026 | 29 |
| Oct 23, 2026 | 29 |
| Oct 22, 2026 | 29 |
| Oct 21, 2026 | 29 |
| Oct 20, 2026 | 29 |
| Oct 19, 2026 | 29 |
| Oct 18, 2026 | 29 |
| Oct 17, 2026 | 27 |
| Oct 16, 2026 | 26 |
| Oct 15, 2026 | 26 |
| Oct 14, 2026 | 26 |
| Oct 13, 2026 | 25 |
| Oct 12, 2026 | 25 |
| Oct 11, 2026 | 25 |
| Oct 10, 2026 | 25 |
| Oct 9, 2026 | 25 |
| Oct 8, 2026 | 25 |
| Oct 7, 2026 | 25 |
| Oct 6, 2026 | 24 |
| Oct 5, 2026 | 24 |
| Oct 4, 2026 | 24 |
| Oct 3, 2026 | 23 |
| Oct 2, 2026 | 22 |
| Oct 1, 2026 | 22 |
| Sep 30, 2026 | 20 |
| Sep 29, 2026 | 20 |
| Sep 28, 2026 | 20 |
| Sep 27, 2026 | 20 |
| Sep 26, 2026 | 19 |
| Sep 25, 2026 | 18 |
| Sep 24, 2026 | 18 |
| Sep 23, 2026 | 18 |
| Sep 22, 2026 | 18 |
| Sep 21, 2026 | 18 |
| Sep 20, 2026 | 18 |
| Sep 19, 2026 | 18 |
| Sep 18, 2026 | 18 |
| Sep 17, 2026 | 18 |
| Sep 16, 2026 | 18 |
| Sep 15, 2026 | 18 |
| Sep 14, 2026 | 18 |
| Sep 13, 2026 | 17 |
| Sep 12, 2026 | 17 |
| Sep 11, 2026 | 17 |
| Sep 10, 2026 | 16 |
| Sep 9, 2026 | 16 |
| Sep 8, 2026 | 16 |
| Sep 7, 2026 | 15 |
Shared by 15 plugins in focusreactive/payload-plugins.
667+571 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 667 |
| Dec 5, 2026 | 691 |
| Dec 4, 2026 | 714 |
| Dec 3, 2026 | 783 |
| Dec 2, 2026 | 723 |
| Dec 1, 2026 | 667 |
| Nov 30, 2026 | 655 |
| Nov 29, 2026 | 526 |
| Nov 28, 2026 | 502 |
| Nov 27, 2026 | 542 |
| Nov 26, 2026 | 870 |
| Nov 25, 2026 | 1,063 |
| Nov 24, 2026 | 1,113 |
| Nov 23, 2026 | 1,195 |
| Nov 22, 2026 | 1,271 |
| Nov 21, 2026 | 1,527 |
| Nov 20, 2026 | 1,490 |
| Nov 19, 2026 | 1,112 |
| Nov 18, 2026 | 1,028 |
| Nov 17, 2026 | 987 |
| Nov 16, 2026 | 911 |
| Nov 15, 2026 | 890 |
| Nov 14, 2026 | 727 |
| Nov 13, 2026 | 682 |
| Nov 12, 2026 | 680 |
| Nov 11, 2026 | 722 |
| Nov 10, 2026 | 756 |
| Nov 9, 2026 | 850 |
| Nov 8, 2026 | 790 |
| Nov 7, 2026 | 687 |
| Nov 6, 2026 | 696 |
| Nov 5, 2026 | 679 |
| Nov 4, 2026 | 515 |
| Nov 3, 2026 | 491 |
| Nov 2, 2026 | 557 |
| Nov 1, 2026 | 737 |
| Oct 31, 2026 | 740 |
| Oct 30, 2026 | 761 |
| Oct 29, 2026 | 672 |
| Oct 28, 2026 | 619 |
| Oct 27, 2026 | 625 |
| Oct 26, 2026 | 458 |
| Oct 25, 2026 | 259 |
| Oct 24, 2026 | 237 |
| Oct 23, 2026 | 139 |
| Oct 22, 2026 | 175 |
| Oct 21, 2026 | 244 |
| Oct 20, 2026 | 221 |
| Oct 19, 2026 | 216 |
| Oct 18, 2026 | 224 |
| Oct 17, 2026 | 220 |
| Oct 16, 2026 | 241 |
| Oct 15, 2026 | 246 |
| Oct 14, 2026 | 246 |
| Oct 13, 2026 | 254 |
| Oct 12, 2026 | 257 |
| Oct 11, 2026 | 311 |
| Oct 10, 2026 | 288 |
| Oct 9, 2026 | 285 |
| Oct 8, 2026 | 268 |
| Oct 7, 2026 | 282 |
| Oct 6, 2026 | 301 |
| Oct 5, 2026 | 625 |
| Oct 4, 2026 | 580 |
| Oct 3, 2026 | 672 |
| Oct 2, 2026 | 677 |
| Oct 1, 2026 | 703 |
| Sep 30, 2026 | 668 |
| Sep 29, 2026 | 659 |
| Sep 28, 2026 | 328 |
| Sep 27, 2026 | 291 |
| Sep 26, 2026 | 217 |
| Sep 25, 2026 | 210 |
| Sep 24, 2026 | 161 |
| Sep 23, 2026 | 141 |
| Sep 22, 2026 | 127 |
| Sep 21, 2026 | 163 |
| Sep 20, 2026 | 164 |
| Sep 19, 2026 | 225 |
| Sep 18, 2026 | 231 |
| Sep 17, 2026 | 322 |
| Sep 16, 2026 | 338 |
| Sep 15, 2026 | 345 |
| Sep 14, 2026 | 310 |
| Sep 13, 2026 | 298 |
| Sep 12, 2026 | 212 |
| Sep 11, 2026 | 199 |
| Sep 10, 2026 | 117 |
| Sep 9, 2026 | 100 |
| Sep 8, 2026 | 97 |
| Sep 7, 2026 | 96 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1177993877-payload-plugin-seo)<a href="https://payloaddirectory.dev/plugins/1177993877-payload-plugin-seo"><img src="https://payloaddirectory.dev/badge/1177993877-payload-plugin-seo.svg" alt="Payload Directory"></a>README
Live SEO analysis for Payload CMS v3 + Next.js, powered by Yoast. Adds a real-time SEO drawer to the document editor - keyphrase optimization, on-page checks, readability, inclusive language, content vitals, and a Google SERP preview - without adding a single field to your documents.
The plugin injects a button into the editor toolbar of each configured collection. Clicking it opens a drawer that reads the current (unsaved) form values, derives the title, meta description, and slug from dot-path config, runs your registered content extractor to build the body content, and runs the Yoast analysis engine entirely in the browser. Your documents get no new fields. Keyphrases are stored in one hidden collection by the keyphrase index, which is on by default; set keyphraseIndex: false to keep them in the browser instead.
Copy and paste this prompt into your AI assistant (Cursor, Claude, etc.) to integrate the plugin into an existing Payload + Next.js project.
I want to add live SEO analysis to my Payload CMS v3 + Next.js project using
@focus-reactive/payload-plugin-seo. Follow these steps in order, and stop to ask me where a step
says so.
## Rules you must follow
- Never write an access rule that admits every logged-in user: no `Boolean(req.user)`, no `() => true`,
no `({ req }) => !!req.user`. A rule names a role, or it is `nobody`.
- Do not invent roles. Ask me which roles may use each capability.
- Write every policy entry by hand in `src/access.policy.ts`, and grant each capability and each
collection right explicitly to the roles I name. Nothing is open by default.
- When the boot or a request fails, fix the cause or ask me. Never use `anyone`, a looser gate,
`overrideAccess` or a removed or disabled check to make an error go away.
- Do not add `overrideAccess: true` anywhere, and do not open the `seo-keyphrases` collection:
every operation on it stays `nobody`.
- Pass the OpenAI key explicitly in `generation.apiKey`; never send it to the browser.
## How it works
The plugin adds an SEO button to the document toolbar of each configured collection. The button
opens a drawer that reads the live (unsaved) form values, runs YOUR registered content extractor to
build the body content, and runs the Yoast engine in the browser. Content extraction is app-owned:
the extractor receives the raw form values plus a toolkit ({ resolveDocs, helpers }), fetches the
referenced docs it needs through resolveDocs, and returns a ContentNode[] the plugin serializes.
By default the keyphrase index stores keyphrases in a hidden, locked `seo-keyphrases` collection and
adds the endpoints `/api/seo/keyphrases`, `/api/seo/keyphrase-usage` and `/api/seo/link-suggestions`.
With `generation.apiKey` set it also adds `POST /api/seo/generate` and AI title and description
generation. It declares three capabilities that the project grants in its access policy:
- `viewKeyphrases`: read a document's keyphrases, see where a keyphrase is already used, and get
internal link suggestions. The caller also needs read rights on the document.
- `editKeyphrases`: save a document's keyphrases. The caller also needs update rights on it.
- `generate`: generate a title or description with OpenAI, from the Generate button or on publish.
The caller also needs update rights on the document (create rights for a new one).
## Step 1: install
pnpm add @focus-reactive/payload-plugin-seo @focus-reactive/payload-plugin-guard
Check that `payload` is 3.90 or later; if it is not, upgrade it first.
## Step 2: ask me about roles
Look at the auth collection named in `admin.user` and the roles it has.
Ask me: "Which roles may see keyphrases?", "Which roles may change them?", "Which roles may
generate titles and descriptions with OpenAI?" and "Which collections get the SEO drawer?"
Wait for my answers. Write each answer as a gate in the policy file in step 3.
## Step 3: the access policy file
Open `src/access.policy.ts`, or create it if the project has none, following the guard README
(`defineAccessPolicy`, `gate`, `filter`, `nobody`, checked with `satisfies AccessPolicy<Config>`).
If you create it, every collection and global of the config needs an entry: move each existing
`access` of the project into the file, and ask me for every rule you cannot read from the code.
Add these entries for the plugin:
collections: {
'seo-keyphrases': { create: nobody, read: nobody, update: nobody, delete: nobody },
},
plugins: {
seo: {
viewKeyphrases: <the gate from my first answer>,
editKeyphrases: <the gate from my second answer>,
generate: <the gate from my third answer>,
},
},
Leave out the `seo-keyphrases` entry only if I ask for `keyphraseIndex: false`.
## Step 4: register the plugin and wrap the config
// payload.config.ts
import { buildConfig } from 'payload'
import { withAccessPolicy } from '@focus-reactive/payload-plugin-guard'
import { seoPlugin } from '@focus-reactive/payload-plugin-seo'
import { accessPolicy } from './access.policy'
export default withAccessPolicy(
accessPolicy,
buildConfig({
// ...the existing config
plugins: [
seoPlugin({
collections: [
{
slug: 'pages',
fields: { seoTitle: 'seoTitle', metaDescription: 'metaDescription', slug: 'slug' },
// REQUIRED: lookup key for a content extractor you register (see step 6).
extractContentPath: '@/seo/extractPageContent#default',
},
],
site: { name: 'My Site', baseUrl: 'https://example.com', faviconUrl: '/favicon.ico' },
supportedLocales: ['en'],
// Only if I want AI generation:
generation: { apiKey: process.env.OPENAI_API_KEY },
access: accessPolicy.plugins.seo,
}),
],
})
)
The keyphrase index adds a collection, so on SQL adapters run `payload migrate:create`.
Run `payload generate:importmap`, then start the app.
A missing or wrong policy entry stops the boot with a list of what to fix.
Fix each item; never loosen a rule to make an error go away.
## Step 5: admin styles and Next.js
In your Payload admin CSS (e.g. app/(payload)/custom.scss):
@import "@focus-reactive/payload-plugin-seo/admin.css";
In next.config.mjs:
const nextConfig = {
transpilePackages: ['@yoast/search-metadata-previews', '@yoast/components'],
}
## Step 6: write and register a content extractor (REQUIRED)
Content extraction is entirely yours: there is no built-in walker, and extractContentPath is
required. Write an extractor and register it under the same key, from an admin-mounted client
module:
// src/seo/extractPageContent.ts
import type { ContentExtractor } from '@focus-reactive/payload-plugin-seo/content'
const extractPageContent: ContentExtractor = async (values, ctx, { resolveDocs, helpers }) => {
// 1. collect ids from the RAW values (relationship/upload fields are ids)
// 2. const docs = await resolveDocs([{ collection: 'media', ids, select: ['url','alt'] }])
// 3. build the IR with helpers
return helpers.compact([helpers.heading(1, values.title as string) /* ... */])
}
export default extractPageContent
// src/providers/SeoExtractorRegistrar.tsx ("use client")
import { registerContentExtractors } from '@focus-reactive/payload-plugin-seo/content'
import extractPageContent from '@/seo/extractPageContent'
registerContentExtractors({ '@/seo/extractPageContent#default': extractPageContent })
// export a component that renders {children} and mount it via admin.components.providers
## Step 7: verify, and show me the output
With the app running, send each request and show me the status code.
Every one of them must be refused. If one succeeds, the policy is wrong: stop and tell me.
1. Anonymous keyphrases, expect 401:
curl -i 'http://localhost:3000/api/seo/keyphrases?collection=pages&docId=<page id>&locale=en'
2. The same request with the session cookie of a user whose role may not see keyphrases, expect 403.
3. The keyphrase collection through the REST API, as an admin, expect 403:
curl -i -H 'Cookie: <admin session cookie>' http://localhost:3000/api/seo-keyphrases
4. With generation on, anonymous generation, expect 401:
curl -i -X POST -H 'Content-Type: application/json' -d '{}' http://localhost:3000/api/seo/generate
Then, as a user who may edit keyphrases, open a page, open the SEO drawer, add a keyphrase, reload
and check that it is still there.
## Important notes
- The plugin reads UNSAVED form values, so analysis updates live as you type (debounced ~1s).
- relationship/upload fields arrive as ids; use toolkit.resolveDocs(queries) to fetch only the
docs/fields you need, then read them with store.get(). In the browser resolveDocs reads through
the REST API with the editor's session; on the server it reads with the rights of the user who
saves the document.
- Non-English analysis requires the locale code in `supportedLocales`; the matching Yoast
language pack is dynamically imported on demand.
- Add a per-collection `resolveUrl: ({ doc, locale, req }) => string | null` to show public URLs
in link suggestions.
Document editor (configured collection)
│
▼
[ SeoButton ] ← injected into admin.components.edit.beforeDocumentControls
│ click
▼
SEO Drawer (client-only)
│
├─ read live form values (title, description, slug, keyphrase)
├─ run your registered extractor(values, ctx, toolkit)
│ └─ toolkit.resolveDocs(): parallel, projected /api/{collection} fetches
├─ extractor returns ContentNode[] → plugin serializes to HTML
▼
Yoast engine (in browser): Paper + EnglishResearcher + SeoAssessor
│
▼
Tabs: Keyphrase · On-page SEO · Readability · Inclusive · Content vitals · SERP preview
The analysis runs on a ~1 second debounce as form values change. No document data is written - the drawer is a read-only overlay on top of the editor's current state. Keyphrases are stored on the server by the keyphrase index, or kept in the browser with keyphraseIndex: false.
pnpm add @focus-reactive/payload-plugin-seo @focus-reactive/payload-plugin-guard
Peer dependencies: payload ^3.90.0, @payloadcms/next ^3.90.0, @payloadcms/ui ^3.90.0, @payloadcms/richtext-lexical ^3.90.0, lucide-react ^0.469.0. next ^14 || ^15 and react/react-dom ^18 || ^19 are optional peers.
The Yoast engine (yoastseo, @yoast/search-metadata-previews) ships as a direct dependency - you don't install it yourself, but you do need to transpile the two UI packages (see Quick Start step 4).
The plugin runs on @focus-reactive/payload-plugin-guard.
Your project's access policy names who holds each of the plugin's capabilities and locks the keyphrase collection:
// src/access.policy.ts
import { defineAccessPolicy, gate, nobody } from "@focus-reactive/payload-plugin-guard";
const isEditor = gate(
({ req }) => req.user?.collection === "users" && (req.user.roles ?? []).includes("editor")
);
export const accessPolicy = defineAccessPolicy({
collections: {
// ...every collection and global of your config
"seo-keyphrases": { create: nobody, read: nobody, update: nobody, delete: nobody },
},
plugins: {
seo: { viewKeyphrases: isEditor, editKeyphrases: isEditor, generate: isEditor },
},
});
Leave out the seo-keyphrases entry when you set keyphraseIndex: false.
See Access and capabilities for what each capability allows.
// payload.config.ts
import { buildConfig } from "payload";
import { withAccessPolicy } from "@focus-reactive/payload-plugin-guard";
import { seoPlugin } from "@focus-reactive/payload-plugin-seo";
import { accessPolicy } from "./access.policy";
export default withAccessPolicy(
accessPolicy,
buildConfig({
plugins: [
seoPlugin({
collections: [
{
slug: "pages",
fields: {
seoTitle: "seoTitle",
metaDescription: "metaDescription",
slug: "slug",
},
// Required: register a matching extractor (see "Content Extraction").
extractContentPath: "@/seo/extractPageContent#default",
},
],
site: {
name: "My Site",
baseUrl: process.env.NEXT_PUBLIC_SERVER_URL ?? "http://localhost:3000",
},
supportedLocales: ["en", "de", "fr", "es"],
access: accessPolicy.plugins.seo,
}),
],
})
);
This injects the SEO button into the document toolbar of every configured collection. A colored dot on the button reflects the current overall status (good / warn / bad).
The drawer's components import their compiled CSS internally, but the package also ships it at ./admin.css so you can include it explicitly in your admin stylesheet:
/* app/(payload)/custom.scss */
@import "@focus-reactive/payload-plugin-seo/admin.css";
@yoast/search-metadata-previews and @yoast/components ship CSS inside node_modules, which Next.js (and Turbopack) won't process unless they're listed in transpilePackages:
// next.config.mjs
/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ["@yoast/search-metadata-previews", "@yoast/components"],
};
export default nextConfig;
Required - see Content Extraction.
interface SeoPluginOptions {
/** Who holds each capability, usually `accessPolicy.plugins.seo`. Required. */
access: { viewKeyphrases: Gate; editKeyphrases: Gate; generate: Gate };
/** Skip injection entirely. Default: false */
disabled?: boolean;
/** Collections to attach the SEO drawer to. At least one is required. */
collections: SeoCollectionConfig[];
/** Site identity used in the SERP preview and permalink. */
site?: SeoSiteConfig;
/** Locale codes whose Yoast language packs may be loaded. Default: ['en'] */
supportedLocales?: string[];
/** Override or add UI strings per admin language (see "Admin language"). */
translations?: Translations;
/** Store keyphrases on the server and enable the "already used on" notice and the
* Internal links tab. Adds the `seo-keyphrases` collection. Set to false to keep
* keyphrases in the browser (localStorage) only. Default: true */
keyphraseIndex?: boolean;
/** Bands of the checks that show a gauge (see "Thresholds"). Default: the Yoast values. */
thresholds?: SeoThresholds;
/** AI generation for `seoTextField` (see "Generated SEO fields"). Off without `apiKey`. */
generation?: SeoGenerationConfig;
}
interface SeoCollectionConfig {
/** Collection slug to attach the drawer to. */
slug: string;
/** Dot-paths telling the plugin which fields hold the title / meta description / slug. */
fields?: SeoFieldPaths;
/**
* REQUIRED. Lookup key for a registered ContentExtractor - the only content path;
* there is no built-in walker. Set it to the same string you pass as the key in
* registerContentExtractors(). Convention: the module path of the extractor file,
* e.g. "@/collections/Page/extractPageContent#default". The extractor runs in the
* browser on the raw form values and returns ContentNode[]. See "Content Extraction".
*
* A collection whose extractContentPath is missing/empty is dropped at plugin init
* (with a warning); if no collection has a valid extractContentPath the plugin no-ops.
* If the key is set but not registered at runtime, content analysis for that collection
* is empty (a one-time console error is logged) - there is no built-in fallback.
*/
extractContentPath: string;
/**
* Server-only. Public URL of a document, used by link suggestions when
* `keyphraseIndex` is on. Return null when the document has no public URL.
*/
resolveUrl?: (args: { doc: Record<string, unknown>; locale: string; req: PayloadRequest }) =>
string | null | Promise<string | null>;
}
interface SeoFieldPaths {
/** Dot-path to the SEO title. Falls back to the collection's useAsTitle / `title`. */
seoTitle?: string;
/** Dot-path to the meta description. Absent → meta-description checks are disabled
* and the SERP snippet shows no description. */
metaDescription?: string;
/** Dot-path to the slug. Default: 'slug' */
slug?: string;
}
Dot-paths support nesting, e.g. "meta.description" or "content.body". Body content is not configured here - it is produced by your registered extractor (see below).
interface SeoSiteConfig {
/** Site name shown in the SERP preview. */
name?: string;
/** Base URL used to build the permalink in the SERP preview. */
baseUrl?: string;
/** Favicon shown in the SERP preview. */
faviconUrl?: string;
}
Content extraction is app-owned: you register one ContentExtractor per collection. The plugin makes no assumptions about your document schema, relationships, link types, or URL construction - it hands your extractor the raw values plus a small, generic toolkit, and serializes whatever ContentNode[] you return.
ContentNode Intermediate RepresentationThe plugin represents page content as a flat array of typed nodes before serializing to HTML. This is the ContentNode union exported from @focus-reactive/payload-plugin-seo/content:
type ContentNode =
| { type: "heading"; level: 1 | 2 | 3 | 4 | 5 | 6; text: string }
| { type: "paragraph"; text: string }
| { type: "link"; href: string; text: string }
| { type: "image"; src: string; alt?: string }
| { type: "video"; src: string; poster?: string }
| { type: "html"; html: string }; // lexical-converted or raw HTML escape hatch
Serialization to HTML (for the Yoast engine) happens entirely inside the plugin. Extractors produce ContentNode[]; they never construct HTML strings directly.
The /content subpath exports pure builder functions. Each helper returns null for empty or missing input, and compact drops the nulls - so you can build sparse arrays and clean them in one pass. The same helpers are also handed to your extractor as toolkit.helpers, so you can use either the imports or the injected object.
import {
heading, // heading(level: 1|2|3|4|5|6, text?: string | null): ContentNode | null
paragraph, // paragraph(text?: string | null): ContentNode | null
link, // link(href?: string | null, text?: string | null): ContentNode | null
image, // image(src?: string | null, alt?: string | null): ContentNode | null
video, // video(src?: string | null, poster?: string | null): ContentNode | null
richText, // richText(lexicalValue: unknown): ContentNode | null (lexical → HTML; null when empty)
html, // html(raw?: string | null): ContentNode | null
compact, // compact(nodes: (ContentNode | null | undefined)[]): ContentNode[]
} from "@focus-reactive/payload-plugin-seo/content";
import type {
ContentNode,
HeadingLevel,
} from "@focus-reactive/payload-plugin-seo/content";
type ContentExtractor = (
values: Record<string, unknown>, // RAW form values; relationship/upload fields are ids
ctx: ExtractContext, // { locale?: string; apiRoute?: string }
toolkit: ExtractToolkit, // { resolveDocs, helpers }
) => ContentNode[] | Promise<ContentNode[]>;
interface ExtractToolkit {
resolveDocs: (queries: DocQuery[]) => Promise<DocStore>;
helpers: ContentHelpers; // heading, paragraph, link, image, video, richText, html, compact
}
interface DocQuery {
collection: string;
ids: (string | number)[];
select?: string[]; // field projection → ?select[field]=true
depth?: number; // relationship population → ?depth=N (default 0)
}
interface DocStore {
get(collection: string, id: string | number): Record<string, unknown> | undefined;
}
Your extractor:
{ relationTo, value }), not populated objects - the plugin does no hydration.toolkit.resolveDocs(queries) to fetch referenced/upload documents. You pass one query per collection with the ids you collected and an optional select projection (fetch only the fields you need) and depth. All queries run in parallel. Read results with store.get(collection, id).ContentNode[] (built with the helpers); the plugin serializes it.// src/collections/Page/extractPageContent.ts
import { heading, image, paragraph, richText } from "@focus-reactive/payload-plugin-seo/content";
import type {
ContentExtractor,
DocStore,
} from "@focus-reactive/payload-plugin-seo/content";
const extractPageContent: ContentExtractor = async (values, _ctx, { resolveDocs, helpers }) => {
const blocks = (values as { blocks?: Record<string, unknown>[] }).blocks ?? [];
// 1. Collect the ids you care about from the RAW values (you know your schema).
const mediaIds = blocks.flatMap((b) => (typeof b.image === "number" ? [b.image] : []));
// 2. Fetch them - one parallel request per collection, projected to only the fields you need.
const docs: DocStore = await resolveDocs([
{ collection: "media", ids: mediaIds, select: ["url", "alt", "mimeType"] },
]);
// 3. Build the Intermediate Representation.
return helpers.compact(
blocks.flatMap((b) => {
const media = typeof b.image === "number" ? docs.get("media", b.image) : undefined;
return [
heading(2, b.title as string),
paragraph(b.subtitle as string),
image((media as { url?: string })?.url, (media as { alt?: string })?.alt),
richText(b.content),
];
}),
);
};
export default extractPageContent;
Payload 3.84 has no client-side import map - admin.dependencies resolves path strings to functions server-side only, and a resolved function cannot cross the server→client boundary as a prop. Because the Yoast analysis runs live in the browser, extractContentPath cannot be resolved by Payload machinery on the client.
The plugin bridges this with a globalThis-backed registry. extractContentPath in config is the lookup key; the consuming app registers the actual function under the same key in an admin-mounted client module. The registry uses globalThis (not a bare module-level Map) so the key and function resolve to the same instance across separate bundle chunks.
Step 1 - Set extractContentPath in the plugin config (the lookup key):
// payload.config.ts (or your plugins file)
import { seoPlugin } from "@focus-reactive/payload-plugin-seo";
seoPlugin({
collections: [
{
slug: "page",
fields: {
seoTitle: "meta.title",
metaDescription: "meta.description",
slug: "slug",
},
extractContentPath: "@/collections/Page/extractPageContent#default",
},
],
});
Step 2 - Create a client registrar component:
// src/providers/SeoExtractorRegistrar.tsx
"use client";
import { registerContentExtractors } from "@focus-reactive/payload-plugin-seo/content";
import type { ReactNode } from "react";
import extractPageContent from "@/collections/Page/extractPageContent";
// registerContentExtractors runs once when this module loads in the admin bundle.
// The key must exactly match the extractContentPath string in your plugin config.
registerContentExtractors({
"@/collections/Page/extractPageContent#default": extractPageContent,
});
export function SeoExtractorRegistrar({ children }: { children: ReactNode }) {
return <>{children}</>;
}
export default SeoExtractorRegistrar;
Step 3 - Mount the registrar as an admin provider:
// payload.config.ts
export default buildConfig({
admin: {
components: {
providers: ["/providers/SeoExtractorRegistrar"],
},
},
// ...
});
If the configured extractContentPath is set but the function is not registered (e.g. the provider is missing), the plugin logs a one-time console error and content analysis for that collection is empty - there is no built-in fallback.
By default the search-result preview shows site.baseUrl followed by /<slug>. That is wrong for a nested page (/services/web, not /web), a blog post (/blog/<slug>) or a locale prefix. Register a preview path resolver per collection slug in the same client module, and the preview shows site.baseUrl followed by the path it returns:
import { registerPreviewPathResolvers } from "@focus-reactive/payload-plugin-seo/content";
registerPreviewPathResolvers({
// `values` are the unsaved form values, `locale` the locale being edited.
pages: (values, { locale }) => buildPagePath(values, locale), // "/es/services/web"
posts: (values, { locale }) => buildPostPath(values.slug, locale), // "/blog/my-post"
});
The resolver runs in the browser on every analysis (debounced, on the unsaved form values). It may return a promise, for example to read the path of a parent page that the form does not hold; cache what it fetches. Return null or undefined to fall back to /<slug>; a thrown error is logged and falls back the same way. A collection without a resolver keeps the old behaviour.
helpers.richText(value) serializes the lexical tree to HTML as-is. Internal-link nodes and upload nodes embedded inside richText body content are not resolved by the plugin - their hrefs / srcs are left as the lexical tree provides them. This keeps the plugin fully schema-agnostic. If you need those resolved, walk the lexical tree yourself inside your extractor (its structure is standard Payload lexical), collect the referenced ids, fetch them with resolveDocs, and rewrite the nodes before building the IR.
seoTextField is an optional utility that adds AI-assisted generation directly inside
a Payload text field. Import it from @focus-reactive/payload-plugin-seo/fields and
drop it anywhere in a collection's fields array - it returns a standard Payload text
field with an enhanced field component that shows a length meter, a status pill, and
(optionally) a Generate button.
// payload.config.ts (or a separate collection file)
import { seoPlugin } from "@focus-reactive/payload-plugin-seo";
import { seoTextField } from "@focus-reactive/payload-plugin-seo/fields";
const MyCollection = {
slug: "pages",
fields: [
{
name: "meta",
type: "group",
fields: [
seoTextField({
name: "title",
kind: "title",
label: "Meta Title",
localized: true,
showButton: true, // Mode 2: on-demand Generate button
generateOnPublish: true, // Mode 1: auto-fill on publish when empty
}),
seoTextField({
name: "description",
kind: "description",
label: "Meta Description",
localized: true,
showButton: true,
generateOnPublish: true,
}),
],
},
],
};
Both modes can be active on the same field at the same time.
seoTextField optionsinterface SeoTextFieldOptions {
/** Field name - passed straight to the underlying Payload text field. */
name: string;
/**
* "title" or "description".
* Drives the generation prompt, the default target range, the measurement unit, and the
* rendered input/field type:
* title → single-line `text` field; pixel-width measurement (Yoast heuristic)
* description → multi-line `textarea` field; character-count measurement
*/
kind: "title" | "description";
/** Human-readable label shown in the admin UI. */
label?: string;
/** Mark the field as required. */
required?: boolean;
/** Enable per-locale storage. */
localized?: boolean;
/** Standard Payload field admin overrides. */
admin?: Record<string, unknown>;
/**
* Mode 2 - render a black-shade Generate button in the field's label row.
* Clicking it calls the generation endpoint using the current (unsaved) page content.
* Works on new/unsaved documents.
* Default: false.
*/
showButton?: boolean;
/**
* Mode 1 - on publish, auto-fill the field from page content ONLY when it is empty.
* A manual value is never overwritten.
* Shows a small "generated on publish" tooltip icon next to the label.
* Default: false.
*/
generateOnPublish?: boolean;
/**
* Override the target length window. Missing numbers follow the plugin `thresholds`:
* title → 400 px to `titleWidth.max` (600); description → `metaDescriptionLength` (120–156 chars).
*/
range?: { min?: number; max?: number };
}
The field renders identically to a native Payload text field, with two additions below
the input: a length meter (pixels for title, characters for description) and a status
pill showing Too short, Good, or Too long the way the drawer scores it. A description
of min characters or fewer is too short and one over max is too long. A title is too long over
max and too short only below a min the field sets in its own range; otherwise the title
min is just the lower end of the generation target, because Yoast scores narrower titles as good.
The plugin throws when Payload starts if a field's range, filled in from thresholds, ends up
with min not below max.
Generation is on only when the plugin options carry an OpenAI key in generation.apiKey.
The plugin does not read OPENAI_API_KEY or any other environment variable on its own, so pass the key explicitly.
With a key, the plugin registers POST {apiRoute}/seo/generate, and seoTextField fields with showButton or generateOnPublish use it.
seoPlugin({
collections: [/* ... */],
access: accessPolicy.plugins.seo,
generation: {
/** OpenAI API key. Required for generation; it stays on the server. */
apiKey: process.env.OPENAI_API_KEY,
/** OpenAI model. Default: "gpt-4o-mini". */
model: "gpt-4o-mini",
/** Maximum characters of page content sent to the model. Default: 6000. */
maxContentChars: 6000,
/** Override the system prompt used for title generation. */
titlePrompt: "Write an SEO meta title...",
/** Override the system prompt used for description generation. */
descriptionPrompt: "Write an SEO meta description...",
},
});
Without a key, generation is off: there is no endpoint, the Generate button is hidden and the on-publish hook does nothing.
Who may generate:
generate capability, looked up from GET {apiRoute}/seo/capabilities.401 without a user, 403 for a user outside the admin user collection or without generate, and 403 when the user may not update the document (or create one in the collection, for a document that is not saved yet).{ kind, contentHtml, collection, id?, locale?, range: { min, max, unit } }, JSON only and at most 1 MiB.
collection must be one of the plugin's collections, locale one of the config's locales (localization.localeCodes, or supportedLocales without localization), and range whole numbers from 1 to 2000 with unit px or char; anything else gets 400.429 after that, and publishing leaves the field empty.502 and a generic message.api.openai.com only, through the guard's safeFetch, with a 30 second timeout.Generation is locale-aware: the active document locale is forwarded to the endpoint and included in the prompt.
Mode 2 (button) reuses the extractContentPath extractor already configured for
the analysis drawer. No additional registration is needed - the button calls the same
client-side extractor.
Mode 1 (on-publish) runs server-side and requires a serverExtractContent function
on the collection's plugin config. It follows the same ContentExtractor contract, but
receives a Local-API-backed resolveDocs and the document being saved.
On publish, the plugin generates only when the document is saved by a user of the admin user collection who holds the generate capability.
A document saved without a user, for example by a script or a seed through the Local API, gets no generated text and nothing is sent to OpenAI.
resolveDocs reads with that user's rights, so a related document the user cannot read never reaches the prompt.
// src/collections/Page/extractPageContent.server.ts
import type { ContentExtractor } from "@focus-reactive/payload-plugin-seo/content";
export const serverExtractPageContent: ContentExtractor = async (
values,
_ctx,
{ resolveDocs, helpers },
) => {
// values = the document being saved (same shape as the client-side extractor)
// resolveDocs = Local API-backed, with the rights of the user who publishes
return helpers.compact([
helpers.heading(1, values.title as string),
// … rest of your extraction logic
]);
};
// payload.config.ts
import { serverExtractPageContent } from "@/collections/Page/extractPageContent.server";
seoPlugin({
collections: [
{
slug: "page",
fields: { seoTitle: "meta.title", metaDescription: "meta.description", slug: "slug" },
extractContentPath: "@/collections/Page/extractPageContent#default", // client (button + drawer)
serverExtractContent: serverExtractPageContent, // server (on-publish)
},
],
generation: { /* ... */ },
});
Because the extractor only reads ids and calls the injected resolveDocs, the same
function body can usually serve both client and server without modification - just
export it twice (or re-export from a shared file).
Note: The plugin auto-registers the
SeoClientConfigProvideradmin provider internally. You do not need to add it toadmin.components.providersmanually.
The drawer presents six tabs, all derived from a single in-browser Yoast analysis pass (a Paper analyzed by SeoAssessor with the language-appropriate Researcher):
| Tab | What it checks |
|---|---|
| Keyphrase | Two-pane keyphrase workspace: a focus keyphrase - usage in title, slug, meta description, first paragraph, density, image alt, synonyms - plus up to four related keyphrases (five total), each with its own synonyms and independent Yoast checks. Only the focus keyphrase's result feeds the overall score; related keyphrases are scored side-by-side for reference and never affect it. Enter a keyphrase to unlock these checks. |
| On-page SEO | Title width, meta description presence/length, internal & outbound links, heading structure. |
| Readability | Sentence/paragraph length, transition words, passive voice, consecutive sentences. |
| Inclusive | Flags potentially exclusionary or non-inclusive language. |
| Content vitals | Word count, sentence/paragraph counts, image & video counts, reading time, prominent words. |
| Search result preview | Live Google SERP preview (desktop + mobile) with keyphrase highlighting, built on @yoast/search-metadata-previews. |
| Internal links | Other documents whose keyphrases appear in this text but are not linked yet. Only with keyphraseIndex. |
Without a keyphrase: the drawer still runs and the On-page, Readability, Inclusive, Content vitals, and SERP tabs all populate. Only the keyphrase-specific assessments wait until you type a focus keyphrase and analysis runs.
The Keyphrase tab is a master–detail workspace: a rail lists all configured keyphrases (the focus keyphrase first, then any related ones), and selecting an entry shows its detail pane - the keyphrase text, its synonyms, and its own Yoast result.
SeoAssessor (the same checks listed above), and its result is the only one that feeds the drawer's overall score badge.RelatedKeywordAssessor, a smaller check set built for secondary keyphrases (title, meta description, first paragraph, image alt, keyphrase density, and prominent-word coverage). Related results are shown for reference only - they never affect the overall score.Persistence: keyphrases are never written to your documents - there are no new fields. By default the keyphrase index stores the full list (text + synonyms per entry) on the server, per collection + document + locale. With keyphraseIndex: false the list is kept in the browser's localStorage under the same key instead and is pruned of empty entries on save. Switching documents or locales loads (or starts) a separate list; clearing browser storage resets a browser-only list.
The keyphrase index is on by default. It stores keyphrases on the server, so every editor sees the same set. Set keyphraseIndex: false to keep them in the browser only:
seoPlugin({
collections: [/* … */],
keyphraseIndex: false,
});
seo-keyphrases collection (docCollection, docId, locale, keyphrases, intents, unique on docCollection + docId + locale). Up to 5 keyphrases per document, 10 synonyms each, 100 characters per entry. Longer input is cut to these limits when it is saved.payload migrate:create and apply the migration, or set keyphraseIndex: false.The plugin registers four endpoints under your API route. locale is required when localization is enabled and ignored otherwise.
GET /seo/keyphrases?collection=&docId=&locale= returns { keyphrases, indexed, canUpdate }, where indexed says whether the server has a row for the document and locale and canUpdate whether the user may change it.PUT /seo/keyphrases with body { collection, docId, locale, keyphrases: [{ text, synonyms }], ifAbsent?: boolean } replaces the keyphrases and returns { keyphrases }. With ifAbsent: true it only creates a missing row and answers 409 with the stored keyphrases when one exists.GET /seo/keyphrase-usage?collection=&docId=&locale=&phrase= returns { docs: [{ collection, id, title }] }, the other documents that use the same keyphrase.POST /seo/link-suggestions with body { collection, docId, locale, text, linkedHrefs?: string[], linkedDocs?: [{ collection, docId }] } returns { suggestions, linked }. linked lists the linkedDocs the user can read as [{ collection, id, title }], in the order they were sent.See Access and capabilities for who may call them.
The Keyphrase tab shows "This keyphrase is already used on:" with links to the edit view of other documents that have the same keyphrase in the same locale. Word order, case and accents on Latin letters are ignored (CMS Payload = payload cms, café = cafe). Synonyms are not compared.
The drawer gets an Internal links tab. Find opportunities lists up to 10 other documents whose keyphrases or synonyms appear in this document's text and are not linked from it yet, with the matched phrase, the number of matches, a snippet with the matched text highlighted and the target link to copy. Below it, Already linked lists the documents this text already links to with rich text internal links, each linking to its edit view. When every match is already linked, the tab says so instead of reporting that nothing was found.
Give each collection a resolveUrl so suggestions show public URLs and targets already linked by URL are skipped. Without it, suggestions only link to the admin edit view.
import type { ResolveUrl } from "@focus-reactive/payload-plugin-seo";
const resolvePostUrl: ResolveUrl = ({ doc, locale }) =>
typeof doc.slug === "string" ? `/${locale}/blog/${doc.slug}` : null;
seoPlugin({
collections: [
{
slug: "posts",
extractContentPath: "@/collections/Posts/extractPostContent#default",
resolveUrl: resolvePostUrl,
},
],
});
resolveUrl runs on the server with the target document (depth 0) in the requested locale. Relative and absolute URLs both work. A thrown error is logged and treated as null.
Matching rules:
web does not match websites.café matches cafe. ñ, Cyrillic й and Japanese voiced kana such as が stay distinct letters.e-commerce matches e commerce.Intl.Segmenter where the runtime provides it.href whose path equals its resolveUrl result.LinkFeature shape (linkType: "internal", doc: { relationTo, value }) anywhere in the form data. Other link fields, such as custom link groups or relationship fields, are only detected through the href they render into the content.href counts only when it is relative, or when its host equals the host of serverURL, of the plugin's site.baseUrl, of the request or of an absolute resolveUrl result. http and https and a leading www. are treated as the same site. Links to other sites are ignored, even when their path matches./en/alpha and /alpha are different. If your site serves the default locale both with and without a prefix, return from resolveUrl the form your content links use.docCollection, docId, keyphrases only) and matches them in memory. Matching targets are then loaded in growing batches until 10 suggestions are found, at most 300 targets per request.hrefs of up to 2,048 characters each and at most 500 rich text internal links are compared.keyphraseIndex now defaults to true. If you never set it, the plugin now adds the hidden seo-keyphrases collection, its endpoints and the Internal links tab. On SQL adapters (Postgres, SQLite) run payload migrate:create and then payload migrate, or set keyphraseIndex: false to keep the browser-only behavior. Keyphrases saved in the browser are uploaded the first time the drawer is opened for each document and locale.
The plugin runs on @focus-reactive/payload-plugin-guard.
Its name in the access policy is seo, and it declares three capabilities:
| Capability | Allows | The caller also needs |
|---|---|---|
viewKeyphrases | GET /seo/keyphrases, GET /seo/keyphrase-usage, POST /seo/link-suggestions | read rights on the document |
editKeyphrases | PUT /seo/keyphrases | read and update rights on the document |
generate | POST /seo/generate and generation on publish | update rights on the document, or create rights for a new one |
401 without a user and 403 for a user outside the admin user collection or without the capability.404; a document the user can read but not update answers 403 to PUT /seo/keyphrases.
Update rights are checked with the collection's access.update for that document id, so query constraints are matched against the document.canUpdate in GET /seo/keyphrases is true only when the user holds editKeyphrases and may update the document; without it the drawer shows the keyphrases read-only.viewKeyphrases gets the drawer with browser-only keyphrases, without the "already used on" notice and the Internal links tab.GET /seo/capabilities tells the admin UI which capabilities the user holds.The seo-keyphrases collection is owned by the plugin and locked: create, read, update and delete must be nobody in the access policy, and the collection is hidden from the admin and not exposed over GraphQL.
Only the endpoints above read or write it.
They read and write the rows of a document after checking the user's rights on that document, and the rows of a deleted document are removed when the document is deleted.
4.0 moves the plugin onto @focus-reactive/payload-plugin-guard; Upgrading to the guard explains the model all the plugins share, with a complete example.
Every access rule is now written by hand in your project's src/access.policy.ts, and nothing is open by default: an entry you leave out stops the boot, and a capability you do not grant is refused for everyone.
@payloadcms/* package 3.90 or later, with the React and Next versions Payload 3.90 requires, Node 22.22 or later, and @focus-reactive/payload-plugin-guard installed next to the plugin.access is a required option with three capabilities and no default: before, any logged-in user of the admin user collection could use the endpoints and generate.seo-keyphrases collection is locked: every operation is nobody in the policy, and only the plugin's endpoints read and write it.OPENAI_API_KEY from the environment; pass it as generation: { apiKey: process.env.OPENAI_API_KEY }, or generation stays off.POST /seo/generate takes collection and, for a saved document, id, and refuses a user who may not update the document; the Generate button sends both.generate, and related documents are read with that user's rights; a save without a user generates nothing.Upgrade payload and every @payloadcms/* package to 3.90 or later, run the server on Node 22.22 or later, and install the guard:
pnpm add @focus-reactive/payload-plugin-guard @focus-reactive/payload-plugin-seo.
Add the plugin's entries to src/access.policy.ts, with gates for your own roles; if the project has no policy file yet, write it first as the guide describes.
// src/access.policy.ts, inside defineAccessPolicy({ ... })
collections: {
"seo-keyphrases": { create: nobody, read: nobody, update: nobody, delete: nobody },
},
plugins: {
seo: { viewKeyphrases: isEditor, editKeyphrases: isEditor, generate: isEditor },
},
viewKeyphrases: see the keyphrases of a document, where else they are used, and internal link suggestions; the user also needs read rights on the document.editKeyphrases: change a document's keyphrases; the user also needs read and update rights on the document.generate: generate SEO texts with the button and on publish; the user also needs update rights on the document, or create rights for a new one.seo-keyphrases: leave it out when keyphraseIndex is false.Pass access: accessPolicy.plugins.seo to seoPlugin, and export the config wrapped: export default withAccessPolicy(accessPolicy, buildConfig({ ... })).
Database: no migration; the keyphrase collection keeps its columns.
Re-test: an anonymous GET /api/seo/keyphrases answers 401 and a POST /api/seo/generate from a user without generate 403; GET /api/seo-keyphrases as an admin answers 403; then edit keyphrases and generate a description as an editor.
thresholds sets the bands of the checks that show a gauge, in the units the drawer shows. Every number is optional and defaults to the Yoast value, so leaving the option out changes nothing.
seoPlugin({
collections: [/* … */],
thresholds: {
keyphraseDensity: { min: 0.5, max: 2.5 },
textLength: { min: 600, acceptableMin: 450 },
},
});
| Check | Numbers (default) | Unit |
|---|---|---|
keyphraseLength | max good up to (4), acceptableMax okay up to (8) | words |
keyphraseDensity | min (0.5) to max (3) is good | % of the text weighted by keyphrase length, texts of 100+ words |
metaDescriptionLength | min too short up to (120), max too long over (156) | characters |
titleWidth | max too wide over (600); narrower titles are good, max must be over 400 | pixels |
textLength | min good from (300), acceptableMin okay from (250) | words |
textSentenceLength | maxSentenceWords (20), max good up to (25), acceptableMax okay up to (30) | words; % of sentences longer than maxSentenceWords |
fleschReadingEase | min good from (60), acceptableMin okay from (50) | score 0–100 |
keyphraseLength.max, textLength.acceptableMin or textSentenceLength.maxSentenceWords, a percentage or score over 100, a titleWidth.max of 400 or less, or bands in the wrong order (for example min not below max).0.7 + words / 3). The gauge shows the same value.titleWidth.max and metaDescriptionLength for their length meters and generation targets, unless the field sets its own range.supportedLocales lists which locale codes the drawer may load Yoast language packs for. English is built in; other languages are dynamically imported on demand the first time the document is edited in that locale:
seoPlugin({
collections: [
{
slug: "pages",
fields: { slug: "slug" },
extractContentPath: "@/seo/extractPageContent#default",
},
],
supportedLocales: ["en", "de", "fr", "es"],
});
The active locale is taken from the admin and normalized to Yoast's xx_XX form (e.g. en → en_EN). The locale is passed to your extractor as ctx.locale and to resolveDocs (so projected fetches are locale-correct). A locale not listed in supportedLocales falls back to English processing.
The drawer and the generated fields speak the admin's language (Payload's i18n, the user's language switch), independently of the content locale above. English and Czech ship with the plugin; any other admin language falls back to English string by string.
Payload only offers the admin languages your config enables, so add Czech to i18n.supportedLanguages to get the Czech UI:
import { cs } from "@payloadcms/translations/languages/cs";
import { en } from "@payloadcms/translations/languages/en";
export default buildConfig({
i18n: { supportedLanguages: { en, cs } },
// ...
});
The strings are registered as Payload custom translations under the seo namespace, so they can be overridden - or a whole language added - with translations. Keys are the ones in src/translations/messages/en.ts:
seoPlugin({
// ...
translations: {
de: {
title: "SEO-Analyse",
"tab.keyphrase": "Fokus-Keyphrase",
"viz.show.link_one": "{{count}} Link anzeigen",
"viz.show.link_other": "{{count}} Links anzeigen",
},
},
});
{{name}} placeholders are interpolated. Plurals are separate keys suffixed _zero, _one, _two, _few, _many or _other, chosen with Intl.PluralRules for the admin language; _other is required, the rest only where the language has that form (Czech uses _one, _few and _other). Keys are type-checked against the English set (the Translations type is exported). The seo: prefix and the colon-separated tab keys of earlier versions ("seo:tab:keyphrase") are still accepted. Strings from this option take precedence over i18n.translations.<language>.seo in your Payload config.
| Import path | Exports |
|---|---|
@focus-reactive/payload-plugin-seo | seoPlugin, seoTextField; types SeoPluginConfig, SeoPluginOptions, SeoCollectionConfig, SeoFieldPaths, SeoSiteConfig, ContentExtractor, SeoGenerationConfig, SeoThresholds, ResolveUrl, ResolveUrlArgs, Translations, MessageKey |
@focus-reactive/payload-plugin-seo/content | Builder helpers heading, paragraph, link, image, video, richText, html, compact; registerContentExtractors, resolveContentExtractor; types ContentNode, HeadingLevel, ContentExtractor, ExtractContext, ExtractToolkit, DocQuery, DocStore, ContentHelpers |
@focus-reactive/payload-plugin-seo/fields | seoTextField; type SeoTextFieldOptions |
@focus-reactive/payload-plugin-seo/admin.css | Compiled admin styles for the drawer & button |
Topics
Tags
payload plugin seo
Live Yoast-powered SEO analysis drawer in the Payload editor without adding database fields
7020/wk9v3
seo
Manage SEO metadata for your content from within the Payload admin panel
100346.5k/wk46.1kv3 v4
payload plugin guard
Central access policy file, typed predicates and guarded endpoints for Payload plugins and Local API calls
73664/wk37v3
payload plugin json form builder
Edit a Payload json field as real admin fields, with the form shape built in the admin panel
72441/wk37v3
payload plugin audit log
Append-only audit log of document, global and auth changes with CSV and NDJSON export
72394/wk37v3
payload plugin translator
Translate localized Payload content with an AI provider from the admin panel via background jobs
713.9k/wk37v3