Bryan Hamilton / projects / wp-schema-audit

bryanhamilton.info / open source / wp-schema-audit

wp-schema-audit Make broken structured data loud.

A zero-dependency WordPress plugin that audits JSON-LD across your content. It checks required properties, resolves internal @id references against nodes actually defined in the same graph, and reports malformed blocks instead of silently skipping them.

  • Required-property checks
  • Two-pass @id resolution
  • Read-only reporting
  • WP-CLI + admin + CI

Quick answer: wp-schema-audit is a read-only WordPress plugin that checks JSON-LD for missing required schema.org properties, unresolved internal @id references, and malformed JSON. Run it with WP-CLI, from Tools → Schema Audit, or in CI. Project source on GitHub.

Find the broken link in the graph

Browser-side illustration · no WordPress or server calls

Checks mirror the plugin’s default known-type rules; this demo audits one pasted block.

Audit summary

Ready to audit.

Choose a sample or paste JSON-LD, then run the audit.

What the engine checks

  • Required properties for known schema.org types.
  • Internal fragment references against graph definitions.
  • JSON parse errors as explicit findings.

The full plugin also scans published WordPress content and formats findings by post and JSON-LD block.

This browser demo illustrates one graph locally. It does not connect to a site, run the PHP plugin, or change content.

Catch the quiet failures at their source

Structured data often fails without taking a page down. An event can reference a performer or venue with @id even though that node was never included in the graph. Search tools surface the symptoms page by page; an audit can name the broken reference and its JSON-LD block.

The plugin checks all JSON-LD blocks in a content document. For known schema.org types, it verifies required properties; it indexes graph node definitions first, then resolves references in a second pass. Invalid JSON-LD is a finding too, not a skipped block.

Known types, concrete requirements

TypeRequired properties
MusicEventname, startDate, location, performer
MusicGroup / Placename
Organizationname, url
WebPage / Personname
FAQPagemainEntity
BreadcrumbListitemListElement

The map is a representative default, not a claim that every site's schema policy is identical. The engine is deliberately framework-agnostic and returns plain findings so callers choose how to present them.

One engine, three entry points

The same WordPress-free audit engine powers three ways to catch regressions:

$ wp schema-audit run
Success: audited 100 posts, 0 errors.

Build confidence in both directions

An auditor that only tests the clean case might be blind; one that only tests broken data might reject everything. The self-test runs both pass and fail fixtures. In CI the PHP files are linted and both expected outcomes are asserted, so a regression makes the build fail instead of merely printing a warning.

The plugin is read-only: it audits and reports, never edits content. The engine has no WordPress calls, making the same logic testable without bootstrapping WordPress or coupling the rules to one interface.

Production engine, representative defaults

The engine is the production logic. The required-property map is a representative default; site-specific rule sets and deployment wiring are not included. The WordPress plugin is the reusable port of the standalone jsonld-schema-audit CLI, which helped take The DJ Calendar from hundreds of Rich Results warnings to zero across roughly a thousand pages.

Frequently asked questions

What does the wp-schema-audit plugin check?

It checks required properties for supported schema.org types, validates internal fragment @id references against definitions in the same graph, and reports malformed JSON-LD blocks.

How can I run the audit?

Use wp schema-audit run with WP-CLI, open Tools → Schema Audit in WordPress admin to check the last 100 published posts, or run the repository's CI self-tests against its good and broken fixtures.

Does the plugin change my content?

No. It is strictly read-only: it audits and reports findings without writing to posts or changing JSON-LD.

Does this replace Google's Rich Results Test?

No. It complements page-level testing by helping identify root causes across a content library, such as a missing referenced node or malformed JSON-LD block.

Need structured data you can trust?

I build small, testable tools that turn hidden production regressions into specific findings you can fix.