Loupe Search
Loupe Search improves WordPress core search by maintaining its own index for fast lookups, supporting typo tolerance, phrase matching, basic exclusion operators, and per–post-type customization.
Core Features
- 🚀 Index-backed search engine replacing the WordPress default
- ⚡ Results served from a dedicated index, not the posts table
- 🔄 Real-time index synchronization
- 🌐 Support for multiple languages
- 📦 Full custom post type integration
- 📈 Integrated search performance metrics
- ✅ Works with the WordPress default themes
Search Capabilities
- 🔍 Typo-tolerant searching – find results even with misspellings
- 💬 Phrase matching with quotation marks:
"exact phrase" - ➖ Exclusion operator support (e.g.,
term -excluded) - 🔀 OR search:
term1 term2finds content with either term - 📖 Pagination support
- Stemming support
- Stop words recognition
- Highlighting and cropped snippets via the REST API
Administration
- Simple settings interface
- Post type selection
- Field configuration options
- One-click reindexing
- Processing time monitoring
Developer Features
- 🛠️ Extensive filter system for customization
- 📊 Performance monitoring and diagnostics
- 🔧 Customizable indexing
- Field weighting control
See the Search API documentation for REST endpoint details.
AI Agent Integration (WordPress Abilities API)
Loupe Search registers two abilities via the WordPress Abilities API (WordPress 6.9+) so AI agents and automation tools can discover and use search functionality natively:
loupe-search/search— Typo-tolerant full-text search across indexed post types. Supports phrase matching, exclusion, and OR operators. Publicly accessible.loupe-search/get-post— Retrieve a single published post by ID. Publicly accessible.
These abilities are discoverable through the standard WordPress Abilities registry and require no additional configuration. As of 1.2.0 the ability namespace is loupe-search; the legacy wp-loupe/search and wp-loupe/get-post abilities still work but are deprecated aliases.
Upgrading from the experimental MCP server? The MCP server, token service, and WP-CLI token commands were removed in 0.8.5. Use the Abilities API endpoints described above instead; no configuration migration is required.
Filters
These filters allow developers to customize Loupe Search's behavior. As of 1.1.0 they use the loupe_search_* prefix; the old wp_loupe_* names still work but are deprecated and will be removed in a future major release.
loupe_search_db_path
Controls where the search index is stored. Default: WP_CONTENT_DIR . '/loupe-search-db'
loupe_search_post_types
Modifies which post types are included in search. Default: the post types selected on the settings screen, falling back to ['post', 'page']
loupe_search_posts_per_page
Controls search results per page. Default: WordPress "Blog pages show at most" setting
loupe_search_index_protected
Controls indexing of password-protected posts. Receives false for protected posts and true for everything else; return true to index them anyway.
loupe_search_field_{$field_name}
Modifies a core post field before indexing. Does not fire for custom fields.
Example: The plugin uses loupe_search_field_post_content to strip HTML tags from content
loupe_search_schema_{$post_type}
Customizes the schema for a post type: which fields are indexed, their weight, and whether they are filterable or sortable.
loupe_search_is_safely_sortable_{$post_type}
Overrides whether a core post field may be used for sorting.
loupe_search_is_safely_sortable_meta_{$post_type}
Overrides whether a custom field may be used for sorting.
For signatures, defaults, and usage examples, see the filter documentation.