Skip to main content

Google Sitelinks Searchbox

You can enable users to search your website directly from Google search results using Google's Sitelinks Searchbox.

google sitelinks searchbox github

Add the following script to your home page. Next time Google crawls your site it will interpret the script and show the Sitelinks Searchbox:

<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "https://example.com/",
"potentialAction": {
"@type": "SearchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "https://example.com/search?ss360Query={search_term_string}"
},
"query-input": "required name=search_term_string"
}
}
</script>
  1. Replace https://example.com/ with your website URL and update the target parameter to match your search URL pattern.
  2. Make sure the query parameter name matches results.searchQueryParamName in your ss360Config — the default is ss360Query.

To test, replace search_term_string with a test query and open the URL in a browser. For example: https://www.site.com/search/?ss360Query=pizza