How to add search box in websites google search results using “Sitelinks Searchbox” ?

Have you ever seen, for some websites we seen a search box appearing inside google search results like as below,

SiteLink

Above is just an example to demo, how the search box inside google search results looks like, when you searched “pinterest” in google and you can see an another search box appearing in google search results, which allows users to type another search text, as seen where user can type “pizza” which will actually search for text “pizza” only on pinterest.com without browsing to pinterest.com website and then going to search.

Google Search can expose a search box scoped to your website when it appears as a search result. This search box is powered by Google Search. However, if you wish to power this search box with your own search engine, or if you want search results also to include an associated mobile app, you can do so using structured data embedded on your website.

To implement this feature, you will need following things,

  • Access to edit source code of your websites home page
  • Properly setup search mechanism on your website, if you don’t have setup search mechanism in your website, you can setup the same using “google custom search engine
Related :   How to fix: Your connection to this site is not fully secure in Chrome, Firefox OR any other browsers

Here, we have setup the search mechanism at out another website searching the queries as https://www.greenecosystem.in/results.html?q=Biodiversity

Copy the below code and paste it into your website home page as, Note: This code needs to be pasted only on home page and not on any other page, and in “head” html tag.

<script type="application/ld+json"&gt;
{
   "@context": "https://schema.org",
   "@type": "WebSite",
   "url": "https://www.your_website.com/",
   "potentialAction": {
     "@type": "SearchAction",
     "target": "https://www.your_website.com/results.html?q={search_term}",
     "query-input": "required name=search_term"
   }
}
</script>

In the above link, change “your_website.com” to actual link of your website.

You can test your above structured data using https://search.google.com/structured-data/testing-tool after editing the home page and then enter the home page url to this tool and it should show “0 Errors, 0 Warnings”

More reference : https://developers.google.com/search/docs/data-types/sitelinks-searchbox


lynxbee_ezoic

Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )

   


Leave a Comment

Android Android Build system Android Commands Android Java Applications Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto / Bitbake / Openembedded