b2KIT

Sitelinks Searchbox Schema Generator

Create WebSite structured data with SearchAction for Google sitelinks search box rich result display.

Tested tool guide Tested browser tools Checked August 16, 2026

What Sitelinks Searchbox Schema Generator does, with a checked example

You enter your site name, your homepage URL, and the URL of the page that shows your site's internal search results, and the tool returns a JSON-LD block ready to paste into the page head. It assembles the WebSite structured data Google documents for the sitelinks search box: a SearchAction with a urlTemplate carrying the {search_term_string} placeholder and a matching query-input declaration. The part that surprises most people: this markup only makes you eligible. Google alone decides whether a search box appears under your result, and this schema has no say in which sitelinks links show beneath it.

Worked example

A concrete input and expected output from the current implementation.

Input

Site name: Example
Homepage URL: https://example.com/
Search results URL: https://example.com/search?q=

Expected output

{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "Example",
  "url": "https://example.com/",
  "potentialAction": {
    "@type": "SearchAction",
    "target": {
      "@type": "EntryPoint",
      "urlTemplate": "https://example.com/search?q={search_term_string}"
    },
    "query-input": "required name=search_term_string"
  }
}

The tool appends {search_term_string} to the search results URL, binds that same token in the query-input value, and nests SearchAction inside the WebSite node's potentialAction - the exact structure from Google's documentation, with no extra properties that could trip validation.

How the result is produced

1

From three fields to a script block

The tool reads the site name, homepage, and search results URL, appends the {search_term_string} placeholder to the search URL, then builds the nested structure Google requires: WebSite at the root, its SearchAction in potentialAction, the search endpoint as an EntryPoint, and the query-input declaration. The result is rendered as a JSON-LD script element you can paste into the page head or a template.

2

Keeping the two tokens in sync

The placeholder inside the braces in urlTemplate and the name in query-input must be identical, and the token must correspond to the parameter your search page actually reads. The generator handles that pairing automatically, emits the exact property names Google specifies (potentialAction, urlTemplate, query-input), and uses the schema.org @context so the snippet parses cleanly in Google's Rich Results Test.

Good uses

  • You maintain a site with a working internal search and want sitelinks search box markup added without hand-writing JSON-LD.
  • You are building a template, theme, or CMS site and need a copy-paste script block for the head section.
  • Your existing sitelinks markup failed the Rich Results Test and you need a spec-conformant replacement.

Limits and checks

  • Eligibility is not a guarantee. Google decides whether the box appears and does not publish the criteria; identical markup can produce a search box on one site and nothing on another.
  • The search URL must really work. If the target page ignores the query parameter, requires a login, or is not crawlable, the snippet validates but changes nothing.
  • The schema does not control the sitelinks. The links shown under your result are generated algorithmically from your site's structure; this markup affects only the search box itself.

Common questions

Will this guarantee a search box shows under my site in Google?

No. The markup only makes your site eligible; Google's own documentation says adding structured data does not guarantee appearance. The box shows for relatively few sites, and Google does not publish the deciding factors. The snippet also has no effect on rankings, so treat it as a low-cost eligibility signal, not a fix for search performance.

Can I use a parameter other than q in the search URL?

Yes, any parameter your search page honors will work, as long as the token inside the braces in urlTemplate and the name in query-input stay identical. If you hand-edit one and not the other, the snippet fails validation. Google's examples use search_term_string for both; changing the token in only one place is where hand-edited snippets most often go wrong.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools