How to Use Slash Commands in Init Live Search

Slash commands are a powerful feature in the Init Live Search plugin, allowing users to input special commands by starting with a /. Instead of typing regular keywords, you can use commands like /recent, /tag javascript, or /id 123 to perform precise and fast searches.

How to Use Slash Commands in Init Live Search

1. What is a slash command?

Slash commands are special input patterns that begin with / and are entered directly into the search bar. The plugin parses the input and routes it to the corresponding REST API endpoint—no keywords required.

Slash command is a signature feature of Init Live Search — designed as an extensible framework that allows developers to build custom search commands easily, with clean syntax, fast response, and an intuitive interface.

2. How to use it

Simply type / in the search field. The plugin will automatically match and execute the corresponding slash command. A real-time dropdown of available commands will appear as soon as you type, no need to enter /help anymore.

3. Current Slash Command List

  • /recent – Show the most recent posts
  • /popular – Show most viewed posts (requires Init View Count plugin)
  • /day, /week, /month – Popular posts by day, week, or month
  • /trending – Show posts with the fastest-growing views
  • /id 123 – Open a post directly by its ID
  • /date 2024, /date 2024/05, /date 2024/05/23 – Search posts by date
  • /category wordpress – Filter posts by category (slug)
  • /tag seo – Filter posts by tag (slug)
  • /categories, /tags, /taxonomies – Show popular taxonomies
  • /product – Display all WooCommerce products
  • /on-sale – Filter products on sale
  • /stock – Filter products that are in stock
  • /sku ABC123 – Search products by SKU
  • /price 100 300 – Filter products by price range
  • /price 100 300 sort – Filter and sort by price (ascending)
  • /price 100 300 rsort – Filter and sort by price (descending)
  • /brand nike – Filter products by brand (supports custom taxonomies)
  • /attribute color red – Show available attributes like color, size, etc.
  • /variation size xxl – Filter products with a specific variation
  • /coupon – Show active WooCommerce coupons (code, usage left, expiration)
  • /related – Suggest related posts based on the current page
  • /read – Show recently read posts (requires Init Reading Position plugin)
  • /fav – Show favorite posts (stored in localStorage)
  • /fav_clear – Clear all saved favorites
  • /random – Open a random post
  • /history – View recent search history
  • /history_clear – Clear all search history
  • /clear – Clear plugin’s local cache
  • /reset – Clear current search input and reset UI

Note: WooCommerce-related commands (/product, /on-sale, /stock, /sku, /price, etc.) are only available if WooCommerce is active and product is enabled in the plugin settings.

4. Slash command suggestion UI

Slash Command UI in Init Live Search

As soon as users type /, the plugin displays a real-time dropdown of supported commands. This makes it easy to explore and execute commands—no memorization needed.

The /help command is no longer necessary as suggestions now appear automatically when typing /.

5. Customizing slash commands

  • You can disable slash commands by turning off all triggers in the plugin settings.
  • Developers can register custom commands via REST API and JavaScript filters (e.g., InitPluginSuiteLiveSearch.commands).

6. Why slash commands are useful

  • Provide instant access to specific content—no typing full keywords
  • Lower search overhead by routing each command to a lightweight endpoint
  • Create a command palette experience similar to VS Code or Slack
  • Perfect for headless sites, mobile apps, and PWAs

Conclusion

Slash commands are a major leap in WordPress search UX. Instead of typing keywords and hoping for matches, users can issue clear, fast, and structured commands for instant results.

If you’re using Init Live Search, try typing a slash and explore the command palette. It’s the fastest way to search smarter.

Comments


  • No comments yet.

Web-Based Tools

Press Ctrl + \ on desktop, or swipe left anywhere on mobile.

Login