-->

Using sitelinks search bar google

2019-05-19 07:04发布

问题:

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:

  1. The search bar hasn't appeared in the search results for my website.
  2. 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>

回答1:

It looks like you are searching incorrectly, search for either example or example.com instead:

According to this a large number of searches are needed before google will display it - moz.com states that:

Does your site receive a high volume of navigational or branded search traffic?
For example, keyword phrases such as 'moz' and 'moz.com' send this website thousands of visits per week. Branded and navigational search volume is a good, but not perfect, indicator of the likeliness of the sitelinks search box to appear.