Let visitors search across your site.
Site search lets you add search to your site so your visitors can find the information they’re looking for. If needed, you can exclude the content of specific elements, pages, and even entire Collections, all with a tick of a checkbox. Site search is available on all sites with CMS Site plans or above.
ImportantSite search does not crawl or index search terms within custom code snippets, or return results related to search terms within custom code snippets. Additionally, site search does not index content that is only accessible with a User Account. If you need custom code content to be indexed, please use a third-party search tool.
NoteSite search displays results from the currently selected locale. If a site visitor searches for content on your site from a locale where that content doesn’t exist, site search returns a “No matching results” message.
Site search element
You can add the site search element from the Add panel. The search element includes:
-
Search (wrapper) — the parent element that contains the search form and submit button
-
Search input — where site visitors type their search
-
Submit button — a button to submit the search, which you can hide if you’d like an “Enter” key press to submit the search
Once you add site search to your site, you can style it the same way you style any other element. You can also customize the placeholder text and set the search bar to autofocus, which automatically places visitors’ cursors in the search field on page load.
Search results page
Once you add site search to your site, you’ll see the Search results page appear in Pages panel > Utility pages.
The Search results page contains an initial structure including a container element and a search element, along with a list of results, which you can style like a Collection list.
Need to know
Sites without a Site plan or a Basic Site plan will show sample search results on your published site — which you can show to clients to give them a sense of how their search experience will look. To see real search results, you’ll need to add a CMS Site plan or higher to your site.
Search results structure
Search results have a preliminary structure including:
-
Search title (link) — the title for that page, pulled from whatever you’ve set as the Search result title in the Search section of that page’s Page settings. This title acts as a link to that page by default. For Collection pages, this content can be pulled from any field. You can also pull in content from the SEO description and the Open Graph image.
-
Page URL (text block) — the page slug
-
Snippet (paragraph) — the context from the page where the searched term appears. You can choose to connect this paragraph to a custom description, which you can set in that page’s Page settings. You can also set the snippet length (number of characters) and turn on highlighting (which bolds appearances of the search term within the snippet) by going to the Search Result wrapper element settings.
Empty state
Your Search Results page has a “no results” state for when users search for something that isn’t available on your site. To customize the design of the “no results” state, toggle No results “on” in your Search Results wrapper element settings.
Setting result count
You can choose how many results you’d like to display on your search results by going to Search Results wrapper element settings > Results length. You can choose up to 60 search results to display.
NoteSupport for pagination across multiple search results pages is not yet available.
Previewing search results
As you style your search results, you can adjust the displayed results by changing the search term in Search Result wrapper element settings > Preview results. Then you can view how your search results appear for different queries. Note that until you add a CMS or Business Site plan and publish your site, you’ll receive sample results — not real results from your site. To preview and style real search results, publish your site to create a search index.
Additional site search settings
You can use the search description field in that page’s Page settings to add additional information to your search results. For example, say you want to show visitors what type of content a specific search result is by displaying a blog post category alongside the result. Add your category name to the search description field, then connect a text field in your search results to the search description field.
You can also set a search image in a page’s Page settings. Once you’ve set a search image, you can add this image to your search results by connecting an image element to the search image field.
Indexing
An index includes the content and pages in your site search engine. This controls what content people can search through when they submit a search on your site. If you don’t want a specific page to be discoverable through search, you can remove it from your index.
Sites are limited to one site search engine. You can have a search bar on as many pages as you’d like, but they’ll all search across the same content.
How to create an index
Once you've added a CMS Site plan or higher, your search index is created after you publish your site for the first time.
How to update your index
There are two ways to update your index so the content in search results matches the latest updates to your site content:
- Manual reindexing
- Automatic reindexing
Manual reindexing
Manual reindexing lets you deliberately refresh the content in your search engine. This is best for when you’ve pushed important updates to your content, or made extensive changes to the content of your search engine. On the CMS Site plan, manual reindexing is available once every 24 hours. On the Business Site plan, manual reindexing is available every 12 hours.
To manually reindex your site, first publish your site. Then, go to Settings panel > Search and click Index now. Indexing can take up to 24 hours on large sites. To check on the status of your index, go to Settings panel > Search.
If you make a major content change and need your site reindexed immediately, please contact Support, who can reindex for you as a one-time courtesy.
Automatic reindexing
On an ongoing basis, we’ll update your search index to keep the content in your search engine up to date with the latest changes to your site. On the CMS Site plan, automatic reindexing takes place 72 hours after full-site publish. On the Business Site plan automatic reindexing takes place 12 hours after full-site publish. Single item publishing CMS items does not trigger automatic reindexing — a full-site publish is required.
Refining your search index
By default, everything on your site (excluding components, randomized Collection lists, utility pages, and password-protected content) is indexed when you add site search, so visitors can discover this content when they search your site. In most cases, you’ll want to refine your index to exercise more control over what visitors can discover through search.
Excluding static pages
To exclude a static page from search, go to Page settings > Site search settings and check “Exclude this page from site search results.” Once checked, a reindex will remove this page from your index.
Excluding Collection pages
To exclude a Collection pages from search, go to Page settings > Site search settings, check “Exclude this page from site search results,” and Save your changes. Then, a reindex will remove this page from your index.
Excluding a Collection page excludes all template pages from search results, but any appearances of this Collection’s content in Collection lists (excluding randomized Collection lists) on other pages will still be discoverable, as they’ll be indexed from that page’s content. In this case, you may want to apply element-level exclusion for those Collection lists.
NoteIt's not possible to exclude individual Collection items from search.
Excluding elements
It’s a good idea to exclude recurring elements (such as navbars, footers, and forms) from search because they appear across your site and can “muddy up” your search results. (For example, if a person searches for “Blog posts” but the word “Blog posts” is in your navigation, every page on your site would be considered relevant for that search.)
For this reason, components and randomized Collection lists are excluded from search results by default. You can override this setting on the main component if needed.
To exclude specific elements, go to the Element’s settings > Search index settings and check “Exclude content from site search results.”
Any exclusion rules set on a parent element also apply to children elements.
Frequently asked questions
What happens with search if I export my code?
Site search does not work on exported sites.
How can I see what users are searching for?
To see what your site visitors are searching for, integrate your Webflow site search with Google Analytics.