0

I have used below given Schema.org code on my website, but still, I am not getting site links.

<script type="application/ld+json">
{
 "@context": "https://schema.org/",
 "@type": "WebSite",
 "name": "website-name",
 "url": "https://website-name.com.au",
 "potentialAction": {
   "@type": "SearchAction",
   "target": "https://prabingautam.com.au/?s={search_term_string}",
   "query-input": "required name=search_term_string"
 }
}
</script>

Moreover, I am confused about which query-input to use to get the site link search box. Either

"query-input": "required name=search_term_string"

or

"query-input": "required name=searchbox_target"
unor
  • 92,415
  • 26
  • 211
  • 360
  • Why `searchbox_target`? Where is this value coming from? – unor Jun 15 '19 at 00:29
  • So you suggest adding "query-input": "required name=search_term_string" ?? I have seen searchbox_target in some of the sites that are generating search box in Google SERP. – Prabin Manandhar Jun 18 '19 at 10:12

1 Answers1

0

You have to use the same value you used as placeholder in target.

"target": "https://prabingautam.com.au/?s={search_term_string}",
"query-input": "required name=search_term_string"
"target": "https://prabingautam.com.au/?s={searchbox_target}",
"query-input": "required name=searchbox_target"
"target": "https://prabingautam.com.au/?s={foobar}",
"query-input": "required name=foobar"

You can choose whatever you like. There is no reason not to use search_term_string (this value gets used in Google’s examples, so copy-pasting the code would be easier).

unor
  • 92,415
  • 26
  • 211
  • 360