Search code examples
schema.orggoogle-rich-snippetsjson-ld

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


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’m getting below error:

Google Structured Data Testing Tool: 2 Errors for WebSite

And my implementation is:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "WebSite",
  "url": "https://www.saatler.com/",
  "potentialAction": {
    "@type": "SearchAction",
    "target": "https://www.saatler.com/arama?ara={search_term_string}",
    "query-input":"required name=search_term_string"
  }
}
</script>

When I check the JSON on the JSON-LD playground everything is looking good. I didn’t change anything on my site. Is Google wrong about this issue? Or the Schema.org structure has changed? What should I do to fix these 2 problems?


Solution

  • I noticed that even the examples on the online documentation receive the same exact error you received. When I changed

    "@context": "http://schema.org"
    

    to

    "@context": "http://schema.org/true"
    

    the error disappeared. Hope this helps.

    enter image description here

    <script type="application/ld+json">
    {
      "@context": "http://schema.org/true",
      "@type": "WebSite",
      "url": "https://www.saatler.com/",
      "potentialAction": {
        "@type": "SearchAction",
        "target": "https://www.saatler.com/arama?ara={search_term_string}",
        "query-input":"required name=search_term_string"
      }
    }
    </script>