WP Manifestindependent plugin directory
manifest / seo / wp-seo-meta-bridge

WP SEO Meta Bridge

Detects your active SEO plugin (Rank Math / Yoast / SEOPress) and exposes its fields to the WordPress REST API, so the block editor and MCP agents can set SEO while building pages.

by Mrshahidali420 · github.com/mrshahidali420/wp-seo-meta-bridge · website

0stars
0forks

Install

The author publishes release zips, so WP-CLI can install straight from GitHub:

wp plugin install https://github.com/mrshahidali420/wp-seo-meta-bridge/releases/download/v2.0.0/wp-seo-meta-bridge-2.0.0.zip

Readme

WP SEO Meta Bridge

Set SEO metadata over the REST API — for the block editor, custom apps, and AI agents.

This tiny WordPress plugin detects your active SEO pluginRank Math, Yoast SEO, or SEOPress — and exposes only that plugin's fields to the REST API: SEO title, meta description, canonical, robots, and Open Graph / Twitter social tags. Once active, anything that speaks REST — the block editor, a headless front end, or an MCP agent such as EMCP Tools — can read and write those fields as normal post meta while creating or editing a page.

No Pro add-on, no custom endpoints to memorise, no hard-coded meta keys in your scripts or prompts.

Why this exists

Most SEO plugins store their data in post meta, but:

  • Yoast and SEOPress use _-prefixed ("protected") keys, which WordPress hides from the REST API — and which EMCP Tools blocks unless they're allow-listed.
  • Rank Math uses public keys, but they aren't surfaced in the REST schema with any hint of what they mean.

So a program building a page has no reliable, self-describing way to set SEO. This bridge fixes that in ~330 lines by registering the right keys, with human-readable descriptions, for whichever plugin you actually run.

What it does

  1. Auto-detects the active SEO plugin at runtime (RANK_MATH_VERSION, WPSEO_VERSION, SEOPRESS_VERSION).
  2. Registers that plugin's SEO fields as REST-visible post meta on every public post type, each with a friendly description, correct type, sanitisation, and an edit_post auth check.
  3. Bridges EMCP Tools by adding the protected keys to the emcp_tools_content_allowed_protected_meta filter, so create-post / update-post can write them and get-post can read them back.
  4. Exposes a discovery endpoint, GET /wp-json/seo-meta-bridge/v1/fields, that reports which plugin is active and which keys to set.

It never clobbers a meta key the SEO plugin already registered itself.

Supported plugins & fields

Field Rank Math Yoast SEO SEOPress
SEO title rank_math_title _yoast_wpseo_title _seopress_titles_title
Meta description rank_math_description _yoast_wpseo_metadesc _seopress_titles_desc
Focus keyword(s) rank_math_focus_keyword _yoast_wpseo_focuskw _seopress_analysis_target_kw
Canonical URL rank_math_canonical_url _yoast_wpseo_canonical _seopress_robots_canonical
Robots / noindex rank_math_robots (array) _yoast_wpseo_meta-robots-noindex _seopress_robots_index
OG title rank_math_facebook_title _yoast_wpseo_opengraph-title _seopress_social_fb_title
OG description rank_math_facebook_description _yoast_wpseo_opengraph-description _seopress_social_fb_desc
OG image rank_math_facebook_image _yoast_wpseo_opengraph-image _seopress_social_fb_img
Twitter title rank_math_twitter_title _yoast_wpseo_twitter-title _seopress_social_twitter_title
Twitter description rank_math_twitter_description _yoast_wpseo_twitter-description _seopress_social_twitter_desc

All in One SEO is intentionally not supported — it stores metadata in its own wp_aioseo_posts table rather than post meta, so a meta bridge can't reach it.

Install

As a normal plugin

  1. Download this repo as a ZIP (or clone it into wp-content/plugins/wp-seo-meta-bridge/).
  2. Activate WP SEO Meta Bridge in Plugins.

As a must-use plugin (always on, can't be deactivated)

Drop wp-seo-meta-bridge.php into wp-content/mu-plugins/.

Either way, activate one of the supported SEO plugins too — the bridge shows an admin notice if none is detected.

Usage

Core REST API or block editor

The fields are writable via PATCH /wp/v2/posts/{id} in the meta object, and appear in the block editor's wp.data post meta — handy for a custom SEO sidebar. On a Rank Math site:

// PATCH /wp/v2/posts/42
{
  "meta": {
    "rank_math_title": "Emergency Locksmith in Croydon | 24/7 Call-Out",
    "rank_math_description": "Locked out in Croydon? Our DBS-checked locksmiths reach you in ~30 minutes. No call-out fee.",
    "rank_math_focus_keyword": "croydon locksmith"
  }
}

On a Yoast or SEOPress site, use the matching keys from the table above — the bridge has already allow-listed them.

With EMCP Tools / an MCP agent

Ask the agent to set the meta while it builds the page:

// update-post
{
  "id": 42,
  "meta": {
    "_yoast_wpseo_title": "Emergency Locksmith in Croydon | 24/7 Call-Out",
    "_yoast_wpseo_metadesc": "Locked out in Croydon? DBS-checked locksmiths, ~30 min response, no call-out fee.",
    "_yoast_wpseo_focuskw": "croydon locksmith"
  }
}

Discover the fields programmatically

GET /wp-json/seo-meta-bridge/v1/fields
{
  "active_plugin": "rankmath",
  "active_plugin_label": "Rank Math",
  "detected": ["rankmath"],
  "field_count": 10,
  "fields": {
    "rank_math_title": {
      "label": "SEO title",
      "type": "string",
      "description": "The <title> shown in search results.",
      "protected": false,
      "plugin": "rankmath"
    }
    // ...
  },
  "usage": "Set these keys via PATCH /wp/v2/posts/{id} with a `meta` object, or the EMCP `update-post` tool's `meta` argument."
}

Requires the edit_posts capability.

Extend it

Change which post types get the fields:

add_filter( 'seo_meta_bridge_post_types', function ( $types ) {
    $types[] = 'product'; // e.g. add WooCommerce products
    return $types;
} );

Requirements

  • WordPress 6.0+
  • PHP 7.4+
  • One of: Rank Math, Yoast SEO, or SEOPress
  • Optional: EMCP Tools for agent-driven page building

License

GPL-2.0-or-later. Not affiliated with Rank Math, Yoast, SEOPress, Elementor, or EMCP Tools.

Read the full README on GitHub →

Releases

TagPublishedAssetDownloads
v2.0.0 Jul 11, 2026 wp-seo-meta-bridge-2.0.0.zip 0