Sitelinks search box schema code Main Directory


<html>
 
<head>
   
<title>The title of the page</title>
   
<script type="application/ld+json">
   
{
     
"@context": "https://schema.org",
     
"@type": "WebSite",
     
"url": "https://www.example.com/",
     
"potentialAction": {
       
"@type": "SearchAction",
       
"target": "https://query.example.com/search?q={search_term_string}",
       
"query-input": "required name=search_term_string"
     
}
   
}
   
</script>
 
</head>
 
<body>
 
</body>
</html>

<div itemscope itemtype="https://schema.org/WebSite">
 
<meta itemprop="url" content="https://www.example.com/"/>
 
<form itemprop="potentialAction" itemscope itemtype="https://schema.org/SearchAction">
   
<meta itemprop="target" content="https://query.example.com/search?q={search_term_string}"/>
   
<input itemprop="query-input" type="text" name="search_term_string" required/>
   
<input type="submit"/>
 
</form>
</div>