WordPress for beginners:

Google’s Sitelinks Searchbox, with or without Yoast SEO

Google sitelinks searchbox
An example of a Sitelinks Searchbox

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:

  1. 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.

  2. 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.

  3. 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:

A screenshot of the Sitelinks Searchbox report in Google Search Console showing 1.5k URLs without errors.

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!


20 Responses to Google’s Sitelinks Searchbox, with or without Yoast SEO

  1. Johan Terve
    Johan Terve  • 4 years ago

    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?

  2. Jyoti
    Jyoti  • 4 years ago

    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.

  3. Laurie Shertz
    Laurie Shertz  • 4 years ago

    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.

    • Edwin Toonen

      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.

  4. Stefan Drew
    Stefan Drew  • 4 years ago

    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!

    • Edwin Toonen

      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!

  5. pio
    pio  • 4 years ago

    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.

    • Edwin Toonen

      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!

  6. Florin Moraru
    Florin Moraru  • 4 years ago

    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.

    • Edwin Toonen

      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!

  7. Andreas Diehl
    Andreas Diehl  • 4 years ago

    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?

    • Edwin Toonen

      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.

  8. Carin Bosman
    Carin Bosman  • 4 years ago

    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?

    • Edwin Toonen

      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.

    • Larry Maguire
      Larry Maguire  • 4 years ago

      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..

      • Edwin Toonen

        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.

  9. Umair Ahmad
    Umair Ahmad  • 4 years ago

    So all these are just what I need to do or set for me to get my site link showing for my website?

    • Edwin Toonen

      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.

  10. Rushabh
    Rushabh  • 4 years ago

    Oh! Thanks for sharing this information. I was thinking site links are added by Google. We’ll do it the way you suggested here.

  11. Asif Shaik
    Asif Shaik  • 4 years ago

    My website has only 10 pages. Is search box required for my website.