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:
Google calls this Sitelinks Searchbox.
What we need
-
A canonical link added dynamically to the <head>
(inlayouts/head.html
) https://gitlab.com/gitlab-com/gitlab-docs/issues/171 -
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
- The implementation introduced by !191 (merged) and !190 (merged) is correct: https://developers.google.com/search/docs/data-types/sitelinks-searchbox, but we need to add a canonical URL to the
<head>
- From https://gitlab.com/gitlab-com/gitlab-docs/issues/162, to enable the search bar on google search snippets we need to flush the cache and wait.
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