Skip to main content
All CollectionsSEO Support
Search box in your Google Search Results
Search box in your Google Search Results

Learn how to encourage Google to add a search field in your Google search results listing.

Niall Diamond avatar
Written by Niall Diamond
Updated over 6 years ago

Have you seen those sites that have a Search bar field that is displayed right within the Google Search Results. This is called Sitelink Searchbox from Google. 

Now with a simple copy/paste, you can encourage Google to add one for your website as well. This is all thanks to EvolutionX and its powerful search. 

🔥 Awesome!!

Copy & Paste into your Theme Footer block

<script>
if ( window.location.pathname == '/' ){
    // Index (home) page


  var searchJSLD = document.createElement('script');
  searchJSLD.type = 'application/ld+json';
  searchJSLD.text = JSON.stringify({
    "@context": "http://schema.org",
    "@type": "WebSite",
    "url": "https://" + window.location.hostname,
    "potentialAction": {
    "@type": "SearchAction",
    "target": "https://" + window.location.hostname + "/search?query={search_term_string}" ,
    "query-input": "required name=search_term_string" }
  });
  document.querySelector('body').appendChild(searchJSLD);


} else {
    // Other page, do nothing
    }
</script>

🔥 Pretty Awesome Right! 🔥

___________________

Test it

  • Enter in your homepage URL (This code only exists on your homepage)

Your results should look like the below

Did this answer your question?