=== SchemaDemon ===
Contributors: jonprice
Tags: schema, json-ld, structured data, seo, rank math
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Take control of which schema loads where. Add your own JSON-LD to any page and merge it cleanly into Rank Math's graph.

== Description ==

SchemaDemon lets you write your own JSON-LD for each page. It merges that markup into the schema graph your SEO plugin already prints. You get one clean graph per page, with no duplicate WebPage, WebSite or Organization nodes.

**What it does**

* Adds JSON-LD blocks to each page, linted in the editor and validated on save.
* Merges your blocks into Rank Math's graph using rules. Rules match by page, role, folder, post type or default.
* Gives each page a mode: Lead (your markup leads), Follow (the SEO plugin leads), Silence (hide the SEO plugin's schema) or Off (print nothing).
* Keeps site entities (your Organization and WebSite) in one place and reuses them on every page.
* Keeps a registry of people and locations. A page that points to a person or place gets a small stub that links to the full entry.
* Lets Rank Math own breadcrumbs by default. Your BreadcrumbList is used only if Rank Math has none.
* Replaces Rank Math's Organization with yours, as a site-wide setting.
* Imports Schemachine folders in one step and matches each file to its page.
* Exports and imports backups of your markup, rules and settings.
* Includes WP-CLI commands for import, export, purge and more.
* Registers Abilities for AI agents on WordPress 6.9 and later.
* Purges page caches when markup, rules or settings change.
* Stays compatible with v1. Pages that only have v1 markup print exactly as before.

Rank Math is supported now. Yoast support is coming.

Website: https://schemademon.com
Support: jon@schemademon.com

== Installation ==

1. In WordPress admin, go to Plugins > Add New Plugin > Upload Plugin.
2. Choose the SchemaDemon zip file and click Install Now. Do not unzip it first.
3. Click Activate.
4. Open the SchemaDemon menu to see Overview, Rules, Pages, Import/Export and Settings.
5. Edit any page and scroll to the SchemaDemon box to add JSON-LD.

Upgrading from v1 works in place. Your v1 schema is kept.

== Frequently Asked Questions ==

= Does it work with Yoast? =

Not yet. Yoast support is coming. Rank Math is supported now.

= Does it delete my data when I uninstall it? =

No. Nothing is deleted unless you turn on "Delete all SchemaDemon data when the plugin is uninstalled" in Settings first. Your v1 schema is never deleted.

= How do I import my Schemachine files? =

Go to SchemaDemon > Import/Export and choose your folder or files. Review the plan, then import. Each file is matched to its page by the URL in its WebPage node. You can also run `wp schemademon import <dir>`. For a staging site, add `--map-host=live.com=staging.test`.

= How do v1 pages behave? =

A page with only v1 markup prints exactly as it did in v1. That changes only if you assign a role, add a page rule or save new markup in the v2 box. Your v1 data is never altered.

= Does it replace my SEO plugin's schema? =

No. It merges with it. Use a checker like Google's Rich Results Test to see the combined result.

== Changelog ==

= 2.0.2 =
* Fixed: export files over 1 MB can be imported again.
* Fixed: restoring an export clears Extra, role and override when the backup has them empty.
* Fixed: turning off "Use SchemaDemon's Organization" is respected in Lead mode.
* Fixed: site export includes every page with markup.
* Fixed: import domain mapping keeps the site's real host and port.
* Fixed: zips with same-named files in different folders import correctly.
* Fixed: plain-permalink URLs resolve to the right page.
* Fixed: aliased @id values and breadcrumb links are rewritten correctly.
* Fixed: saving keeps the role when its option is disabled for your account.
* Security: site entities and registry stubs are checked like page markup.

= 2.0.1 =
* New: {{FEATURED_IMAGE}} token.
* New: import offers to map the live domain to this site's domain.
* Fixed: your page links to Rank Math's BreadcrumbList when Rank Math owns breadcrumbs.
* Admin branding: logo header, lime accent, white menu icon.

= 2.0.0 =
* New: per-page JSON-LD blocks merged into Rank Math's graph by rules.
* New: Lead, Follow, Silence and Off modes.
* New: site entities, and a registry of people and locations.
* New: Rank Math owns breadcrumbs by default. Option to replace Rank Math's Organization.
* New: Schemachine folder import, export and import backups, and WP-CLI commands.
* New: Abilities for AI agents (WordPress 6.9+).
* New: page cache purge on changes.
* New: admin screens for Overview, Rules, Pages, Import/Export and Settings.
* Compatible with v1: v1-only pages print exactly as before.
* Security: role permissions for site-wide entities, key and value checks on saved markup, import size caps.

= 1.0.4 =
* Logo: navy "S" for better contrast.

= 1.0.3 =
* Output is re-encoded with tag-safe escaping on render.
* Consistent "schemademon" text domain.
* Website and Support links on the Plugins screen.
* Version and copyright footer in the editor box.

= 1.0.2 =
* Initial public release.

== Copyright ==

SchemaDemon, Copyright (C) 2025 Jon Price <jon@schemademon.com>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
