WP Live Search uses the WP REST API endpoint available for search. It will deliver results just as fast as the REST API on YOUR server can send them back. In the end it's important to realize that the REST API is just a wrapper for WP Query, and still uses PHP to process the requests.

Check out a demo here.

However, since we're only fetching JSON results, the search insn't being performed againts admin-ajax.php, so the experience should, in theory, be lightweight and super fast.

Basic Usage

  1. Activate the WP REST API plugin
  2. Add the shortcode [wp_live_search] to a page or something

Options

WP Live Search is incredibly extensive and can be used in variety of applications from small to large.

Examples

Because there are so many use cases, here are a few examples along with screenshots of how you can use WP Live Search.

[wp_live_search compact="true" dropdown="true" results_style="inside"]
[wp_live_search target="#someotherdiv"]

note: in the example above the define is also used define('WPLS_STYLE_DISABLED',true); to eliminate the stylesheet from loading. Secondly, the template override feature is being used (discussed below) to change the appearence of the list item.

Advanced

Here are a few advanced options that you might find useful in your project.

Disable Style Loading

Use define('WPLS_STYLE_DISABLED',true); to disable the CSS style from loading. Note, you will want to add back in .wpls--show and .wpls--hide, these are responsible for showing and hiding content via JS.

Template Item Override

You can override the list item by copying the function from template-underscore.php into your own plugin (without the function exists). From here you can modify the markup as you wish, but you might want to keep the same classes so that the basic functionality is retained. It's also important to note that this will not work in a themes functions.php file, pluggable functions from a plugin will only work in another plugin.