问题原文
原帖链接 · emeksc1 · CC BY-SA 4.0
I added the JSON-LD code to my site but search bar did not appear. What is the reason for this? am i doing something wrong?
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"url": "https://www.example.com/",
"potentialAction": {
"@type": "SearchAction",
"target": "https://www.example.com/search?term={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
已采纳解答
原帖链接 · Maximillian Laumeister · CC BY-SA 4.0
Google only displays the sitelinks search box for your domain if they feel like it, even if your markup is well-formed.
From Google's guidelines for searchbox structured data:
Important: Google doesn't guarantee that a sitelinks search box will be shown in search results. Additionally, using the sitelinks search box markup doesn't make it more likely that a sitelinks search box will be shown. For a list of common reasons why Google may not show structured data in search results, review the General Structured Data Guidelines.
If you've implemented the markup, the only thing left to do is wait and hope, and maybe improve your site's SEO in a very general sense.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
