Repository navigation
Lets the Progressio Dash content pipeline set SEO fields when it publishes a post over POST /wp/v2/posts.
What this fixes
Rank Math stores SEO title, meta description and focus keyword as ordinary post meta and does not register the keys for REST writes, so WordPress silently discarded them — a REST publish returned 201 with the SEO fields empty and nothing in the response to say so. Registering the keys closes that gap. No custom endpoint, no per-client configuration.
Keys exposed (single-line strings only; robots, schema and social overrides are out of scope):
| Rank Math | Yoast |
|---|---|
rank_math_title |
_yoast_wpseo_title |
rank_math_description |
_yoast_wpseo_metadesc |
rank_math_focus_keyword |
_yoast_wpseo_focuskw |
Yoast already worked
Verified against Yoast SEO 28.5 on two live sites: Yoast already registers its three keys with show_in_rest and its own sanitize/auth callbacks, so they were writable before this release. Any key an SEO plugin already exposes is therefore skipped rather than re-registered — a second register_post_meta() call wins and would have silently replaced WPSEO_Meta::sanitize_post_meta with ours. Older Yoast builds lacking the registration are still covered. Registration runs at init priority 99 so the SEO plugin registers first.
Security
Writes are gated on edit_post for the specific post. An admin is allowed; an anonymous request gets 401 rest_cannot_edit; a Subscriber holds none of the capabilities edit_post maps to. Sites running neither plugin register nothing and are unaffected.
Behaviour changes worth knowing
- Registered meta is readable by anyone who can read the post, so
rank_math_focus_keywordbecomes publicly readable on Rank Math sites. WordPress does not read-gate protected meta either, so Yoast sites already expose theirs — this is parity, not a new pattern. - The
sanitize_text_fieldcallback applies to every save of these keys, including saves made through Rank Math's own editor: HTML is stripped and newlines collapsed. Rank Math%variable%syntax is preserved.
Also
- Lead payloads carry a read-only
seoPluginfield (rank_math,yoast,rank_math+yoast,none) so the dashboard can report whether SEO meta is writable without attempting a publish. Lead capture behaviour is otherwise unchanged.
Requires PHP 8.0+ and WordPress 5.9+ (unchanged since v1.5.0).