SearchCue
Menu
Back to the WordPress search plugin

SearchCue WordPress plugin source code

The SearchCue plugin adds fast site search and cited answers to WordPress. Install it from the WordPress plugin directory, and inspect every line of source code below.

Designed to keep WordPress setup small.

Install the plugin

In WordPress admin, open Plugins → Add New Plugin, search for "SearchCue", install it, and activate it.

Connect your site

Sign in to SearchCue, copy your site settings, and let the hosted crawler index your public content.

Keep WordPress light

SearchCue runs search and answers from our hosted index instead of adding a heavy search engine to your database.

Everything SearchCue can do on WordPress.

The plugin includes every SearchCue feature. If your site uses WooCommerce, it also adds rich product search.

Real-time search

Instant, typo-resistant results across every page, with matching terms highlighted.

AI answers from your content

Direct answers grounded in your content, with citations visitors can inspect.

See what people search for

See popular queries, clicks, dead ends, content gaps, and changes over time.

Matches your site

Place a search bar or button anywhere, then match its colours and style to your site.

You control the results

Exclude landing pages, SEO filler, or anything else you do not want to surface.

Document search

Index supported PDFs and Office documents alongside your pages.

Image recognition

Make images searchable with OCR and image understanding.

WooCommerce product search

Search published products and variations with prices, sale and stock status, images, attributes, and faceted filters.

Source you can inspect.

The browser below is generated from the plugin files during the site build. Pick a file to read it without downloading anything.

Download source zip
searchcue SearchCue WordPress plugin source code
README.md 68 lines
# SearchCue - WordPress Plugin

SearchCue is a hosted site search service with results that appear as visitors type, typo-tolerant matching, semantic search, and optional cited AI answers grounded in indexed content from your site.

The SearchCue WordPress plugin connects supported public pages, WooCommerce products, documents, and image content to that hosted search service. It can also notify SearchCue when public content changes, helping the hosted index stay current without building a search index in the WordPress database.

Please note that SearchCue is a paid service. You can try it for free for 15 days, and there are no bad feelings if you decide it isn't for you. We won't try to upsell you or trick you to become a customer. If you want more information about what the service costs before getting started, please check our [website here](https://searchcue.com).

## Plugin features

- Adds the SearchCue embed script into the `<head>` of every public page and excludes it from WP Rocket minification
- Adds a **SearchCue** admin menu page to configure SearchCue
- Optional automatic pings to SearchCue when content changes in order to keep the search index up to date
- Exposes the published, visible WooCommerce catalog to the connected SearchCue backend through an authenticated endpoint
- Exposes published posts' categories and tags, with identities and parent relationships, to the connected SearchCue backend through an authenticated endpoint
- No third-party PHP dependencies
- The search index is hosted by SearchCue rather than built or queried in the WordPress database

## SearchCue features

- Typeahead keyword search
- AI answers and conversational search
- Design editor making it easy to adapt the search interface to the design of your site
- Search analytics
- Advanced tuning controls
- The ability to upload additional custom data you want to make searchable
- Rich WooCommerce product and variation results with prices, images, attributes, and faceted filters

## Installation

### From ZIP (for production use)

1. Download the plugin ZIP
2. In WordPress admin, go to **Plugins > Add New > Upload Plugin**
3. Upload the ZIP and activate

## Configuration

1. Open **SearchCue** from the WordPress admin menu
2. Enter your email and follow the sign-in link to connect the site
3. Keep **Automatic updates** checked if you want SearchCue to re-index changed pages automatically
4. Optionally set a different Site ID under **Advanced settings**
5. Save changes

The embed script will appear in the `<head>` of all public pages that call `wp_head()`.

WP Rocket must load the embed from SearchCue's CDN rather than retain its own minified copy. After updating an existing installation, purge any previously generated WP Rocket minified scripts and affected page caches.

Automatic updates send affected public page and product URLs when an image changes, rather than the image file URL. The plugin resolves upload parents, featured images, WooCommerce galleries, saved content, gallery shortcodes, and synced blocks, including encoded image filenames and bulk changes. Parentless images trigger updates when referenced or when they have an enabled public HTML attachment page. Public document attachments retain their direct URLs. Draft, private, and password-protected pages are excluded. References generated exclusively by themes, CSS, options, or plugin-specific fields cannot be inferred from WordPress's standard image metadata.

Changed URLs are stored in a local delivery queue, separately from the hosted search index. WP-Cron sends bounded batches every minute while Automatic updates is enabled and retains them until SearchCue acknowledges receipt, including after temporary failures or a full server-side queue. Ordinary post saves do not wait for remote HTTP. Delivery depends on WordPress cron running; configure an external cron runner if WP-Cron is disabled or site traffic is infrequent.

## External Service and Privacy

The plugin requires the hosted SearchCue service; it has no third-party PHP dependencies. A SearchCue account is required, and continued service after the free trial requires a paid subscription.

Once connected, the plugin loads SearchCue's executable browser embed, sends public content updates when enabled, and exchanges setup and analytics data with SearchCue. SearchCue also pulls the WooCommerce catalog through an authenticated endpoint, including product names, descriptions, public URLs, product and variation IDs, SKUs, prices and currency, sale and stock status, categories and tags with their identities and parent relationships, attributes, images, and timestamps. Only published, visible catalog data is shared. The plugin does not share drafts, hidden or password-protected products, orders, customers, or download files. SearchCue also pulls blog taxonomy through an authenticated endpoint, including public post URLs, post IDs, and the identities, names, and parent relationships of the categories and tags assigned to published posts, including ancestor categories. Only published, public posts are shared, never post content, drafts, private posts, password-protected posts, or user data. Automatic updates sends the parent product URL after product or variation changes, the public URL of a post or product after its category or tag assignments change, and the home page URL after a category or tag is edited or deleted. The embed processes visitor searches and interaction metrics. The settings page uses locally bundled SearchCue font files under the SIL Open Font License 1.1.

See the complete data-flow disclosure in [`readme.txt`](readme.txt), the [SearchCue terms and conditions](https://searchcue.com/terms/), and the [SearchCue privacy policy](https://donoharm.world/privacy-policy/searchcue/).

## Uninstalling

Disabling Automatic updates or deactivating the plugin pauses delivery and preserves pending notifications. Deleting the plugin through WordPress runs `uninstall.php`, which removes stored options, queued notifications, and scheduled plugin jobs.

## License

This plugin is licensed under the [GNU General Public License v2.0 or later](https://www.gnu.org/licenses/gpl-2.0.html) (GPLv2+), which is the same license as WordPress itself. This is required for plugins published in the [WordPress.org Plugin Directory](https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/#1-plugins-must-be-compatible-with-the-gnu-general-public-license).