1

I am trying to implement Google sitelink on a website. I read Error: Page contains property "query-input" which is not part of the schema and few other articles.

I am using JSON LD format. Here is what it looks like...

[{
    "@context" : "https://schema.org",
    "@type" : "Organization",
    "name" : "yrshaikh.com",
    "url" : "https://www.yrshaikh.com/",
    "logo" : "https://yrshaikh.com/smile.png",
    "sameAs" : [
        "https://www.facebook.com/yrshaikh",
        "https://www.instagram.com/yrshaikh/",
        "https://www.pinterest.com/yrshaikhdotcom/",
        "https://www.youtube.com/user/yrshaikh",
        "https://twitter.com/yrshaikh",
        "https://plus.google.com/+yrshaikh",
        "https://www.linkedin.com/company/yrshaikh",
        "https://en.wikipedia.org/wiki/yrshaikh.com"
        ]
    },
    {
    "@context":"https://schema.org",
    "@type":"WebSite",
    "name":"yrshaikh",
    "alternateName":"yrshaikh.com",
    "url":"https://www.yrshaikh.com/",
    "potentialAction":{
        "@type":"SearchAction",
        "target":"https://www.yrshaikh.com/search.html?text={search_term_string}&pop=1766357",
        "query-input":"required name=search_term_string"
        }
}]

(pls ignore the domain name, have replaced the actual one with a dummy domain one - yrshaikh.com)

I do not have any <form> tag on my homepage.

When I search for my domain on Google I do see a Sitelinks Searchbox, but when I enter a search term and search, it does not redirect to my target url with the search term, instead it searches in Google by whatever-search-term site:yrshaikh.com.

I have also tested my JSON LD on Google's Structured Data Testing Tool and it looks good to me, no errors/warnings.

enter image description here

Also another point worth noting is that this search url is internally redirected to a different route based on the incoming keyword.

Please advice.

Community
  • 1
  • 1
Yasser Shaikh
  • 46,934
  • 46
  • 204
  • 281

1 Answers1

1

With an array of objects. Seems like the way to go forward can be this (i.e. using @graph instead of a normal json array):

Can you try and check for your website?

source references: https://webmasters.stackexchange.com/a/90319, https://stackoverflow.com/a/33457312/1670511

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@graph": 
  [
    {
       "@type": "WebSite"
    },
    {
       "@type": "Organization"
    }
  ]
}
</script>
Community
  • 1
  • 1
Danyal
  • 448
  • 4
  • 18