XooCode(){

SearchAction

SearchAction is the property-level type behind the sitelinks-searchbox rich result. Property: query (Text). Most production markup uses SearchAction as WebSite.potentialAction with a target EntryPoint; this reference page covers the raw type.

Full example of schema.org/SearchAction json-ld markup

The markup is verified as valid with Rich Results Test from Google.

schema.org/SearchAction
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "url": "https://xoocode.com",
  "potentialAction": {
    "@type": "SearchAction",
    "target": {
      "@type": "EntryPoint",
      "urlTemplate": "https://xoocode.com/search?q={search_term_string}"
    },
    "query-input": "required name=search_term_string"
  }
}
</script>

Minimal valid version

The smallest markup that still produces a valid SearchAction entity. Use it as the floor. Reach for the advanced example above when you want search engines and AI agents to understand more about your content.

schema.org/SearchAction (minimal)
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "SearchAction",
  "target": "https://example.com/search?q={q}",
  "query-input": "required name=q"
}
</script>

Google rich results this unlocks

SearchAction is a structural type. It does not produce a rich result on its own.

Its value comes from combining it with a primary type whose markup earns a rich result (Article, Product, Event, and so on). SearchAction becomes the trunk that the primary type branches off viamainEntityorbreadcrumb. Include it on every page as the backbone of your markup.

Common SearchAction mistakes

Mistakes that pass validation but silently fail to earn rich results or mislead consumers walking the graph. Avoid these and your markup will be ahead of most sites in the wild.

  1. 01

    query-input with an optional binding

    Wrong
    "query-input": "optional name=q"
    Right
    "query-input": "required name=q"

    Google's searchbox requires the binding to be required.

Also mentioned in 4 other examples

SearchAction also appears in PropertyValueSpecification, SearchAction, Thing, and WebSite. See the full SearchAction schema page for every reference.

About the example data

Xoo Code's sitelinks searchbox entry.

Comments

Loading comments...

Leave a comment