A discussion about adding a search bar to a website’s Google search results page. The original poster, frold, wants to know how to change the layout of their website’s search results on Google to include a search bar. vinothkannans suggests adding code to the <head> tag and configuring site links through Google Webmaster tools.
Joffreyjaffeux provides a code snippet to add to the body of a theme component, which may work, but only Google can decide if it will show. Joffreyjaffeux also suggests making this a default feature, which is met with mixed opinions.
Some users, like 8BIT and hustler, think it’s a great idea, while others, like featheredtoast, think it might not be suitable for private sites. codinghorror is skeptical about the usefulness of this feature, but fefrei argues that people do search for website names.
Frold tries the code snippet and waits for Google to update. Jon_M shares his findings using Google’s Rich Results Test, which shows that some Discourse URLs already have the necessary markup.
It could eventually work, bear in mind, that in the end only google is deciding if this will show or not, so you could add this code and it would do nothing.
It definitely sounds like a pretty cool feature for public sites, but I’d just like to caution that it would look weird on private ones. My preference would be to have it off by default, or have the ability to turn it off for private sites.
AFAICT, the sitelinks generally display in the SERPs when the search terms are more “general”.
For example a search for “Discourse meta” shows sitelinks. But a search for “discourse seo search bar google” will not have them under the link to this topic, nor under the same Discourse meta link after it that had them for the more general search.
Kind of like “give me the table of contents” vs “give me this page”
<link rel="search" type="application/opensearchdescription+xml" href="https://meta.discourse.org/opensearch.xml" title="Discourse Meta Search">
Are people really going to be searching for the name of the site? That seems like a rare edge condition to me, not something we want to add permanent markup for.
Yes, people do this all the time. They do it because they don’t know what a URL is or how to create a bookmark – it’s simply their way to open any website.
I think this is a really good addition and unique point of difference. It highlights the site in search results, it stands more a chance of being used than being absent considering seems like a trivial update to make.