---
title: "Site Search · Unhead"
canonical_url: "https://unhead.unjs.io/docs/nuxt/schema-org/guides/recipes/site-search"
last_updated: "2026-09-17T10:36:28.211Z"
meta:
  description: "Add a SearchAction to WebSite schema with defineSearchAction() and describe your internal search URL template."
  "og:description": "Add a SearchAction to WebSite schema with defineSearchAction() and describe your internal search URL template."
  "og:title": "Site Search · Unhead"
---

Home

`
Unhead on GitHub

Switch to NuxtSwitch to TypeScriptSwitch to VueSwitch to ReactSwitch to SvelteSwitch to Solid.jsSwitch to Angular

**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)

If your site offers a search function, you can describe it with a SearchAction on the WebSite node. [**~~Google removed the sitelinks search box in November 2024~~**](https://developers.google.com/search/blog/2024/10/sitelinks-search-box), so this markup no longer creates that visual feature or affects Google rankings.

## Useful Links

- [**~~Sitelinks search box removal~~**](https://developers.google.com/search/blog/2024/10/sitelinks-search-box)
- [**~~SearchAction - Schema.org~~**](https://schema.org/SearchAction)

## Define a Search Action

Add `**defineSearchAction()**` to the primary WebSite node's `**potentialAction**`. Its URL template must contain `**{search_term_string}**`, which is replaced with the visitor's query.

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

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

## Define your Search Results Page

Set the [**~~WebPage~~**](https://unhead.unjs.io/docs/schema-org/api/schema/webpage) type to `**SearchResultsPage**` for the search results route.

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

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

## 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
- [**~~E-commerce~~**](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(), including steps, images, supplies, tools, and time estimates.](https://unhead.unjs.io/docs/schema-org/guides/recipes/how-to) [**useSchemaOrg()** Add Schema.org structured data with useSchemaOrg(). Pass one or more typed or custom nodes and manage the resulting head entry.](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)