# Site search functionality

**URL:** <https://community.hubspot.com/t/site-search-functionality/533>\
**Category:** CMS Development\
**Created:** [December 7, 2016, 6:47am UTC](https://community.hubspot.com/t/site-search-functionality/533 "2016-12-07T06:47:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoisJ](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/loisj/32/86761_2.png) [@LoisJ](https://community.hubspot.com/u/LoisJ)\
**Post date:** [December 7, 2016, 6:47am UTC](https://community.hubspot.com/t/site-search-functionality/533/1 "2016-12-07T06:47:34Z")

</div>

Hi,

I’d be really interested to learn how [hubspot.com](http://hubspot.com) achieves this lovely site search functionality?

 ![search-shot.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/b/bee3d5677a8c6d354e9f7443efa449ac45133e62.png)  
I’m in the process of moving our blog from Wordpress over to HubSpot and so far I haven’t been able to find any documentation on how to offer a search option for visitors. I realise this example is probably custom development, but are there any global modules that would help us achieve a basic free text search of all blog posts? If so, can anyone point me in the direction of the documentation?

Thanks so much.

Lois

---

<div class="post-metadata">

**Author:** ![relabidin](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/relabidin/32/10664_2.png) [@relabidin](https://community.hubspot.com/u/relabidin)\
**Post date:** [December 7, 2016, 2:59pm UTC](https://community.hubspot.com/t/site-search-functionality/533/2 "2016-12-07T14:59:39Z")

</div>

Hi @LoisJ,

The site search function on the HubSpot site was built with a great deal of custom development. However, I did locate a post from our Designers blog on creating custom site search on the COS: [Introducing Site Search](http://designers.hubspot.com/blog/how-to-custom-search-hubspot-cos-website)

Hopefully, this article points you in the right direction, but it would be great to hear from some experienced COS designers/developers on the topic. @stefen @ndwilliams3 do you guys have any input on this?

Rami

---

<div class="post-metadata">

**Author:** ![ndwilliams3](https://avatars.discourse-cdn.com/v4/letter/n/c4cdca/32.png) [@ndwilliams3](https://community.hubspot.com/u/ndwilliams3)\
**Post date:** [December 7, 2016, 6:37pm UTC](https://community.hubspot.com/t/site-search-functionality/533/3 "2016-12-07T18:37:02Z")

</div>

I haven’t really implemented any site search using Google CSE. The post @relabidin provided, looks like a simple implementation that could be handled by anyone with basic Javascript knowledge.

Looking under the hood of the [hubspot.com](http://hubspot.com) site, it appears they are using the CSE API with their own custom callback script to populate a modal window. You could definately create something similar, but you would need a Javascript pro familiar with the CSE api.

---

<div class="post-metadata">

**Author:** ![stefen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stefen/32/29274_2.png) [@stefen](https://community.hubspot.com/u/stefen)\
**Post date:** [December 7, 2016, 7:35pm UTC](https://community.hubspot.com/t/site-search-functionality/533/4 "2016-12-07T19:35:49Z")

</div>

like @ndwilliams3 said… there really isn’t a good turnkey solution available right now. The blog post mentioned by @relabidin is your best bet.

However, I think I know what my next blog post will be about… 🙂

---

<div class="post-metadata">

**Author:** ![LoisJ](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/loisj/32/86761_2.png) [@LoisJ](https://community.hubspot.com/u/LoisJ)\
**Post date:** [December 7, 2016, 10:08pm UTC](https://community.hubspot.com/t/site-search-functionality/533/5 "2016-12-07T22:08:39Z")

</div>

Thank you all for taking the time to respond. I really appreciate your insight.

I’ll look at what we can do with the Google CSE and move on to customising it if we need to.

Cheers,

Lois

---

<div class="post-metadata">

**Author:** ![stefen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stefen/32/29274_2.png) [@stefen](https://community.hubspot.com/u/stefen)\
**Post date:** [December 8, 2016, 3:54pm UTC](https://community.hubspot.com/t/site-search-functionality/533/6 "2016-12-08T15:54:13Z")

</div>

@LoisJ so I created a plugin that takes your sitemap and turns it into search results. Try it out: [GitHub - growwithsms/HubSpot-COS-Site-Search: Turnkey solution for the missing website search module · GitHub](https://github.com/growwithsms/HubSpot-COS-Site-Search)

A live example can be found on our site: [https://www.growwithsms.com/](https://www.growwithsms.com/)

Blog post that goes a little more into the details of how it works and it’s limitations: [https://www.growwithsms.com/blog/hubspot-cos-modal-site-search-plugin](https://www.growwithsms.com/blog/hubspot-cos-modal-site-search-plugin)

Let me know what you think!

---

<div class="post-metadata">

**Author:** ![LoisJ](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/loisj/32/86761_2.png) [@LoisJ](https://community.hubspot.com/u/LoisJ)\
**Post date:** [December 13, 2016, 2:37am UTC](https://community.hubspot.com/t/site-search-functionality/533/7 "2016-12-13T02:37:31Z")

</div>

@stefen that is incredible! Thank you so much!

I’m the marketer here rather than a designer/developer, but I know enough to have been able to install this and get it working on our site. I do have a question though if you don’t mind…on my site, the search overlay seems to sit behind the main navigation and side scroll bar so I lose the box to type the search in as well as the close link. I was able to adjust the positioning of the overlay in the css to bring it down enough to be able to see it all below the nav, but it looks like something in the css also adjusted the positioning of the menu.

I don’t seem to have a scroll bar on the result set at all, unlike the demo running on your site, which means I can’t scroll the results if they go further than the one page - it just scrolls the page in the background.

Can you think of anything obvious I may have done wrong, or overlooked before I get our developer to take a closer look?

Thanks so much!

---

<div class="post-metadata">

**Author:** ![stefen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stefen/32/29274_2.png) [@stefen](https://community.hubspot.com/u/stefen)\
**Post date:** [December 13, 2016, 1:13pm UTC](https://community.hubspot.com/t/site-search-functionality/533/8 "2016-12-13T13:13:56Z")

</div>

@LoisJ it sounds like a z-index issue. I’ve updated the css with a higher z-index and with the fix for scrolling results. Try again with the latest files and see if that helps..

---

<div class="post-metadata">

**Author:** ![LoisJ](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/loisj/32/86761_2.png) [@LoisJ](https://community.hubspot.com/u/LoisJ)\
**Post date:** [December 13, 2016, 10:31pm UTC](https://community.hubspot.com/t/site-search-functionality/533/9 "2016-12-13T22:31:06Z")

</div>

@stefen That worked a treat! Thank you again 🙂

---

<div class="post-metadata">

**Author:** ![Patryk](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/patryk/32/75439_2.png) [@Patryk](https://community.hubspot.com/u/Patryk)\
**Post date:** [December 14, 2016, 12:17am UTC](https://community.hubspot.com/t/site-search-functionality/533/10 "2016-12-14T00:17:25Z")

</div>

I took different approach for search functionality on our website [netguru.co](https://www.netguru.co/blog). (search is in top right corner)

It’s much simplier and requires no external modules - good for start. I described the solution in detail on my blog: [Blog Search in Hubspot COS](https://patrickautomation.com/blog/blog-search-hubspot-cos/)

---

<div class="post-metadata">

**Author:** ![stefen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stefen/32/29274_2.png) [@stefen](https://community.hubspot.com/u/stefen)\
**Post date:** [December 14, 2016, 2:31pm UTC](https://community.hubspot.com/t/site-search-functionality/533/11 "2016-12-14T14:31:06Z")

</div>

Awesome @Patryk! I like your server side implementation. If only HubSpot provided a way to loop through the site pages and landing pages!

---

<div class="post-metadata">

**Author:** ![ThomasReitz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/thomasreitz/32/11188_2.png) [@ThomasReitz](https://community.hubspot.com/u/ThomasReitz)\
**Post date:** [March 16, 2018, 9:49am UTC](https://community.hubspot.com/t/site-search-functionality/533/12 "2018-03-16T09:49:59Z")

</div>

Hi everyone,

we’ve just found out that HubSpots’ Site Search is now in Beta. If you use the new design manager, you can sign up here: [Welcome to the Site Search Beta](https://designers.hubspot.com/content-search-beta)

We’ve been playing around with the feature since yesterday and you can see our first results in our Blog: [https://www.hoppe7.de/blog](https://www.hoppe7.de/blog)

There is also an API-Endpoint for every HS-Portal: DOMAIN/\_hcms/search?term=inbound

Blueleadz has a blogpost about, how they use this for their own Custom Search: [Blog | How to Implement Site Search in HubSpot](https://www.bluleadz.com/blog/3-reasons-why-site-search-is-important-and-how-to-implement-search-in-hubspot)

(which is also the source, how we found out about the Beta-Search)

Best regards

Tom

---

<div class="post-metadata">

**Author:** ![SvenVanbrabant](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/svenvanbrabant/32/13213_2.png) [@SvenVanbrabant](https://community.hubspot.com/u/SvenVanbrabant)\
**Post date:** [March 26, 2018, 10:19am UTC](https://community.hubspot.com/t/site-search-functionality/533/13 "2018-03-26T10:19:57Z")

</div>

Is there any official documentation about the Content Search beta released yet?

---

<div class="post-metadata">

**Author:** ![cdeiulis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cdeiulis/32/9140_2.png) [@cdeiulis](https://community.hubspot.com/u/cdeiulis)\
**Post date:** [April 10, 2018, 6:49pm UTC](https://community.hubspot.com/t/site-search-functionality/533/14 "2018-04-10T18:49:39Z")

</div>

Has anyone conquered this for a global site? We have essentially one domain, but on it runs different subdirectories (e.g. /uk or /au). While the beta search from Hubspot seems to be OK, it would search \*all\* our sites, which would be a terrible user experience. Has anyone gotten around this? With so much content on our site, I"m eager to figure out how to implement search.

---

<div class="post-metadata">

**Author:** ![mcoley](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mcoley/32/84874_2.png) [@mcoley](https://community.hubspot.com/u/mcoley)\
**Post date:** [April 11, 2018, 10:17pm UTC](https://community.hubspot.com/t/site-search-functionality/533/15 "2018-04-11T22:17:22Z")

</div>

I’ll add this functionality tomorrow so you can filter search results by path.

---

<div class="post-metadata">

**Author:** ![SvenVanbrabant](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/svenvanbrabant/32/13213_2.png) [@SvenVanbrabant](https://community.hubspot.com/u/SvenVanbrabant)\
**Post date:** [April 12, 2018, 10:54am UTC](https://community.hubspot.com/t/site-search-functionality/533/16 "2018-04-12T10:54:16Z")

</div>

Filter search results based on domain name would be very handy for Enterprise users.

---

<div class="post-metadata">

**Author:** ![mcoley](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mcoley/32/84874_2.png) [@mcoley](https://community.hubspot.com/u/mcoley)\
**Post date:** [April 12, 2018, 2:17pm UTC](https://community.hubspot.com/t/site-search-functionality/533/17 "2018-04-12T14:17:43Z")

</div>

This can already be done two ways. You can use `[www.domain.com/\_hcms/search?term=](http://www.domain.com/_hcms/search?term=)` which will only search content under `[www.domain.com](http://www.domain.com)`. If you would like to search a subdomain, you can use `[www.sub.domain.com/](http://www.sub.domain.com/)\_hcms/search?term=`. If you wish to use the API to search multiple subdomains in your portal: `[www.api.hubapi.com/contentsearch/v2/search?portalId=&domain=&domain=&term=](http://www.api.hubapi.com/contentsearch/v2/search?portalId=&domain=&domain=&term=)`. We’re are working on getting all these options documented publicly on [2026-03 API reference - HubSpot docs](https://developers.hubspot.com/docs/overview).

---

<div class="post-metadata">

**Author:** ![cdeiulis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cdeiulis/32/9140_2.png) [@cdeiulis](https://community.hubspot.com/u/cdeiulis)\
**Post date:** [April 12, 2018, 2:19pm UTC](https://community.hubspot.com/t/site-search-functionality/533/18 "2018-04-12T14:19:23Z")

</div>

Thanks for the response! We have subdirectories, not subdomains (e.g. /uk or /au off of our main domain not [mainsite.uk.com](http://mainsite.uk.com) or [mainsite.au.com](http://mainsite.au.com)). Does this functionality work the same as with subdomains?

---

<div class="post-metadata">

**Author:** ![mcoley](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mcoley/32/84874_2.png) [@mcoley](https://community.hubspot.com/u/mcoley)\
**Post date:** [April 12, 2018, 6:51pm UTC](https://community.hubspot.com/t/site-search-functionality/533/19 "2018-04-12T18:51:52Z")

</div>

You can now add a `pathPrefix=` query param to filter results by path prefix. `[https://www.hubspot.com/\_hcms/search?term=hubspot&minScore=0&pathPrefix=services](https://www.hubspot.com/_hcms/search?term=hubspot&minScore=0&pathPrefix=services)` as an example to only return results that match `hubspot.com/services\*`. This requries a reindex of portals, so may take up to 24 hours to be available for your portal.

---

<div class="post-metadata">

**Author:** ![vonTrapp](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/vontrapp/32/37202_2.png) [@vonTrapp](https://community.hubspot.com/u/vonTrapp)\
**Post date:** [August 21, 2018, 12:13pm UTC](https://community.hubspot.com/t/site-search-functionality/533/20 "2018-08-21T12:13:24Z")

</div>

Hi @mcoley, The pathPrefix parameter sounds very useful to me. Where is this variable entered? In the Site Search Input module or Site Search Results module? In the snippet, JS or elsewhere?

How do I configure a sub folder such as /en/app/services instead of only /services ?

[Next page](https://community.hubspot.com/t/site-search-functionality/533.md?page=2)
