schema.org WebSite markup with optional SearchAction sitelinks-search-box.
Use {search_term_string} as the placeholder. Leave the placeholder out to skip SearchAction.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "Acme Inc",
"url": "https://example.com",
"description": "Short site description.",
"inLanguage": "en",
"potentialAction": {
"@type": "SearchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "https://example.com/search?q={search_term_string}"
},
"query-input": "required name=search_term_string"
}
}
</script>