Init Live Search – A Fast, Lightweight, and Smart Search Plugin for WordPress

Phiên bản: 1.6.6 English version

Init Live Search – A Fast, Lightweight, and Smart Search Plugin for WordPress
Init Live Search is a live search plugin for WordPress, designed with a focus on speed, simplicity, and performance. Built with pure Vanilla JavaScript and powered by the WordPress REST API, it provides a smooth, instant search experience without reloading the page.

Versions 1.5.x and 1.6.x take Init Live Search beyond basic site search — into a fast, customizable, developer-friendly system for WordPress sites of any size.

Watch live demo: https://youtu.be/nZocaTpi2hM

What’s New in Versions 1.5.x and 1.6.x

Version 1.6.x marks a major UI evolution for Init Live Search — introducing flexible interface customization and seamless integration with any theme or site layout. Built on the solid foundation of the 1.5.x series, it delivers both frontend polish and backend performance.

  • Time-based analytics commands: New slash commands /day, /week, and /month show the most viewed posts by day, week, or month (requires Init View Count plugin).
  • Default Slash Command: Automatically run a default slash command when the modal opens — either choose manually or enable “Smart Detection” to auto-select based on the current page.
  • Preset UI Styles: Choose from built-in UI styles like style-full.css (full-screen modal) and style-topbar.css (floating topbar search UI).
  • Override & Custom Styles: Easily override the default styles by adding init-live-search/style.css in your theme — or disable all built-in CSS to create your own from scratch.
  • WooCommerce-ready: Enhanced product search via slash commands like /product, /on-sale, /stock, /sku, and /price — showing prices, sale badges, stock status, and Add to Cart buttons.
  • Search in SEO Metadata: Match queries against SEO Title and Meta Description fields from plugins like Yoast SEO, Rank Math, AIOSEO, The SEO Framework, and SEOPress.
  • Init Smart Tag-Aware Search: Increases accuracy by combining post title and tags — with intelligent bigram-based fallback.
  • ACF Field Search: Supports searching across selected ACF fields — only returns published posts, fully customizable via filters.
  • Multilingual Support: Auto-detects current language via WPML or Polylang and filters results accordingly — no extra setup needed.
  • Favorites & History: Manage favorite posts with /fav, clear them with /fav_clear, and view recent search queries with /history — all stored locally, no login required.
  • Weighted Result Ranking: Prioritize results based on customizable weights between title, tags, SEO data, etc. — easily adjustable via filter hooks.
  • Refactored Core & Performance: Entire JS codebase streamlined — lighter, less dependent on external scripts, and easier to integrate into modern themes or headless setups.
  • Search Analytics: Track user queries directly in the admin — keyword stats, frequency, CSV export, no personal data stored.
  • Custom Slash Commands & Click Tracking: Define your own slash commands from themes or plugins (via filter + JS event) and track when users click on results using the ils:result-clicked event.
  • Smart Excerpt Highlight: Automatically generates a short snippet and underlines matching keywords from excerpt or content — making it easier for users to understand search context.
  • Smart fallback & stable REST output: Automatically splits long queries into individual terms and expands matches into SEO metadata — no setup needed. Ensures consistent response structure for smooth frontend rendering.

Key Features

High Performance, Zero Dependencies

Built entirely with Vanilla JavaScript — no jQuery, no third-party libraries. All search actions run through a custom, optimized WordPress REST API under the namespace initlise/v1. An intelligent debounce mechanism ensures minimal server load during fast typing.

Results, slash commands, favorites, and reading history are cached locally using localStorage to reduce repeated API calls and speed up the user experience.

Flexible UI with Preset Styles

Choose from built-in UI styles like full-screen (style-full.css) or topbar-style (style-topbar.css), or disable all CSS and create your own. You can also override the default design by adding a init-live-search/style.css file in your active theme.

Smart Suggested Keywords

Admins can manually define a list of suggested keywords or generate them automatically from existing post titles. The system intelligently removes stop words and highlights the most relevant terms for search discovery.

Full Keyboard Navigation & Shortcuts

  • , : Navigate between results
  • : Add selected post to favorites
  • : Remove selected post from favorites
  • Enter: Open selected post
  • Esc: Close the search modal

Note: Left/Right arrows only apply when a result is actively selected.

Advanced Search Capabilities

Powerful slash commands: view latest posts (/recent), filter by tags, categories, WooCommerce products, SKU, price range, and stock status. Fully extendable via REST API and custom filters.

Supports deep search into ACF custom fields and SEO metadata from plugins like Yoast, Rank Math, AIOSEO, SEOPress, and The SEO Framework — ideal for content-rich or structured websites.

Highly Compatible & Easy to Integrate

No need to modify your theme or insert shortcodes. The plugin auto-binds to any <input name="s"> field. You can also trigger the modal via keyboard shortcuts, HTML attributes, or even specific URLs.

Fully Responsive & Multilingual

The modal interface is fully responsive and works smoothly on all screen sizes. The plugin includes built-in support for English and Vietnamese, switching automatically based on your site’s language setting.

Simple Configuration

  • Select which post types to search: post, page, or any public custom post type
  • Choose one or more modal trigger methods: focus on input[name="s"], triple-click anywhere, or press Ctrl/Cmd + /
  • Enable or disable Slash Commands — supports commands like /recent, /tag, /product, etc.
  • Define a default slash command that runs automatically when the modal opens — e.g., /recent or /product
  • Select search mode: title only, title + excerpt, title + content, or Init Smart Tag-Aware Search (matches post titles and tags, this mode is ideal for short, keyword-heavy content — especially tags like php, seo, or css)
  • Enter a list of ACF field keys for advanced field-based search — e.g., company_name, project_code
  • Enable SEO metadata search — supports plugins like Yoast, Rank Math, AIOSEO, The SEO Framework, and SEOPress
  • Enable smart fallback — automatically trims keywords or uses bigrams when few results are found
  • Customize search delay (debounce) from 100–3000ms to balance speed and server load
  • Limit the number of results shown in the modal (1–100)
  • Set the maximum number of words allowed for triggering Quick Search tooltip (0–20, set to 0 to disable)
  • Enable or disable voice input using the SpeechRecognition API (if supported)
  • Enable caching of search results in localStorage to reduce repeated API calls
  • Select frontend CSS preset: default modal, full-screen overlay, topbar UI, or disable all styles to use your own
  • Optionally append a default UTM parameter to all search result links (e.g., utm_source=search)
  • Enter or auto-generate default suggested keywords for instant search hints

Technology Stack

  • Vanilla JavaScript: Entire frontend logic written in pure JavaScript — no jQuery or external frameworks
  • Custom REST API: Uses standardized endpoints under a dedicated namespace initlise/v1
  • Modular architecture: JS source code is organized by function: trigger, command, rendering, API, etc.
  • Zero external dependencies: No third-party libraries — everything is self-contained
  • Icons & images: Uses inline SVG and customizable fallback thumbnails via filters
  • Global config: Define behavior through window.InitPluginSuiteLiveSearchConfig
  • Theme override support: Fully override styles via init-live-search/style.css in your theme
  • LocalStorage-first: Leverages localStorage for caching, slash command history, favorites, and session state

Source Code & Development

Init Live Search is an open-source plugin actively maintained on GitHub. You can follow the development process, get early access to updates, or contribute ideas, report bugs, and suggest new features directly on the repository.

  • Official repository: github.com/brokensmile2103/init-live-search
  • Click Star to support the plugin — it helps increase visibility in the open-source community.
  • Use the Issues tab to report bugs or request new features.

Installation & Usage

  1. Install and activate the plugin as you would any standard plugin.
  2. It works automatically on all <input name="s"> search fields.
  3. You can open the search modal via Ctrl + / or a triple-click anywhere blank.
  4. Configure keyword suggestions via Settings → Init Live Search.

For Developers

Init Live Search is built with extensibility in mind, making it easy for developers to integrate deeply into custom themes or other plugins.

  • Filters & Hooks: The plugin offers numerous filters to customize search results, suggestions, taxonomy filters, and output structure. See details in Using Filters in Init Live Search.
  • JavaScript Events: Custom events like ils:modal-opened, ils:results-loaded, and ils:search-started are triggered during runtime. Useful for tracking, analytics, or integrating with custom UI. Learn more at Using JavaScript Events in Init Live Search.
  • Customizable UI: Choose from built-in presets, override styles via style.css in your theme, or disable all CSS and build your own from scratch. See the Init Live Search UI customization guide.
  • REST API: The search data is returned through a standardized REST endpoint at /initlise/v1/search. You can call this endpoint manually with JavaScript. Full list at Init Live Search REST API Reference.
  • Slash Command System: Supports intuitive command-like queries such as /recent, /id, /tag and more. Learn how to use them in Using Slash Commands in Init Live Search.
  • Advanced Triggers: The modal can be opened using keyboard shortcuts, triple-click, input focus, URL (deep link), text selection, or elements with data-ils. See the full list at All Ways to Open the Init Live Search Modal.
  • Headless & Static Sites: The plugin works seamlessly with headless WordPress setups or static site generators like Hugo, Astro, or Next.js. See the full integration guide at How to Integrate Init Live Search with Headless or Static Sites.
  • CDN Cache Optimization: You can cache slash command results using Cloudflare Cache Rules to reduce server load while keeping the search experience lightning-fast. Learn how in Cloudflare Cache Rules for Init Live Search.
  • Global JavaScript Config: Use window.InitPluginSuiteLiveSearch to dynamically control plugin behavior without touching the source code.
  • Modular Codebase: The codebase is clearly divided into modules for REST API, suggestion engine, modal UI, filters, triggers, and cache — making it clean and easy to extend.
  • Theme-Specific Styling: You can fully override plugin styles by placing a init-live-search/style.css file inside your theme directory.

Because the logic is not tightly coupled, developers can easily build advanced integrations such as WooCommerce product search, custom taxonomy filters, or template-level shortcode enhancements.

If you’re just getting started or want to explore further, don’t miss the Init Live Search Complete Series – a curated collection of articles covering everything from the basics to advanced use cases of the plugin.

Support

If you like the plugin, consider starring it on GitHub — your support helps keep it visible in the open-source community! We welcome all ideas, feedback, and bug reports — let’s make search on WordPress smarter together!

Changelog

  • 1.6.6 – Fallback search & UI refinements
    • Added Single Word Fallback logic — automatically splits multi-word queries into individual terms if no results are found
    • Integrated SEO Metadata Matching into fallback — expands result coverage by matching SEO titles and meta descriptions
    • New admin setting: “Show Excerpt in Search Results” — toggle on/off to simplify the UI
    • Refactored search mode handling: moved full, title, tag-aware logic into dedicated functions for better modularity
    • Normalized REST API output — always returns consistent structure even when no excerpt is present
  • 1.6.5 – Smart Snippets & Precise Highlighting
    • Added Smart Excerpt Highlight — automatically generates a short snippet from excerpt or falls back to content when needed
    • Keywords are underlined inside the snippet for better search context and visibility
    • Prioritizes excerpt if available, with intelligent fallback to content
    • Snippet length is controlled on the frontend to prevent UI overflow or layout breakage
    • Improved result ranking algorithm: scores title > excerpt > content, especially in title_excerpt and title_content modes
    • Refactored the get_results() function into clean, modular sub-functions — easier to extend and maintain
  • 1.6.4 – Custom slash commands & new dev events
    • Added new JavaScript event ils:result-clicked — fires when a search result is clicked (includes ID, URL, title, type, category, and slash command)
    • Introduced new filter init_plugin_suite_live_search_commands — allows registering custom slash commands from your theme or plugin
    • Custom slash commands can be handled entirely via JavaScript ils:* events — no need to modify the core plugin
    • Optimized voice search logic using SpeechRecognition — auto-stop after 5s, optional auto-restart, detects language from <html lang="...">
    • Improved mic button UI and error handling when the browser blocks microphone access
  • 1.6.3 – New slash commands & smarter logic
    • Added new slash commands: /day, /week, /month — display the most viewed posts by day, week, or month
    • Added slash command /history — displays recent search queries (stored via LocalStorage)
    • Requires the Init View Count plugin to be active in order to use these commands
    • Fully supports infinite scroll and REST API — optimized for high-traffic WordPress sites
    • Improved slash command detection — only shows available commands based on active plugins and settings
    • Enhanced fallback handling for unknown slash commands — smoother, more consistent UI behavior
  • 1.6.2 – Default Slash Command & UI Tweaks
    • Added option to choose a default slash command when the modal opens (e.g. /recent, /related, /product)
    • Smart Detection mode: automatically selects a command based on current page type (post, taxonomy, product, etc.)
    • Commands like /popular and /read only appear if the corresponding plugins are active
    • Improved admin settings descriptions — clearer and more beginner-friendly
    • Added filters and validation logic to ensure only valid values are saved
  • 1.6.1 – Search Analytics & Tracking Optimization
    • Added a new Analytics tab in admin — track search queries in real-time
    • Logs keyword-based search queries (term, result count, timestamp, source, user ID)
    • Stores logs using rotating transients — lightweight and privacy-friendly
    • Groups similar queries and sorts by frequency (powered by client-side JS)
    • Supports CSV export and log clearing with secure nonce validation
    • Enhanced tracking logic:
      • Only logs meaningful keywords — skips slash commands like /recent or /fav
      • Ignores empty queries or special character-only inputs
    • Improved admin UX: cleaner buttons, responsive layout, grouped query toggles
    • Nonce protection added to all admin actions
    • Internal refactor:
      • Streamlined tracking-related hooks and filters
      • Renamed analytics.php to tracking.php to avoid conflicts with log rendering
  • 1.6 – UI Expansion & Preset Style Support
    • Added new option to choose built-in UI presets: style-full.css, style-topbar.css
    • style-full.css: transforms the modal into a full-screen overlay, independent from the page layout
    • style-topbar.css: displays the search UI as a floating top bar, similar to Spotlight or the WP admin bar
    • Supports style overrides by adding a init-live-search/style.css file inside the current theme
    • New option: “Disable all default CSS” — ideal for developers building a custom interface from scratch
    • Improved default UI: better spacing and alignment on mobile, more consistent element gaps
  • 1.5.4 – Search in SEO Metadata
    • Introduced Search in SEO Metadata — enables matching search terms against SEO Titles and Meta Descriptions
    • Supports major SEO plugins: Yoast SEO, Rank Math, AIOSEO, The SEO Framework, and SEOPress
    • Can be enabled or disabled via admin settings
    • Optimized logic to distinguish between search modes: title, title_tag, and title_excerpt
    • New filter: init_plugin_suite_live_search_seo_meta_keys — allows customizing which SEO meta keys are queried
    • Added filter init_plugin_suite_live_search_weights — control result order using custom weights across different data sources
  • 1.5.3 – ACF & Multilingual Support
    • Added support for searching in ACF custom fields — new admin setting allows specifying field keys (e.g. company_name, project_code)
    • Searches only published posts and integrates smart fallback (term trimming and bigrams)
    • New filter: init_plugin_suite_live_search_post_ids — modify result IDs from ACF or other sources
    • Auto-detects current language via WPML or Polylang and filters results accordingly
    • New filter: init_plugin_suite_live_search_filter_lang — restrict results to current language
    • New filter: init_plugin_suite_live_search_category_taxonomy — customize the taxonomy used for displaying category names (e.g., use product_cat for WooCommerce)
    • Improved ACF query performance — joins only published posts and avoids duplicate IDs
    • Finalized filter documentation and synced all translations and UI texts
  • 1.5.2 – Init Smart Tag-Aware Search
    • Introduced a new search mode: Init Smart Tag-Aware Search — combines post title and tag relevance, automatically splits terms to match short tags like php, css, seo
    • Quick Search tooltip now supports single-word selections (previously required 2+ words)
    • Improved UX for slash commands: clearer loading states and smoother infinite scroll behavior
    • Standardized WooCommerce result layout: sale badges, out-of-stock labels, and proper spacing
    • Internal refactor: optimized fallback handling, keyword parsing, and slash command validation logic
  • 1.5.1 – WooCommerce Integration & Slash Command Expansion
    • Added WooCommerce product search via slash commands: /product, /on-sale, /stock, /sku, /price
    • Display product price, sale badges, stock status, and Add to Cart buttons in search results
    • Introduced /price {min} {max} command to filter products by price range (via REST API)
    • Standardized infinite scroll behavior for product-related slash commands
    • Visual badges added for “Sale” and “Sold out” states
    • Slash command visibility now respects the product post type setting in admin
    • Improved keyboard navigation for slash command list (auto-scroll on overflow)
    • Optimized JS rendering logic for cart buttons and stock display
    • Enhanced SKU matching accuracy and price filter precision
    • Fixed minor bug: .ils-fav-btn incorrectly received active class outside /fav command
  • 1.5 – Faster interactions & favorite management
    • Added “Quick Search” tooltip when selecting 2–8 words, allowing instant modal activation and search
    • Supported data-ils attribute on any HTML element to open the modal and prefill slash commands
    • Introduced /fav and /fav_clear commands to manage favorite posts using localStorage
    • Enabled adding/removing favorites directly in the result list via a star icon
    • Improved internal command engine: accurately renders stateful results and supports filter reset
    • Refined hiddenUrl logic to automatically reset when no result is selected
    • Unified modal trigger behavior across all entry points for consistent user experience
    • Refactored codebase to prepare for future extensibility without affecting existing API or markup
  • 1.4.3 – Complete Slash Command System & UI Enhancements
    • Pagination and infinite scroll support for commands like /recent, /date, /tax, and /read
    • Improved UI: smoother suggestion pills and better mobile interaction
    • New JavaScript events for developers: ils:modal-opened, ils:modal-closed, ils:results-loaded, ils:search-started
    • Enhanced keyboard UX: reliable navigation through suggestions, commands, and results
    • /clear command now only removes cache entries with the ils-cache-* prefix
    • Optimized rendering logic to prevent scroll glitches or layout shifts with large result sets
    • Refactored internal logic: clear separation of UI, cache, commands, and events for better maintainability
    • No console warnings — production-ready for large-scale sites
  • 1.4.2 – UX Improvements & Deep Link Support
    • Live slash command suggestions when typing /
    • Improved keyboard navigation and selection handling
    • New setting to completely disable slash commands
    • Supports opening modal via ?modal=search or #search
    • Allows pre-filling search term or command via ?modal=search&term=/related
    • Prevents page reload when clicking links with modal=search — opens modal via JS
  • 1.4.1 – Expanded Slash Commands & UX Enhancements
    • Added new slash commands: /related, /read, /random, /categories, /tags, /help, /clear, /reset
    • New option to enable/disable voice input in settings
    • /read command: shows recently viewed posts using localStorage (no REST API required)
    • /related command: suggests posts based on the current page’s title
    • /categories and /tags commands: display popular taxonomy terms as clickable pills
    • Built-in slash command helper UI inside the modal
    • Refactored JS command logic for better modularity and fallback handling
    • UI improvements: pill-style layout and full i18n support for all commands
  • 1.4 – Command-based search & REST API optimization
    • Added slash command support: /recent, /popular, /category, /tag, /date, /id
    • Smart /date parsing: accepts formats like Y, Y/m, or Y/m/d
    • Jump directly to a post with /id {post_id}
    • Custom REST API endpoints for each command (/recent, /date, /tax) instead of default WordPress endpoints
    • Command result caching using localStorage — only one API call per command
    • New developer filters:
      • init_plugin_suite_live_search_query_args – modify WP_Query arguments before execution
      • init_plugin_suite_live_search_default_thumb – override default thumbnail image
    • New trigger options: enable/disable Ctrl + /, triple-click, or input[name="s"] separately
    • JS refactor: fully modular command-based structure for cleaner logic and future features
  • 1.3 – UX improvements & full code namespacing
    • Added shortcut Ctrl + / to open the search modal
    • Added triple-click trigger (click 3 times on blank space to open modal)
    • Show post type label (Post, Page, etc.) next to each result
    • Auto-generate category filter from results (no extra API call)
    • Improved UX: search icon turns into a clear/reset button when input has value
    • Codebase standardization:
      • All identifiers use prefix init_plugin_suite_live_search_*
      • REST API namespace renamed to initlise/v1
      • Global JS config moved to window.InitPluginSuiteLiveSearch
  • 1.2 – Developer-focused enhancements
    • Added experimental voice input using SpeechRecognition API
    • New filters for developers:
      • init_plugin_suite_live_search_enable_fallback
      • init_plugin_suite_live_search_post_ids
      • init_plugin_suite_live_search_result_item
      • init_plugin_suite_live_search_results
    • New settings:
      • Enable/disable fallback logic (shortened terms and bigrams)
      • Enable/disable plugin default CSS
    • Dark mode support via CSS class or global JS config
  • 1.1 – Major upgrade
    • Enhanced fallback logic with trimmed term and bigram suggestions
    • Remembers previous search term when reopening modal
    • Input limited to max 100 characters
    • New options:
      • Enable result caching via localStorage
      • Automatically append UTM from URL to result links
    • Dark mode support via class or global JS config
  • 1.0 – Initial release
    • First stable version released
    • Modal-based search powered by the WordPress REST API
    • Full keyboard navigation: Arrow keys, Enter, Escape
    • Support for manual and auto-generated keyword suggestions
Made with in HCMC.

Bình luận


  • Không có bình luận.