Skip to content

Display a search box on Google Search Snippets (Sitelinks Searchbox)

Follows https://gitlab.com/gitlab-com/gitlab-docs/issues/162

What we want

To display a search box on Google Search Snippets for GitLab Docs (docs.gitlab.com), similar to Apple's example here:

apple search box

Google calls this Sitelinks Searchbox.

What we need

  1. A canonical link added dynamically to the <head> (in layouts/head.html) https://gitlab.com/gitlab-com/gitlab-docs/issues/171
  2. Flush Google cache for docs.gitlab.com/index.html, see process: https://support.google.com/webmasters/answer/6065812?hl=en. => done automatically by Google on April 1st.

Why we need this

Not-working example

See https://support.google.com/webmasters/forum/AAAA2Jdx3sUsnB7g_KkQL0/?hl=en for an example of a correct implementation that didn't generate the search box and why:

The Sitelinks Searchbox is triggered algorithmically and depends directly on your site structure, popularity and quality. Even if the code is correctly implemented, Google will only show the box for sites that meet the criteria.

I don't think this is the case for GitLab as we have a popular website and a brand very well established.

Edited by Marcia Ramos