structured-data-audit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Structured Data Audit

结构化数据审计

Check a site's JSON-LD: is it valid, is it the right type for the page, and does the site describe each entity (the organization, the website, the authors, the products) once, with a stable identity, instead of redeclaring it differently on every page.
Valid markup does not guarantee rich results. Search engines decide eligibility, and markup must describe what is visible on the page.
检查一个网站的 JSON-LD:它是否有效,是否适合该页面类型,以及该网站是否仅描述每个实体(组织、网站、作者、产品)一次,并赋予其稳定身份,而不是在每个页面上都以不同方式重新声明。
有效的标记并不保证能获得富结果。搜索引擎会决定是否符合展示资格,而标记必须描述页面上可见的内容。

Before the first audit

首次审计前

Run
squirrel --version
. If it fails, install the CLI from squirrelscan.com/download (the
squirrelscan
skill has
references/install.md
). Then run
squirrel auth status
:
  • Signed out, or
    --offline
    : the audit runs on this machine, is free, and nothing is published.
  • Signed in: the audit is billed in credits (50 plus 2 per audited page, plus 1 per distinct external link the cloud verifies), adds the site to the user's dashboard, can turn on recurring audits and publishes an unlisted report. Tell the user the cost (
    squirrel credits
    ) and get a yes. Offer
    --offline
    or
    --no-publish
    . For a site the user does not own, add
    --ephemeral
    : nothing is added to the dashboard, scheduled or published.
Every flag below is checked against the squirrel CLI docs (https://docs.squirrelscan.com/cli/audit). Rule docs:
https://docs.squirrelscan.com/rules/{category}/{rule_id}
.
运行
squirrel --version
。如果失败,请从 squirrelscan.com/download 安装 CLI(
squirrelscan
skill 的
references/install.md
中有说明)。然后运行
squirrel auth status
:
  • 未登录,或使用
    --offline
    :审计将在本机运行,免费,且不会发布任何内容。
  • 已登录:审计将按 credits 计费(基础 50 credits,每个受审计页面另加 2 credits,云端验证的每个不同外部链接再加 1 credit),将站点添加到用户仪表板,可启用定期审计,并发布一份不公开索引的报告。告知用户费用(
    squirrel credits
    )并获得确认。可提供
    --offline
    或
    --no-publish
    。如果用户并不拥有该站点,请添加
    --ephemeral
    :不会将任何内容添加到仪表板、定时任务或发布结果中。

Run it

运行

bash
squirrel audit https://example.com --level surface --rule-include schema --format json -o schema.json
squirrel entities                      # the site-wide entity graph from the latest audit
squirrel entities --problem no-id,conflict,split-identity,dangling
  • --rule-include schema
    runs the per-page and site-wide structured data rules (
    schema/json-ld-valid
    ,
    schema/expected-type
    ,
    schema/entity-*
    and the type rules such as
    schema/product
    ,
    schema/article
    ,
    schema/breadcrumb
    ,
    schema/faq
    ,
    schema/local-business
    ,
    schema/organization
    ).
  • The entity map collapses all JSON-LD into one graph. Sixty valid
    Organization
    blocks with no
    @id
    are sixty organizations to a search engine. Entity problems are
    no-id
    ,
    conflict
    ,
    dangling
    ,
    single-page
    and
    split-identity
    . The
    squirrelscan
    skill's
    references/entity-map.md
    and
    references/entity-map-fixes.md
    have the shape that works and the exact change per stack. Read them when an
    entity-*
    finding appears.
  • Use
    --level full
    when the entity map matters: it is built from the pages crawled.
bash
squirrel audit https://example.com --level surface --rule-include schema --format json -o schema.json
squirrel entities                      # 从最新审计中获取全站实体图
squirrel entities --problem no-id,conflict,split-identity,dangling
  • --rule-include schema
    运行逐页及全站结构化数据规则(
    schema/json-ld-valid
    、
    schema/expected-type
    、
    schema/entity-*
    ,以及
    schema/product
    、
    schema/article
    、
    schema/breadcrumb
    、
    schema/faq
    、
    schema/local-business
    、
    schema/organization
    等类型规则)。
  • 实体图会将所有 JSON-LD 合并为一个图。对搜索引擎而言,60 个没有
    @id
    的有效
    Organization
    块就等于 60 个组织。实体问题包括
    no-id
    、
    conflict
    、
    dangling
    、
    single-page
    和
    split-identity
    。当出现
    entity-*
    发现项时,
    squirrelscan
    skill 的
    references/entity-map.md
    和
    references/entity-map-fixes.md
    包含有效结构及按技术栈进行精确修改的方法。请在出现这些发现项时查阅相关文档。
  • 当实体图很重要时,使用
    --level full
    :它会根据已爬取的页面构建。

Fix order

修复顺序

  1. Parse errors first:
    schema/json-ld-valid
    (a block that does not parse is ignored entirely).
  2. Identity: give each real-world entity one stable
    @id
    (for example
    https://example.com/#organization
    ), declare it fully once, and reference it by
    @id
    elsewhere. Rules:
    schema/entity-id-format
    ,
    schema/entity-organization-missing
    ,
    schema/entity-website-missing
    ,
    schema/entity-split-identity
    ,
    schema/entity-conflicts
    ,
    schema/entity-dangling
    ,
    schema/entity-orphan
    ,
    schema/entity-publisher-mismatch
    .
  3. Type fit:
    schema/expected-type
    ,
    schema/coverage-outlier
    (a page type missing the markup its siblings have).
  4. Required and recommended properties per type:
    schema/product
    ,
    schema/article
    ,
    schema/organization
    ,
    schema/local-business
    ,
    schema/video
    ,
    schema/review
    ,
    schema/rating-scope
    ,
    schema/faq
    ,
    schema/breadcrumb
    .
  5. Markup that claims more than the page shows: where a finding says the markup states something the page does not, fix the page or remove the markup. Never add markup for content users cannot see.
  1. 先处理解析错误:
    schema/json-ld-valid
    (无法解析的块会被完全忽略)。
  2. 身份标识: 为每个现实世界中的实体提供一个稳定的
    @id
    (例如
    https://example.com/#organization
    ),完整声明一次,并在其他位置通过
    @id
    引用。规则:
    schema/entity-id-format
    、
    schema/entity-organization-missing
    、
    schema/entity-website-missing
    、
    schema/entity-split-identity
    、
    schema/entity-conflicts
    、
    schema/entity-dangling
    、
    schema/entity-orphan
    、
    schema/entity-publisher-mismatch
    。
  3. 类型适配:
    schema/expected-type
    、
    schema/coverage-outlier
    (某类页面缺少同级页面已有的标记)。
  4. 各类型必需及推荐属性:
    schema/product
    、
    schema/article
    、
    schema/organization
    、
    schema/local-business
    、
    schema/video
    、
    schema/review
    、
    schema/rating-scope
    、
    schema/faq
    、
    schema/breadcrumb
    。
  5. 标记所声明的内容超出页面实际展示的内容: 如果发现项指出标记声明了页面不存在的内容,请修复页面或删除标记。绝不要为用户看不到的内容添加标记。

Where the fix usually lives

修复通常位于哪里

StackLook here
WordPress with Yoast SEOYoast outputs one schema graph with
@id
s. Duplicates come from the theme or another plugin also printing JSON-LD: disable one source. Organization details are in Yoast's site representation settings
Next.jsone
<script type="application/ld+json">
in the root layout for the Organization and WebSite (with
@id
), page-level scripts that reference those ids
Shopifythe theme's product JSON-LD (often duplicated by an app), and
theme.liquid
for Organization
WebflowSite settings or page custom code (head)
Static and docsthe layout template's head, generated from site config so every page agrees
Validate in the user's tools of choice once the audit is clean (for example Google's Rich Results Test); squirrelscan does not claim rich-result eligibility.
技术栈查看位置
使用 Yoast SEO 的 WordPressYoast 会输出一个带
@id
的 schema 图。重复项来自主题或另一个也会输出 JSON-LD 的插件:禁用其中一个来源。Organization 详情位于 Yoast 的站点表示设置中
Next.js在根布局中放置一个
<script type="application/ld+json">
,用于 Organization 和 WebSite(带
@id
);页面级脚本引用这些 ID
Shopify主题中的产品 JSON-LD(通常会与应用输出重复),以及
theme.liquid
中的 Organization
Webflow站点设置或页面自定义代码(head)
静态站点和文档站点布局模板的 head,由站点配置生成,从而确保每个页面保持一致
审计清理完成后,使用用户选择的工具进行验证(例如 Google 的 Rich Results Test);squirrelscan 不保证获得富结果展示资格。

Prove it

验证修复

Re-audit, then
squirrel entities --diff
. An entity that gains an
@id
changes key, so read the
gainedId
section (and its
coverage
:
proven
or
partial
, and
notCrawled
should be empty) rather than the added and removed lists.
重新审计,然后运行
squirrel entities --diff
。实体获得
@id
后其键会发生变化,因此应读取
gainedId
部分(以及其中的
coverage
:
proven
或
partial
,同时
notCrawled
应为空),而不是查看新增和移除列表。

Stop condition

停止条件

Stop when
schema/json-ld-valid
is clean, no
entity-conflicts
,
entity-split-identity
or
entity-dangling
remain on a full crawl, each page type has the markup its siblings have or a reason it does not, and every finding about markup the page does not back up is resolved by fixing the page or the markup.
当
schema/json-ld-valid
无问题、全量爬取后不再存在
entity-conflicts
、
entity-split-identity
或
entity-dangling
、每种页面类型都具备同级页面已有的标记或存在不添加的理由,并且所有关于标记内容无法在页面上得到印证的问题都已通过修复页面或标记解决时,停止处理。

Hand off

后续处理

Titles, canonicals, content:
seo-audit
. The wider loop:
audit-website
.
标题、canonical 和内容:
seo-audit
。更广泛的审计流程:
audit-website
。