Site Search · Unhead

[Unhead Home](https://unhead.unjs.io/ "Home")

- [Docs](https://unhead.unjs.io/docs/nuxt/head/guides/get-started/overview)
- [Tools](https://unhead.unjs.io/tools)
- [Learn](https://unhead.unjs.io/learn/guides/what-is-capo)

[Releases](https://unhead.unjs.io/releases)

Search…```k`` /`

[Unhead on GitHub](https://github.com/unjs/unhead)

[User Guides](https://unhead.unjs.io/docs/nuxt/head/guides/get-started/overview)

[API](https://unhead.unjs.io/docs/nuxt/head/api/get-started/overview)

[Releases](https://unhead.unjs.io/docs/nuxt/releases/v3)

Nuxt

- [Switch to Nuxt](https://unhead.unjs.io/docs/nuxt/schema-org/guides/recipes/site-search)
- [Switch to TypeScript](https://unhead.unjs.io/docs/typescript/schema-org/guides/recipes/site-search)
- [Switch to Vue](https://unhead.unjs.io/docs/vue/schema-org/guides/recipes/site-search)
- [Switch to React](https://unhead.unjs.io/docs/react/schema-org/guides/recipes/site-search)
- [Switch to Svelte](https://unhead.unjs.io/docs/svelte/schema-org/guides/recipes/site-search)
- [Switch to Solid.js](https://unhead.unjs.io/docs/solid-js/schema-org/guides/recipes/site-search)
- [Switch to Angular](https://unhead.unjs.io/docs/angular/schema-org/guides/recipes/site-search)

v3 (stable)

Schema.org

- [Discord Support](https://discord.com/invite/275MBUBvgP)

- Get Started
  - [Introduction](https://unhead.unjs.io/docs/nuxt/schema-org/guides/get-started/overview)
- Core Concepts
  - [Deduping Nodes](https://unhead.unjs.io/docs/nuxt/schema-org/guides/core-concepts/deduping-nodes)
  - [Supported Nodes](https://unhead.unjs.io/docs/nuxt/schema-org/guides/core-concepts/nodes)
  - [Schema.org Params](https://unhead.unjs.io/docs/nuxt/schema-org/guides/core-concepts/params)
- Recipes
  - [Custom Nodes](https://unhead.unjs.io/docs/nuxt/schema-org/guides/recipes/custom-nodes)
  - [Identity](https://unhead.unjs.io/docs/nuxt/schema-org/guides/recipes/identity)
  - [Blog](https://unhead.unjs.io/docs/nuxt/schema-org/guides/recipes/blog)
  - [Breadcrumbs](https://unhead.unjs.io/docs/nuxt/schema-org/guides/recipes/breadcrumbs)
  - [eCommerce](https://unhead.unjs.io/docs/nuxt/schema-org/guides/recipes/e-commerce)
  - [FAQ](https://unhead.unjs.io/docs/nuxt/schema-org/guides/recipes/faq)
  - [How To](https://unhead.unjs.io/docs/nuxt/schema-org/guides/recipes/how-to)
  - [Site Search](https://unhead.unjs.io/docs/nuxt/schema-org/guides/recipes/site-search)

Recipes

# Site Search

[Copy for LLMs](https://raw.githubusercontent.com/unjs/unhead/refs/heads/main/docs/schema-org/2.guides/4.recipes/site-search.md)

Last updated Jan 19, 2026 by [Harlan Wilton](https://github.com/harlan-zw) in [docs: sync](https://github.com/unjs/unhead/commit/d2f86454774aa60706628b46a850653e1e4d56d9).

On this page

- [Useful Links](#useful-links)
- [Define a Search Action](#define-a-search-action)
- [Define your Search Results Page](#define-your-search-results-page)
- [Related Recipes](#related-recipes)

If your site offers a search function, you may like to define markup to help Google understand it.

## [Useful Links](#useful-links)

- [Sitelinks Searchbox](https://developers.google.com/search/docs/advanced/structured-data/sitelinks-searchbox)
- [SearchAction | Yoast](https://developer.yoast.com/features/schema/pieces/searchaction)

## [Define a Search Action](#define-a-search-action)

To provide a search action for your WebSite, you need to insert a SearchAction in `potentialAction`.

To make configuring this easier, the function `defineSearchAction` is provided.

Make sure that you set place `{search_term_string}` somewhere in your URL. This represents a query a user would be searching for.

This markup should go in your root Schema definition.

```
import { defineSearchAction, defineWebSite, useSchemaOrg } from '#imports'

useSchemaOrg([
  defineWebSite({
    potentialAction: [
      defineSearchAction({
        target: '/search?q={search_term_string}'
      })
    ]
  })
])
```

## [Define your Search Results Page](#define-your-search-results-page)

Using your [WebPage](https://unhead.unjs.io/docs/schema-org/api/schema/webpage) Schema, you can define the page as a search results page.

```
import { defineWebPage, useSchemaOrg } from '#imports'

useSchemaOrg([
  defineWebPage({
    '@type': ['CollectionPage', 'SearchResultsPage'],
  })
])
```

## [Related Recipes](#related-recipes)

- [Setting Up Your Identity](https://unhead.unjs.io/docs/schema-org/guides/recipes/identity) - Define your organization
- [Breadcrumbs](https://unhead.unjs.io/docs/schema-org/guides/recipes/breadcrumbs) - Navigation breadcrumbs
- [eCommerce](https://unhead.unjs.io/docs/schema-org/guides/recipes/e-commerce) - Product structured data

[Edit this page](https://github.com/unjs/unhead/edit/main/docs/schema-org/2.guides/4.recipes/site-search.md)

[Markdown For LLMs](https://raw.githubusercontent.com/unjs/unhead/refs/heads/main/docs/schema-org/2.guides/4.recipes/site-search.md)

Did this page help you?

[How To Add HowTo structured data with defineHowTo(). Enable step-by-step rich snippets with images, supplies, and time estimates.](https://unhead.unjs.io/docs/schema-org/guides/recipes/how-to) [useSchemaOrg() Add Schema.org structured data with useSchemaOrg(). Pass defineArticle(), defineProduct(), and other schema nodes for Google Rich Results.](https://unhead.unjs.io/docs/schema-org/api/composables/use-schema-org)

On this page

- [Useful Links](#useful-links)
- [Define a Search Action](#define-a-search-action)
- [Define your Search Results Page](#define-your-search-results-page)
- [Related Recipes](#related-recipes)

[GitHub](https://github.com/unjs/unhead) [ Discord](https://discord.com/invite/275MBUBvgP)

[ /llms.txt](https://unhead.unjs.io/llms.txt)

[Part of the UnJS ecosystem](https://unjs.io/)

### Head Management

- [Getting Started](https://unhead.unjs.io/docs/nuxt/head/guides/get-started/overview)
- [useHead](https://unhead.unjs.io/docs/nuxt/head/api/composables/use-head)
- [useSeoMeta](https://unhead.unjs.io/docs/nuxt/head/api/composables/use-seo-meta)
- [useHeadSafe](https://unhead.unjs.io/docs/nuxt/head/api/composables/use-head-safe)
- [useScript](https://unhead.unjs.io/docs/nuxt/head/api/composables/use-script)

### Schema.org

- [Getting Started](https://unhead.unjs.io/docs/nuxt/schema-org/guides/get-started/overview)
- [useSchemaOrg](https://unhead.unjs.io/docs/nuxt/schema-org/api/composables/use-schema-org)
- [Nodes](https://unhead.unjs.io/docs/nuxt/schema-org/guides/core-concepts/nodes)
- [Recipes](https://unhead.unjs.io/docs/nuxt/schema-org/guides/recipes/identity)

### Guides

- [Titles](https://unhead.unjs.io/docs/nuxt/head/guides/core-concepts/titles)
- [Streaming SSR](https://unhead.unjs.io/docs/nuxt/head/guides/core-concepts/streaming)
- [DOM Events](https://unhead.unjs.io/docs/nuxt/head/guides/core-concepts/dom-event-handling)
- [Plugins](https://unhead.unjs.io/docs/nuxt/head/guides/plugins/template-params)

### Tools

- [Meta Tag Generator](https://unhead.unjs.io/tools/meta-tag-generator)
- [OG Image Generator](https://unhead.unjs.io/tools/og-image-generator)
- [Schema.org Generator](https://unhead.unjs.io/tools/schema-generator)
- [Capo.js Analyzer](https://unhead.unjs.io/tools/capo-analyzer)

### Articles

- [What is Capo.js?](https://unhead.unjs.io/learn/guides/what-is-capo)

### Research

- [State of <head> in 2026](https://unhead.unjs.io/learn/research/state-of-head-2026)
- [Streaming Head Performance](https://unhead.unjs.io/learn/research/streaming-head-performance)
- [Capo.js Performance Research](https://unhead.unjs.io/learn/research/capo-performance-research)

Copyright © 2025-2026 Harlan Wilton - [MIT License](https://github.com/unjs/unhead/blob/main/license)