SearchWP Live Ajax Search


Does not require SearchWP, but will utilize it if available. Full documentation is available at

SearchWP Live Ajax Search enables AJAX powered live search for your search forms. Designed to be a developer’s best friend, SearchWP Live Ajax Search aims to stay out of your way but at the same time allowing you to customize everything about it. It’s set up to work with any WordPress theme and uses a template loader to display results. The template based approach allows you to seamlessly customize your SearchWP Live Search implementation without messing with dozens of cluttered options.

Works best with SearchWP (but SearchWP is not necessary)

SearchWP Live Ajax Search is best utilized in conjunction with SearchWP, but it is not required. If SearchWP is installed and activated, SearchWP Live Ajax Search can be customized to use any of your search engines per search form.


You can customize the implementation of SearchWP Live Ajax Search to a great degree, including any number of developer-defined configurations. The results are based on a template loader, allowing SearchWP Live Ajax Search to stay out of your way and letting you write the results template as you would any other WordPress theme file.

Everything is powered by adding a single HTML5 data attribute (data-swplive="true") to the input field of your search form. This happens automagically out of the box for any search forms generated from get_search_form().

Widget support

SearchWP Live Ajax Search ships with a Widget allowing you to insert live search forms wherever you’d like.


  • SearchWP Live Ajax Search Results dropdown
  • SearchWP Live Ajax Search Settings page
  • SearchWP Live Ajax Search Forms settings page
  • SearchWP Live Ajax Search Forms embed options


This plugin provides 1 block.

  • Search Form The best WordPress search you can find.


  1. Download the plugin and extract the files
  2. Upload searchwp-live-search to your ~/wp-content/plugins/ directory
  3. Activate the plugin through the ‘Plugins’ menu in WordPress
  4. Optionally customize the configuration: full documentation
  5. Optionally customize the results template: full documentation



Of course! Full documentation

How do I add live search to my search form?

SearchWP Live Ajax Search will automatically enable itself on any search forms generated with get_search_form(). You can prevent that with the following filter:

add_filter( 'searchwp_live_search_hijack_get_search_form', '__return_false' );

If you would like to manually enable SearchWP Live Ajax Search on a custom search form, simply add the following data attribute to the input you want to hook: data-swplive="true"

How are search results generated?

By default, SearchWP Live Ajax Search uses the default SearchWP Search Engine if you are using SearchWP. If you don’t have SearchWP, native WordPress search results are provided. If you would like to customize which search engine SearchWP uses, simply add the following attribute to the form input: data-swpengine="supplemental" replacing ‘supplemental’ with your desired search engine name.

How do I customize the results template

SearchWP Live Ajax Search uses a template loader. In the plugin folder you will find a templates folder which includes search-results.php — that is what’s used out of the box to output search results. To customize that output, simply create a folder called searchwp-live-ajax-search in your theme directory and copy search-results.php into that folder. SearchWP Live Ajax Search will then use that file instead of the one that shipped with the plugin, and you can customize it as you would other theme template files.

SearchWP Live Ajax Search also outputs two sets of styles. The primary set of styles simply preps the results wrapper to be positioned properly. The second set of styles controls the visual appearance. This abstraction was made to ensure customization is as straighforward as possible. You can disable the default ‘theme’ by dequeueing the applicable stylesheet, and you can also disable the foundational CSS as well. More information available in the documentation.

How do I customize the spinner

SearchWP Live Ajax Search uses a filter — searchwp_live_search_configs — that allows you to fully customize the configuration used. Simply add a new key to the array passed through that filter, customizing the default values to whatever you want.


July 8, 2024 1 reply
After initially a bad experience with support, since they have been extremely helpful with this plugin and have provided code and knowledge bases to help do the things we want
December 20, 2023 1 reply
Установил, активировал. Вроде работает, будем разбираться.
December 18, 2023 1 reply
Great job to the developer! This is amazing. The customization options have been thought through incredibly well.
May 16, 2023
data-swpengine attribute was exactly what I was looking for, I’ve should come here much earlier 🙂
Read all 33 reviews

Contributors & Developers

“SearchWP Live Ajax Search” is open source software. The following people have contributed to this plugin.


“SearchWP Live Ajax Search” has been translated into 5 locales. Thank you to the translators for their contributions.

Translate “SearchWP Live Ajax Search” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • Fixes integration with Relevanssi Premium.


  • Fixes incorrect results when using a Live Search custom template in some cases.


  • Adds Search Forms.
  • Adds support for SearchWP custom search sources.
  • Improves existing and adds new customizations to the Live Ajax Search settings page.
  • Updates translation files.
  • Fixes Settings link location in the plugins list when SearchWP is activated.


  • Changes settings page appearance and menu structure to work seamlessly with a current version of SearchWP.


  • Changes visual style of admin settings page to match the current version of SearchWP.


  • Fixes widget Advanced settings button disappear without revealing the settings in some cases.
  • Fixes body content override if the custom parent element is set in the configuration.


  • Adds In-plugin notification system to get the latest updates from SearchWP.


  • Adds a compatibility with the upcoming version of the SearchWP Modal Search Form plugin.
  • Fixes an issue with a legacy version of the SearchWP plugin.


  • Fixes the translations of the plugin.


  • Adds new Settings admin page to control the behavior of the plugin easier.
  • Introduces significant code refactoring to improve performance.


  • Improves sanitization of the ‘swpengine’ search field argument.
  • Standardizes direct access restrictions in classes throughout the plugin.


  • Limits the arguments passed to the query when used with the WordPress native search.


  • Fixes PHP Notice introduced in 1.6.0


  • Adds support search form block in block editor (Gutenberg)


  • Adds support for post_status, post_type, and posts_per_page query vars when not using SearchWP
  • Updates translation source, updates translations with fixed textdomain
  • Refactored bundle process
  • Updates bundle dependencies


  • Adds compatibility for SearchWP 4


  • Fixes an issue with quoted phrase support
  • Fixes an issue with post types that are excluded from search when registered (applies only to searches with SearchWP)


  • Fixes an issue with bundle.js in some cases


  • Improves SearchWP compatibility by suppressing filters when SearchWP performs the search
  • Compatibility fix with SearchWP Modal Search Form


  • Fixes an issue (JavaScript error) when a custom configuration disables the spinner


  • Fixes an issue that may have prevented spinner customizations from being applied correctly


  • Removes post type from default results template
  • Fixes an issue with HTML entities in search string
  • Updates translation source and translations
  • Updates bundler build process
  • Updates a11y where applicable
  • Automatically cancels pending searches when search input is changed


  • Fixes typo in results template function call


  • Many a11y improvements (props @geoffreycrofte)
  • Adds message when minimum characters have not been reached
  • Added German translation (props @stefan-meier)
  • Added Polish translation (props @boguslawski-piotr)
  • Added Dutch translation (props Stefan G.)
  • Updated translation source


  • Reworked build process to be more straightforward
  • Support script debugging (props mgratch)
  • Remove form action requirement to better integrate with other code (props mgratch)
  • Fixed an issue that prevented search from firing when re-entered too fast (props pierrestoffe)


  • Added configuration option to prevent AJAX cancellation when Enter key is pressed
  • Added some actions to make customization easier
  • Added filter to customize location of results template


  • Fixed an issue with missing engine name


  • Fixed an issue that prevented multiple live search instances on a single page from using different engines


  • Fixed an issue where results_destroy_on_blur was not properly applied if a custom configuration was used but that property was not defined in the custom configuration


  • Added a number of JavaScript events to facilitate further extension/integration


  • Fixed an issue with the build process which introduced an outdated version of the plugin JavaScript assets


  • No longer limit results to built in post types
  • Added results_destroy_on_blur config option to prevent automatic removal of results window when clicking outside results pane


  • Fixed an issue that prevented SearchWP Supplemental engines from showing up in the Widget config
  • Added French translation
  • Added Serbian translation


  • Define default post statuses when using WordPress native search
  • New filter searchwp_live_search_query_args to manipulate query args before searches
  • Fixed an offset when positioning results on top of the search field


  • PHP Warning cleanup


  • New action: searchwp_live_search_alter_results
  • Adds Relevanssi support (based on Dave’s WordPress Live Search’s implementation)


  • Corrected the default results template folder name to be searchwp-live-ajax-search as is in the documentation
  • Improvement: hide the results box when query is emptied (props Lennard Voogdt)
  • Fixed an issue with Media not showing in results when integrated with SearchWP


  • Fixed an issue where a false set of no results would be returned (props Lennard Voogdt)


  • Resolved an issue where hitting Enter/Return prevented the search query from being passed to the results page
  • Fixed potential false positive for DOING_AJAX (props justinsainton)
  • Removed unnecessary call to get_the_ID() in the default results template (props justinsainton)
  • Added escaping to permalink and post type name in the default results template (props justinsainton)
  • Utilize a WordPress core translated string instead of a custom one (props justinsainton)
  • Increase the priority for the get_search_form filter so as to accommodate existing filters


  • Added Serbo-Croatian translation (props Andrijana Nikolic)


  • Fixed a directory URL issue
  • Fixed an indexOf JavaScript error


  • Initial release!