Skip to content
This page is also available as markdown at /docs/public-docs/site-search.md. For the complete documentation index, see llms.txt.
Get started

Site search

How visitors search your published site, and how to control which pages search can see.

Every published site has a search box in its header. It searches an index of the published build, so results never include drafts or private pages.

Visitors open search from the header or with Cmd+K (Ctrl+K on Windows), then type at least two characters. Each result shows the page title and description, and clicking one opens the page.

The site search dialog with results for a query

Search reads from the index of the build you published. Indexing runs right after each build, and a build shows Indexed when it’s ready. If you publish a build before indexing finishes, search keeps answering from the previously indexed build until it completes. See Build status.

ToDo this
Keep a page out of the site entirelyMark it private. See Private and hidden.
Build a page but leave it out of searchSet pagefind: false in its frontmatter, or hide it from navigation.
Limit who can search at allTurn on password protection. Search sits behind the same password as the pages.

Site search is separate from search engines. Allow search engines in Search and sharing controls whether Google and others index the site, and doesn’t affect the site’s own search box.