I am following this guide by Google to add a sitelinks search bar on my website. The structured data markup tool shows everything to be correct. But:
- The search bar hasn't appeared in the search results for my website.
Google has indexed the page
www.example.com/search?q=%7Bsearch_term_string%7D
instead:
I have the exact same code as explained in the example, except the site URL of course. What am I doing wrong? Or is this expected behaviour?
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "http://www.example.com/",
"potentialAction": {
"@type": "SearchAction",
"target": "http://www.example.com/search?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>