Google just added a cool new feature to its search results. If you search for a company by name, Google is now displaying a search box to search that site within your site.
You can see what it looks like by searching google for ebay here, or by clicking on the image on the right to zoom in.
This feature was added a couple of weeks ago, and is very handy from an SEO perspective. Mainly because it increases your search page real estate when someone searches for your company by name. It also might help the visitor find what they are looking for on your site more easily.
Either way it’s a cool new feature that you might want to implement on your site.
Here’s the code to add google site search (in google’s search results) to your site.
This code will work for any wordpress site if you replace viwickam.com with your domain name. If you aren’t running wordpress, make sure you replace the target URL with the actual search url for your site, and what the query variable is for the platform you are using.
This code should be placed in the head section of your website (somewhere between <head> and </head>. If you are using wordpress, you can add this to the wp_head() hook. And as a bonus, if you are using a Genesis Child Theme, you can past the code into the wp_head() section on the genesis Theme settings.
<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "WebSite", "url": "https://www.viwickam.com/", "potentialAction": { "@type": "SearchAction", "target": "https://www.viwickam.com/?s={search_term_string}", "query-input": "required name=search_term_string" } } </script>
David East
How much of a delay is there before the change can be seen?
Vi Wickam
I can’t say for sure. It all depends on when google indexes it and decides to start showing it. As of yet, Google doesn’t have a way to submit your site for sitelinks search, or to validate that your sitelinks search code is valid.
Pe Jung Labs
I have entered the code 5 months ago until now it does not appear, I have tested it with Google structured data and there are no errors. Are there any suggestions for that? Or maybe there is a technique to quickly get a searchbox.
Vi Wickam
Adding the search box code is supposed to help google add it to the search results, but only google can choose whether your site has enough clout to serve the search box. My guess is that it relates to how many times people try to do site searches on your site using google.
Lincoln Borges
You can implement this, but only Google can decide if will display the search box or not.
It’s not something you can control.
Vi Wickam
That is correct, Lincoln. Adding the code should help Google understand your site better, but only Google decides whether your site shows up with site search. I’m guessing that Google decides based on the frequency of people searching google for site-search style queries with your site or company name referenced, but to my knowledge, they haven’t released a statement as to how they make this decision.
vinay
I am adding Same code but my search bar does not display in google search results
template.net
If anyone helps to resolve it a great help to me.
Thank you
Vi Wickam
Hi Vinay, Having the code gives google the information that they need to adds the search box, but it doesn’t guarantee that they will. Google will decide on your site whether it thinks you site is big enough to warrant it. My best guess is that it does this based on how many times people use google to search within your site.