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,

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 without browsing to 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

Here, we have setup the search mechanism at out another website searching the queries as

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">
   "@context": "",
   "@type": "WebSite",
   "url": "",
   "potentialAction": {
     "@type": "SearchAction",
     "target": "{search_term}",
     "query-input": "required name=search_term"

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

Related :   How to Remove a Website from Google Analytics ?

You can test your above structured data using 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 :

Android Android Commands Android Java Applications Application Libraries Application Stack / User Interface Bash / Shell Scripts Commands and Packages Compilation Content Management System - CMS Core Kernel C Programs Development & Build Development Environment Setup Errors & Failures Flutter git Go Language Programs Hardware Platforms HTML JAVA Programs Kernel & Device Drivers Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Monetization / Google AdSense Multimedia - Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized User Interface Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply / Ask Question