Description
Yoast SEO and Rank Math store the SEO title, meta description and focus keyword as post meta, but do not register every one of those keys for the REST API. The core REST controller silently discards meta keys it does not know about, so a request that writes them returns 200 and changes nothing. This plugin registers those keys on the post and page post types, with an explicit sanitize callback and an auth callback that checks the caller can edit the post in question, so the standard /wp/v2/posts and /wp/v2/pages endpoints accept them. It adds no write routes of its own and relies on WordPress’s own capability checks. A key that the SEO plugin already exposes to REST is left exactly as that plugin registered it.
This plugin was built for datanephew, which edits SEO metadata over the WordPress REST API, but it is not tied to it and does not require it. It is equally useful to anyone — a headless front end, an editorial script, another integration — that needs those fields writable over REST. It collects no data, makes no outbound requests, adds no settings page, creates no database tables, and displays nothing in the WordPress admin.
All in One SEO is detected and reported, but its fields are not bridged, and it does not need to be. AIOSEO keeps SEO titles and descriptions in its own database table rather than in post meta, so registering post meta keys for it would not change what AIOSEO reads. AIOSEO 4.9.8 and later ship their own REST API for these fields on every plan including the free one, so an AIOSEO site can already write them through the core endpoints without this plugin.
What it registers
When Yoast SEO is active, for both posts and pages:
_yoast_wpseo_title_yoast_wpseo_metadesc_yoast_wpseo_focuskw
When Rank Math is active, for both posts and pages:
rank_math_titlerank_math_descriptionrank_math_focus_keyword
With none of the supported SEO plugins active, the plugin registers nothing.
Status endpoint
GET /wp-json/datanephew-seo-bridge/v1/status returns the plugin version, which SEO plugins were detected, and which meta keys were registered. It requires an authenticated user with the `edit_posts` capability and reports nothing else about the site.
Installation
- Upload the
datanephew-seo-bridgefolder to/wp-content/plugins/, or install it from the Plugins screen in WordPress. - Activate the plugin through the Plugins screen.
There is nothing to configure. The plugin detects Yoast SEO and Rank Math automatically and registers their meta keys when they are active.
FAQ
-
Does this change who can edit SEO fields?
-
No. Each registered meta key carries an auth callback that checks
edit_postfor the specific post being written, which is the same capability the core REST API requires to edit that post. -
Does it send anything anywhere?
-
No. The plugin makes no outbound HTTP requests of any kind.
-
Why is All in One SEO detected but not bridged?
-
Two reasons. AIOSEO stores SEO titles and descriptions in its own database table rather than in post meta, so registering post meta keys would have no effect on what AIOSEO reads. And it needs no help: since version 4.9.8 AIOSEO includes its own REST API for these fields on every plan, including the free version, so those fields are already writable through the core endpoints on an AIOSEO site. This plugin reports AIOSEO in its status endpoint so an integration can tell the difference, and otherwise leaves it alone.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“datanephew SEO Bridge” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “datanephew SEO Bridge” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.0
- Initial release. Registers Yoast SEO and Rank Math title, description and focus keyword meta for posts and pages, and adds a read-only status endpoint.