Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How I Took ~1,000 Pages From Hundreds of Rich Results Warnings to Zero

Описание и применение

Автоматический скрипт на PHP устранил сотни предупреждений Rich Results на 1 000 страницах сайта, проверяя обязательные свойства, корректность ссылок @id и синтаксис JSON‑LD, и интегрировался в CI.

Задача

Hundreds of Rich Results warnings appeared on ~1,000 pages of structured data because JSON‑LD references pointed to nodes that were never defined.

Результат

The auditor reduced Rich Results warnings from hundreds to zero across ~1,000 pages and provides continuous protection against future regressions.

Рабочий процесс

  • 1. Extract all <script type="application/ld+json"> blocks from each rendered HTML file.
  • 2. Run three checks: required properties, @id resolution, and JSON parse errors.
  • 3. First pass indexes all nodes with @id to build a definition map.
  • 4. Second pass walks each node recursively, validating internal @id references against the map.
  • 5. Emit errors for missing properties, unresolved references, or parse failures.
  • 6. Return exit code 0 if clean, 1 if errors, 2 if misuse.
  • 7. Integrate the script into CI so any new warning causes a build failure.

Доказательства

Google flagged hundreds of Rich Results warnings across them.

Источник

jsonld-schema-audit is one PHP file with no dependencies.

Источник

The exit code ties it together: 0 when clean, 1 when there are errors, 2 for bad usage.

Источник

  • Дата записи: 2026-10-13T10:41:26.603Z