Search Integration
- Introduction
- Requirements
- Enabling search integration
- How indexing works
- Frontend search behavior
- Customizing the search widget
- Limitations and caveats
Note: This functionality is part of Staatic Premium Edition and requires an active subscription. Connect your Staatic account before enabling search.
Introduction
Staatic Search provides a dynamic backend and frontend autocomplete widget for search on a static site. During publication, Staatic indexes selected WordPress content in Staatic Search. Visitors query Staatic Search from the static site instead of using WordPress search.
Use Search Integration when your static site needs visitor-facing search without routing search requests back to WordPress.
Requirements
Search Integration depends on Premium account state and a connected Staatic account.
| Requirement | Why it matters |
|---|---|
| Staatic Premium Edition | The integration module is Premium-only. |
| Active subscription | Search hooks and indexing tasks are only enabled for active subscriptions. |
| Connected Staatic account | Staatic needs account access to create and update search indices during publication. |
Enabling search integration
In order to provide search results to visitors of your static site, selected WordPress content needs to be indexed by Staatic Search.
To enable search integration, follow these steps:
- Go to the WordPress Admin and click Staatic > Settings > Integration.
- Make sure Enable search integration with WordPress search functionality is checked.
- Optionally, limit the Post Types that will be included in the search index.
- Optionally, adjust Maximum Results to control how many suggestions are shown to visitors. The default is
5. - Click Save Changes.

By default, Staatic includes post types that are public, publicly queryable and shown in navigation menus. Changing the selected post types marks the search index for reindexing during the next eligible publication.
How indexing works
Search indexing is part of the publication process.
| Publication phase | Search behavior |
|---|---|
| Initiate indexing | Staatic prepares the configured search index and clears index state when a full reindex is required. |
| Index content | Staatic imports changed or selected content into Staatic Search in batches. |
| Finish indexing | Staatic finalizes indexing and resets reindexing flags after the indexer finishes. |
Indexing updates happen during supported static publications, not immediately when a post is saved. Staatic tracks post changes, scheduled posts that become published, and deleted posts so the next publication can update the index.
Preview publications keep preview search results separate from live search results. Publications that skip deployment or are based on another source publication do not run the search indexing tasks.
Staatic indexes post titles and post content by default. Indexed records also include metadata such as post type, excerpt, dates, permalink, author information when available, and thumbnail information when available.
The Force reindex setting clears and rebuilds the indexed records during the next eligible publication. Use it after changing post type selection or when search results appear stale.
Frontend search behavior
Staatic initializes the search widget on normal WordPress search inputs and on custom fields marked for Staatic Search.
| Field selector | Behavior |
|---|---|
input[name="s"] |
Enhanced automatically unless it has the no-autocomplete class. |
[data-staatic-search] |
Explicitly enhanced, useful for custom search fields. |
.no-autocomplete |
Prevents automatic enhancement for a search input. |
When a visitor types a query, the widget sends the query to Staatic Search with the configured maximum result count. Selecting a result redirects the visitor to that result’s indexed permalink.
The frontend Maximum Results setting controls how many suggestions the widget requests. The default is 5.
Customizing the search widget
The search widget included with Staatic Search has been designed to integrate with most sites and themes. It positions autocomplete results relative to the search query field and appends the result list to the page body.

There may be good reasons to change the appearance of the widget or the result list to improve integration within your site.
CSS styling
The easiest way to change the search widget’s appearance is by adding some CSS styling. The basic HTML structure of the search widget looks like this:
<input name="s" type="search">
<div class="autocomplete-result-list" data-position="above|below">
<div class="autocomplete-result">
<a class="suggestion-link">
<img class="suggestion-thumbnail" alt="">
<div class="suggestion-attributes">
<span class="suggestion-title"></span>
<span class="suggestion-content"></span>
</div>
</a>
</div>
</div>
For a custom field that does not use WordPress’ normal search field name, add data-staatic-search:
<input data-staatic-search name="site-search" type="search">
To keep a normal WordPress search input from being enhanced, add no-autocomplete:
<input class="no-autocomplete" name="s" type="search">
Limitations and caveats
Search Integration is designed for static-site autocomplete and search suggestions. Keep these boundaries in mind:
- Index updates are publication-driven. Saving a post records a change, but visitors see the updated search result after the next eligible publication indexes it.
- Default search matching uses post titles and post content. Searching other fields requires custom development.
- The frontend widget uses the first registered search index.
- Theme search forms that do not use
input[name="s"]needdata-staatic-searchto be enhanced. - Public search requests are handled by Staatic, not by WordPress login state.
- Search analytics count search queries per index. They do not track result clicks.