內容簡介
datanephew SEO Bridge 外掛旨在擴展 WordPress REST API 的功能,使其能夠處理 Yoast SEO 和 Rank Math 的 SEO 標題、描述及關鍵字。這樣用戶可以通過 REST API 編輯這些 SEO 元數據,提升網站的 SEO 效能。
【主要功能】
• 註冊 Yoast SEO 和 Rank Math 的 SEO 元數據
• 支援 REST API 的讀寫操作
• 無需額外設定或資料庫表格
外掛標籤
開發者團隊
原文外掛簡介
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_title
rank_math_description
rank_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.
