WebSite schema with a SearchAction is the structured-data markup that tells Google your site has its own internal search — and, when eligible, lets Google render a search box directly in your search result so users can query your site without leaving the results page. It also gives search engines and AI systems a clean, machine-readable statement of your site's name and its search endpoint, which helps them understand your site as a coherent entity. If you have on-site search, this is a small, high-leverage piece of markup to add.

What WebSite schema and SearchAction do

The WebSite type describes your site as a whole: its URL and its official name. Nested inside it, a potentialAction of type SearchAction declares the URL pattern that runs a search on your site, with a placeholder for the query term. Together they express two useful facts to machines: "this is the canonical name of this website" and "this is how you search it." The first feeds the name that can appear as your site title; the second is what powers the Sitelinks Search Box treatment when Google chooses to show it.

It is important to be realistic: Google decides whether to display the search box, and it appears far less often than it used to, typically only for strong, well-known brand queries. So do not add this markup expecting a guaranteed rich result. Add it because it is a low-cost, correct signal about your site's identity and functionality that both search and AI can use — the visible search box is a bonus, not the main return.

How to implement it

Place a single WebSite JSON-LD block on your homepage — not on every page. Include the site URL, the site name, and the potentialAction. The SearchAction needs a target URL template containing a {search_term_string} token where the query goes, and a query-input that names that token as required. In practice the target looks like your real search URL with the query parameter replaced by the token, for example https://example.com/search?q={search_term_string}.

Why it helps AI understand your site

AI answer engines work by resolving content to entities — mapping pages to the organizations and sites that own them. A clean WebSite block gives them an unambiguous anchor: the canonical name and home URL of your property, stated in the format machines parse most reliably. This reinforces the same identity you build through entity SEO and the knowledge graph, and it pairs naturally with your other JSON-LD. When your site's name, search endpoint, and organization details all agree across your structured data, you present one confident entity that AI systems can cite by name rather than a vague URL. For the fundamentals of writing correct markup, see our practical guide to JSON-LD and Schema.org.

A note on your internal search pages

Enabling the Sitelinks Search Box does not mean you should let search engines index the result pages it generates. Those are typically low-value, near-infinite URLs that waste crawl budget — you generally want to noindex internal search result pages while still exposing the search functionality through this markup. The SearchAction describes the capability; it does not invite crawlers to index every possible query URL. Keep the two concerns separate: advertise that search exists, but keep its output pages out of the index.

Want to confirm your homepage exposes clean, valid WebSite and Organization markup that AI can read — and that your search result pages aren't leaking into the index? Run your site through the CheckMy.site scanner and act on what it flags.