GEOforge Schema

Описание

GEOforge generates JSON-LD schema markup and meta descriptions for the articles it publishes. WordPress strips inline <script> tags from post bodies (KSES sanitization) and hides underscore-prefixed meta from the REST API by default, so neither can be set by an external publishing tool without a companion plugin.

This plugin solves that by:

  1. Registering a _geoforge_jsonld post-meta key, exposed via the REST API, that GEOforge writes to when publishing or updating an article.
  2. Printing the stored JSON-LD inside a proper <script type="application/ld+json"> tag in the page <head> for single posts and pages.
  3. Registering the SEO post-meta keys used by Yoast SEO (_yoast_wpseo_metadesc) and Rank Math (rank_math_description) for REST API write access, so GEOforge can sync meta descriptions on publish. Each registration uses an edit_post auth check and sanitize_text_field-based sanitization capped at 320 characters. Registration is idempotent — if the SEO plugin already exposes the key for REST, our registration is a no-op.

No configuration required. Install, activate, and any GEOforge-published article will get its schema markup rendered correctly and its meta description handed to whichever SEO plugin is active.

Установка

  1. Upload the plugin zip via Plugins Add New Upload Plugin.
  2. Activate.
  3. Publish from GEOforge as normal — schema will appear in <head> on each article.

Часто задаваемые вопросы

Do I need GEOforge to use this plugin?

The plugin is designed to render JSON-LD that GEOforge writes during publish. It will work with any tool that writes a JSON-encoded string to the _geoforge_jsonld post-meta key via the REST API, but on its own it does nothing — there is no admin UI for entering schema by hand.

Will this conflict with Yoast SEO, Rank Math, or All in One SEO?

No. Multiple <script type="application/ld+json"> blocks per page are valid Schema.org and supported by Google — search engines merge the data. If both your SEO plugin and GEOforge emit schema, both will appear in the page head.

For meta descriptions, the plugin registers Yoast and Rank Math meta keys for REST. The registration calls are idempotent — if the SEO plugin has already registered the key itself, our call is a no-op. The auth callback restricts writes to users with edit_post capability on the target post.

Why is the meta key prefixed with an underscore?

WordPress treats underscore-prefixed meta as «protected» — hidden from the default Custom Fields UI in the post editor. This prevents accidental editing of the JSON blob while still allowing the REST API (and this plugin) to read and write it.

What happens if I deactivate the plugin?

The stored schema data is preserved in post meta. Re-activating restores schema rendering on the front end. Uninstalling the plugin does not remove the meta.

Отзывы

Нет отзывов об этом плагине.

Участники и разработчики

«GEOforge Schema» — проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:

Участники

Перевести «GEOforge Schema» на ваш язык.

Заинтересованы в разработке?

Посмотрите код, проверьте SVN репозиторий, или подпишитесь на журнал разработки по RSS.

Журнал изменений

1.2.0

  • JSON-LD output: decode the stored value and re-encode via wp_json_encode with JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT (plus JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) before emitting. Every HTML-sensitive character is emitted as a \uXXXX escape, replacing the prior str_replace('</', '<\/', $json) approach.
  • Register _yoast_wpseo_metadesc (Yoast SEO) and rank_math_description (Rank Math) post-meta keys for REST write access. Both use show_in_rest, an edit_post auth callback, and a sanitize_text_field-based sanitizer capped at 320 characters. Idempotent — no-op when the SEO plugin already exposes the key.

1.1.1

  • Readme: rewrite the short description so the wp.org renderer doesn’t strip the literal <head> tag and leave the sentence incomplete. Functionality unchanged.

1.1.0

  • Enqueue a small scoped stylesheet on single posts and pages that constrains .geoforge-content to a 768px max-width and makes inline images responsive. Fixes edge-to-edge text on themes that don’t apply a content container around the_content(). No typography or color rules — host theme keeps full control of look-and-feel.

1.0.0

  • Initial release.