SEO · Structured dataIn productionNDA

Structured data that stays correct as the catalog changes.

The site had thousands of pages and structured data on almost none of them. What existed had been added by hand, then drifted out of date as products and prices changed.

Category
SEO · Structured data
Output
Schema.org · JSON-LD
Coverage
Per page, generated
Status
In production

The problem

Hand-written markup, quietly wrong.

Structured data had been added manually to a handful of templates and never revisited. Prices in markup disagreed with prices on the page, which is worse than having no markup at all.

Canonical tags were a second problem: a previous templating change had pointed large groups of pages at a single canonical URL, telling search engines to ignore them.

Nothing validated any of this, so errors only surfaced weeks later in Search Console.

The hard parts

Correctness at scale.

  • Markup has to be generated from the same source as the visible page, or it will drift
  • Different page types need different schema types, and getting the type wrong is penalised
  • Canonicals must be generated per page from real routing, not templated once
  • Invalid markup should fail before deployment, not appear in Search Console later
  • Breadcrumb and FAQ markup has to correspond to content actually visible on the page

Architecture

Generation and validation.

  1. 01modelEach page type mapped to the appropriate Schema.org type
  2. 02generateJSON-LD built server-side from the same data that renders the page
  3. 03canonicalCanonical URLs derived per page from the real route
  4. 04validateGenerated markup validated in the pipeline; invalid output fails the build
  5. 05crawlInternal crawl checks coverage, duplicate titles and orphaned pages
  6. 06monitorSearch Console data reviewed against expected coverage

Stack

  • Laravel
  • Schema.org
  • JSON-LD
  • PHP 8.3
  • MySQL

What shipped

What shipped.

  • Per-page JSON-LD generated from page data, so markup cannot drift
  • Correct schema type per page type across the site
  • Canonical URLs derived from real routing rather than templated
  • Validation in the deployment pipeline, failing the build on invalid markup
  • Crawl reporting for duplicate metadata and orphaned pages
  • Breadcrumb and FAQ markup tied to visible page content

Result

Per page

Generated, validated structured data

Markup that maintains itself.

Structured data is now generated from the same source as the page, so a price change updates both. The class of error where markup contradicts content is designed out.

Canonical tags are derived per page from routing, which resolved the duplicate-content signals the previous templating had created.

Validation happens before deploy, so invalid markup fails a build instead of surfacing in Search Console weeks later.

Next step

Does your markup still match your pages?