Google’s Sitelinks Searchbox, with or without Yoast SEO
A couple of years ago, Google introduced the Sitelinks Searchbox. When activated, this search box appears under the main URL for a given brand in the search results, above its sitelinks, hence the name. When you search for that brand in Google, you can directly use the site’s search engine. The results will be presented on the search results page of the relevant site.
How to add a Sitelinks Searchbox to your site
It’s not that difficult to make your site eligible for a Sitelinks Searchbox. The process consists of just three steps, and if you are a Yoast SEO user, it is even easier. This process takes care of the technical side, but, in the end, Google determines if your site gets a Searchbox. To be honest: Google does not show this Sitelinks Searchbox for most sites. So, let’s run through the required steps:
- Verify you have a functioning search engine
For 99.5% of WordPress sites, this one is simple: you type example.com/?s=query (replacing example.com with your site’s URL and query with the query of your choice), and you should see search results. If you don’t see search, and you’ve not made a conscious decision to move your search engine elsewhere, you might need to fix your theme.
- Add the necessary markup (Yoast SEO does this automatically)
Adding the markup is simple if you’re on WordPress and use Yoast SEO. In that case, all the necessary code will be added automatically. There are exceptions of course: It could be that you don’t use the default search engine, in that case, you’ll need to change the URL using the built-in filter.
If you don’t use Yoast SEO, you can add the necessary code by hand via a piece of Schema.org structured data. The screenshot below shows a piece of example code from Google’s documentation, in this same document you’ll also find the requirements for a valid technical implementation. This uses JSON-LD to mark up the code in an efficient and readable way. - Set up a preferred canonical URL for your homepage (Yoast SEO does this automatically)
Step three, and again, this one is easy. Google uses the canonical to determine the correct URL for your site. When you use Yoast SEO, this canonical will automatically be set for you. If you want — or need — to do it by hand, you can read up on canonical URL’s in our ultimate guide to rel=canonical.
When you have done all of this and Google deems your site eligible, you might see something like the example above in the search results.
Check the Sitelinks Searchbox results in Google Search Console
A few days after enabling this you should have a Sitelinks searchbox report in Google Search Console. For those of you who have had Yoast SEO for a while, this report should already be there. If there are errors in that report, find out what they are and fix them. If not it’ll look something like this:
Check the Rich Results Testing Tool
Using Google’s Rich Results Testing Tool, you can see if your site is eligible for rich results. Simply open the tool, enter the URL and run the test. Google shows a report like the one below. In this case, it correctly discovers a sitelinks searchbox on our site.
Conclusion
As said before, it is not too hard to get your site ready for a Sitelinks Searchbox. If you use our Yoast SEO plugin, the necessary code is already built in. Now you just have to wait and see if Google deems your site eligible and shows a search box.
Read more: Structured data with Schema.org: the ultimate guide »
WordPress for beginners series
Coming up next!
-
Event
WordCamp Netherlands 2024
November 29 - 30, 2024 Team Yoast is at Sponsoring WordCamp Netherlands 2024! Click through to see who will be there, what we will do, and more! See where you can find us next » -
SEO webinar
The SEO update by Yoast - October & November 2024 Edition
26 November 2024 Get expert analysis on the latest SEO news developments with Carolyn Shelby and Alex Moss. Join our upcoming update! 📺️ All Yoast SEO webinars »
Everything is setup correctly and verified, but I still don’t get the searchbox when performing searches. Is this ok i.e. Google decides from time to time weather they should show the search box or not?
Great content. I have been using Yoast SEO since last 5 years and doesn’t find a better alternative to it. My website is also showing 1K site searches in web search console.
I agree with the other commenters: what steps do I need to implement to have #2&3 above work properly? Linking to purchasing Yoast when I already own & use it is helpful. Your articles are generally clear & helpful. This one raises an issue & does not tell me how I (or Yoast) can implement a solution.
Hi Laurie. I’m sorry the article wasn’t clear. I’ve updated it. If you’re running Yoast SEO and your site search is running correctly, you should be good to go.
The article says, “ Adding the markup is simple if you’re on WordPress and use Yoast SEO” but doesn’t explain how to do it.
What settings are needed? Is it automatic?
Help!
Hi Stefan. Yeah, there was an important line missing. Yoast SEO automatically add all necessary code to make your searchboxes eligible for Google. Sorry about the confusion!
To be honest.
I did not get the point. I still do not know what to do after reading the article 3 times. My wish: a proper how to. Step by step.
Hi Pio. Here are the steps:
– Verify that your site search is functioning properly
– Install Yoast SEO (if you haven’t done that already)
– All necessary code will be added automatically
– After some time, check in Google’s testing tools to see if your site is eligible
Hope that helps!
Would you please explain more step 2 ? (how to add exactly the markup)
(We have Yoast Premium)
Thank you very much in advance, I appreciate.
Hi Florin. Yoast SEO automatically adds the necessary code, so you should be good to go. Please check in Google’s testing tools (see the updated article) to see if your searchbox has been found eligible. Good luck!
Thanks.
What is not clear to me yet, how does the Yoast plugin support to add relevant necessary markup for the search box?
Is that done without any further action? So if my site has a search the necessary markup is added automatically? Or is there. a particular setting in the plugin (which I am not aware of?
Hi Andreas. Sorry for the confusion. The Yoast SEO plugin automatically adds all code. So if your site search is functioning you should be fine. Check Google’s Rich Results Testing Tool to see if your site is eligible for a sitelinks searchbox.
Step 3 makes no sense whatsoever – why would you want to do that, and where is the canonical url for the homepage supposed to point to?
Hi Carin. Sorry for the confusion. I’ve updated the article to make it more clear. Google needs the canonical URL to correctly say which URL can get the searchlinks. Yoast SEO automatically adds both the canonical URL and all the necessary code for the sitelinks searchbox to be eligible. After that, Google will determine if it shows a searchbox for your site.
I thought my intellect had deserted me…I couldn’t make sense of the above at all. Seems like there is a big chunk of detail missing about how Yoast makes things happen. Where’s the setting for this feature? Is it a paid or free feature,
Thanks..
Hi Larry. Sorry for the confusion. Indeed, some parts of content were missing. I’ve updated the article. To answer your questions:
– This feature is available for free in all versions of Yoast SEO
– There are no settings, as Yoast SEO automatically adds everything Google needs to determine if your site is eligible.
So all these are just what I need to do or set for me to get my site link showing for my website?
Yes, if your site search is working properly you just need to install Yoast SEO and you’re good to go. Please remember, sitelinks searchboxes don’t appear for every site — Google determines what shows and what not.
Oh! Thanks for sharing this information. I was thinking site links are added by Google. We’ll do it the way you suggested here.
My website has only 10 pages. Is search box required for my website.