Search code examples
seosearch-enginegoogle-searchschema.orgjson-ld

Enabling Google Sitelinks Search Box?


I'm trying to enable Google Sitelinks Search Box.
It's something which allows you to display directly a "search textbox" in Google : https://developers.google.com/structured-data/slsb-overview

I've added it to the website the 27 July, using the JSON-LD syntax. According to Google, the currently cached version of website is the one of the 6 August (so a long time after deployment), but the search textbox has never appeared in Google.

<script type="application/ld+json">   
{     
"@context": "http://schema.org",     
"@type": "WebSite",     
"url": "https://fr.blabla.com/",     
"potentialAction":
{       
"@type": "SearchAction",       
"target": "https://fr.blabla.com/acheter/{search_term_string}?page=1",       
"query-input": "required name=search_term_string"
}   
}   
</script>

Sorry, I can't disclose the real URL. On the screenshot, the subdomain and the end of the URL are the real ones, the website is in HTTPS.

The "search engine" URL works fine if I call it directly.
The code is located in the head HTML segment of my page (it's not easy to test to move it, the website is a huge e-commerce platform and I can't test anything as I would).

The Google test tool (https://developers.google.com/structured-data/testing-tool/) seems to validate my code: https://i.sstatic.net/PyYpL.jpg

I found another website (type "cdiscount" in Google) which use it exactly like me and it looks like to work for them. The only differences I notice is they are not in HTTPS, their subdomain is www and their <script> tag is somewhere in the body.


Solution

  • There's two thing to consider here...

    1. It can take Google a while to implement your code. I've seen it take a couple of months.

    2. Adding sitelinks in the SERPs is at Google's discretion so having the code in your site is not a guarantee they will show sitelinks for the site.

    So I'm afraid it's now a waiting game.

    Good luck.