Sitelinks Search Box JSON-LD giving error on Google Structured Data Testing Tool

前端 未结 3 957

I implemented Google’s Sitelinks Search Box to my site. It was working very well. But today I cheked again on Google Structured Data Testing Tool and something was wrong. Now I’

3条回答
  •  北荒
    北荒 (楼主)
    2021-02-20 13:28

    Found the answer by reviewing the schema.org Potential Actions page.

    Apparently, for whatever reason, Google’s Structured Data Testing Tool doesn’t like our short-hand version for textual representations of input and output.

    When I switched to the verbose version I get the good checkmark for WebSite (1), not http://www.example.com/Website (1).

    Textual representations of Input and Output

    For convenience, we also support a textual short-hand for both of these types that is formatted and named similarly to how they would appear in their HTML equivalent. For example:

    "-input": {
      "@type": "PropertyValueSpecification",
      "valueRequired": true,
      "valueMaxlength": 100,
      "valueName": "q"
    }
    

    Can also be expressed as:

    -input: "required maxlength=100 name=q"
    

    Here is our full code for anyone else trying to follow this:

    
    

提交回复
热议问题