Your structured data is probably broken right now, and nobody on the marketing team knows. JSON-LD is code that ships with every template, yet most teams treat it like a plugin setting they check once at launch. Treat it like code instead: lint it, test it, and fail the build when it regresses.
Why Schema Rots Quietly
Structured data fails silently. A developer renames a field in the CMS, a theme update drops the author object, or a price formatter starts emitting "$49.00" instead of 49.00. The page looks identical to visitors. The JSON-LD is now invalid, and the only symptom is a rich result that disappears from search weeks later.
Manual spot checks do not catch this. Pasting one URL into a testing tool tells you about one page on one day. Schema problems are template problems, so the check has to run against every template, on every deploy, before the change reaches production.
What to Test and What to Skip
You do not need to validate everything. You need to validate the properties that drive eligibility for the features you actually care about. Start with the types your site really uses, and ignore the long tail of schema.org.
| Check | Where it runs | What it catches |
|---|---|---|
| JSON parses and has @context and @type | Unit test on rendered HTML | Broken escaping, empty blocks, duplicate blocks |
| Required properties present per type | CI script against built pages | Dropped author, missing image, null price |
| Property types and formats | CI script | Dates not in ISO 8601, prices as strings with symbols |
| Values match visible page content | Headless browser test | Schema that lies about the page |
| Live rich result eligibility | Weekly scheduled run | Google specific rule changes after launch |
The fourth row matters most and gets skipped most. Markup that describes content the visitor cannot see violates Google's structured data guidelines, and it is the easiest thing for a template bug to cause. Compare the headline, price, and rating in your JSON-LD to the rendered DOM and fail on mismatches.
A Small Script Beats a Big Platform
You can build the core check in under 60 lines of Node. Crawl a fixed sample of URLs, one or two per template, extract every script[type="application/ld+json"] block, and assert against a simple rules map.
The skeleton looks like this. Fetch the page, parse the HTML with a library such as cheerio, loop over the JSON-LD blocks, and JSON.parse each one inside a try/catch so a malformed block becomes a test failure instead of a crash. Flatten @graph arrays, because many CMS plugins wrap everything in one. Then check each node's @type against a map like Article: ["headline", "datePublished", "author", "image"] and Product: ["name", "offers.price", "offers.priceCurrency"].
Keep the rules map in the repo next to the templates, owned by the people who change the templates. When a developer adds a new page type, the pull request should add its schema rules too. Run the script in your pipeline against the preview deployment, and block the merge when a required property is missing.
For the format checks, validate dates with a strict ISO 8601 regex, require numeric prices, and confirm that image URLs return a 200 response. Those three checks alone catch most of the real-world breakage.
Wire It to People, Not Just Pipelines
A failing build only helps if the right person sees it. Post failures to the channel your SEO and engineering leads already watch, and include the template name, the URL tested, and the missing property. A message that says "Article schema on /insights/* lost author" gets fixed in an hour. A message that says "validation failed" gets ignored.
Add a weekly scheduled run against production too. Deploy-time tests catch your own changes, but a scheduled run catches content edits, plugin updates, and third-party scripts that inject their own markup. Send the weekly result only when something changed, so the alert keeps its meaning.
Schema
- List every page template and pick one representative URL for each
- Write a rules map of required properties for each schema type you ship
- Extract and parse every JSON-LD block, including nested @graph nodes
- Validate date formats, numeric prices, and image URL responses
- Compare key schema values to the rendered page text
- Run the check on preview deployments and block merges on failure
- Schedule a weekly production run that alerts only on changes
- Review the rules map whenever Google updates its structured data docs
Start with your top three templates this week. The first run will almost certainly find something broken, and that discovery is the whole argument for the project. Structured data is a contract between your site and search engines, and contracts deserve tests.
Tags
LETSGROW Dev Team
Marketing Technology Experts
Ready to Apply This Insight?
Schedule a strategy call to map these ideas to your architecture, data, and operating model.
Schedule Strategy Call