Sitelinks Searchbox

Search users often perform navigational searches using product or brand names. Then, on the product or company website, they perform a second search for specific details. Using sitelinks searchbox markup in your content lets the user perform the second search without leaving the original, navigational search results. See Enhance Your Site’s Attributes for more details.

Sitelinks searchbox in-use

Use Case

Sitelinks searchbox use case
  1. The user searches for Pinterest in Google Search.
Sitelinks searchbox use case
  1. Google Search recognizes markup in the content and presents a sitelinks search box within the search results.
    1. The user searches for Pizza from the sitelinks search box.
Sitelinks searchbox use case
  1. Google Search pulls up results for Pizza on the Pinterest website, or on mobile, within the Pinterest app if it's installed.

Guidelines

In addition to general policies that apply to all structured data markup, these additional guidelines apply to sitelinks searchbox markup.

Site configurations

  • Set a preferred canonical URL for your domain's homepage using the rel="canonical" link element on all variants of the homepage. This helps Google Search choose the correct URL for your markup.
  • You don't need to change your robots.txt settings for the sitelinks search box to work correctly. Follow the Webmaster Guidelines on this topic.
  • Your server must support UTF-8 character encoding.

App configurations

If you want navigational queries to work for users who have installed your Android app, make sure to have the proper intent filters to support the URL you specify in the app target of your markup. For an example of how to create intent filters for Google Search urls, see Firebase App Indexing for Android.

Markup guidelines

  • Add the markup only to the homepage of your site. It is not necessary to repeat the markup in other pages of your site.
  • Specify only one URL search pattern per platform. If you would like to suggest multiple target use cases or other feedback, submit it through the Webmaster Central Help Forum.
  • Always include a search target for your website even if the app is your preferred search target. This strategy ensures that if the user is not searching from an Android phone or does not have your Android app installed, the search result directs to your website.

Examples

The following examples demonstrate how to implement sitelinks searchbox markup on your website using JSON-LD and Mircodata, or on your website and app using JSON-LD.

Site Only (JSON-LD)

Site Only (Microdata)

Site + App (JSON-LD)

Type Definitions

The following table lists the required and recommended properties for sitelinks searchbox markup. These data type definitions are based on those defined at Schema.org.

Properties
url

URL, required

A property of WebSite that specifies the URL of the site being searched. The value of this property must match the canonical URL of your domain's homepage.

potentialAction

SearchAction, required

A property of WebSite indicating a supported action a user might take, in this case a search. Learn more about schema.org Actions.

target

EntryPoint, required

A property of SearchAction that indicates a method for executing the SearchAction. This must be a URL that points to an address on the same domain as the content being searched. It must also include a variable name in braces that is a placeholder for the user's search query. Your server should assume and support UTF-8 values for user search queries. Your Android app should support an ACTION_VIEW intent from Search results, with the corresponding data URI specified in your markup.

query-input

PropertyValueSpecification, required

A property annotation that indicates that the query property of SearchAction is an input for completing the action. The value for the name attribute of the query-input property should match the string that's inside the curly braces in thetarget property.

Send feedback about...