首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >json-ld用于证明

json-ld用于证明
EN

Webmasters Stack Exchange用户
提问于 2019-08-07 15:00:29
回答 1查看 196关注 0票数 2

目前,我们的网站上有一些页面列出了当地企业,在这些页面上,我们也有了推荐信。

我试图为这些页面制作json+ld,我读到,对于证明,您应该使用Review模式,但是对于itemReviewed,您应该将组织。

考虑到这一点,我想出了以下的json:

代码语言:javascript
运行
复制
{
  "reviews": [{
    "author": {
      "name": "Joe Blogs",
      "@type": "Person"
    },
    "itemReviewed": {
      "name": "Test Company",
      "@type": "Organization"
    },
    "reviewBody": "This is a testimonial 1",
    "@type": "Review"
  }, {
    "author": {
      "name": "John Smith",
      "@type": "Person"
    },
    "itemReviewed": {
      "name": "Test Company",
      "@type": "Organization"
    },
    "reviewBody": "Testimonial text 2",
    "@type": "Review"
  }, {
    "author": {
      "name": "Jane Doe",
      "@type": "Person"
    },
    "itemReviewed": {
      "name": "Test Company",
      "@type": "Organization"
    },
    "reviewBody": "Testimonial content 3",
    "@type": "Review"
  }],
  "url": "http://www.example.co.uk",
  "@context": "https://schema.org/",
  "name": "Test Company",
  "@type": "LocalBusiness",
  "image": "https://www.fillmurray.com/200/300"
}

但是,当我在https://search.google.com/structured-data/testing-tool测试代码片段时,评论都失败了。

多个评审应该附带一个总体评级。

我应该如何添加推荐信,因为它们没有评级(或者是否有一种方法不需要多个评论的综合评级)?

EN

回答 1

Webmasters Stack Exchange用户

发布于 2019-08-09 14:34:08

  1. 你的说法for the itemReviewed, you should put organization是错的。你从哪里弄来的?Google列出了一组类型,可以查看:https://developers.google.com/search/docs/data-types/review-snippet?hl=en
  2. 这是真的:如果没有评级值,您将无法通过SDTT获得无错误验证。这是目前的设计。

你可以使用评论。你可以使用多个评论。但是要让SDTT验证代码片段,需要使用评级/聚合率来给Google一些数字。您可以在没有评级的情况下使用多个评论--这是有效的语法:

代码语言:javascript
运行
复制
{
  "@context": "https://schema.org/",
  "review":
[{ "@type": "Review",
  "itemReviewed": {
    "@type": "Restaurant"
  },
  "name": "A good seafood place.",
  "author": {
    "@type": "Person",
    "name": "Bob Smith"
  },
  "reviewBody": "The seafood is great.",
  "publisher": {
    "@type": "Organization",
    "name": "Washington Times"
  }},
 { "@type": "Review",
  "itemReviewed": {
    "@type": "Restaurant"
  },
  "name": "A good seafood place.",
  "author": {
    "@type": "Person",
    "name": "Bob Smith"
  },
  "reviewBody": "The seafood is great.",
  "publisher": {
    "@type": "Organization",
    "name": "Washington Times"
  }}]
}

在这里测试它:https://json-ld.org/playground/,您将看到。

票数 2
EN
页面原文内容由Webmasters Stack Exchange提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://webmasters.stackexchange.com/questions/124430

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档