Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To add live Ajax search to WordPress, either install a plugin that connects to your existing search form or build a custom search interface that requests results from a WordPress endpoint. A plugin is usually the simpler choice; custom code makes sense when you need control over which content appears or how results work. In either case, test it with your actual theme and keep results limited to content visitors are allowed to see.

What live Ajax search does

Live search sends a request in the background as someone types, then updates a results area without reloading the whole page. WordPress describes this asynchronous request-and-update pattern as AJAX in its Plugin Handbook.

The suggestions are not a separate search engine by themselves: they are a way to display search results sooner. A plugin may use WordPress’s native search or connect to a separate search engine, depending on its setup.

Choose a plugin or custom code

For most site owners, a plugin is the practical starting point. It can attach to a standard WordPress search form or provide a shortcode, and some plugins offer settings for content types and result presentation. A custom implementation is better suited to sites that need specific query behavior, data selection, or interface design and can maintain the code securely.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

WordPress’s REST API provides structured JSON endpoints for content, but it is optional: themes and plugins do not have to use it in every case. WordPress describes the REST API as a more predictable, structured way for client-side applications to access site content than admin-ajax. Either approach can be appropriate for a custom implementation. See the REST API Handbook.

Plugin options and what to check

These options differ in how they connect to forms and customize results. Feature and compatibility details below come from their WordPress.org listings; verify current requirements and behavior on your site before relying on them.

Plugin Form connection Search and customization Useful considerations
SearchWP Live Ajax Search Automatically enables on forms generated with get_search_form(). For a custom form, add data-swplive="true" to the form. Uses SearchWP’s default engine if SearchWP is installed; otherwise it uses native WordPress search. Its results template can be overridden by copying search-results.php into a searchwp-live-ajax-search directory in the theme. SearchWP is optional for this plugin’s live results. See the plugin listing.
Relevanssi Live Ajax Search Install and activate; if it does not attach automatically, add data-rlvlive="true" to the search input. Its result template can be overridden in a theme directory named relevanssi-live-ajax-search. The listing notes that Astra, Storefront, or Divi styling can hide results in some cases and points to a workaround. See the plugin listing.
Super Ajax Search Configure the plugin’s settings or place the [super_ajax_search] shortcode where the search interface should appear. Its listing describes options for post types, result count, placeholder and no-results text; selecting the Products post type enables WooCommerce product search. The listing reports PHP 8.1+ and WordPress 6.0+, and says it was tested up to WordPress 6.9.7 when accessed. Those details can change, so check the current listing. It also describes REST requests, a 300 ms debounce, configurable transient caching, keyboard controls, ARIA markup, sanitization, escaped output, and published-only results; these are vendor-described features, not independent test results. See the plugin listing.

Install and configure a plugin

  1. In the WordPress dashboard, go to Plugins > Add New Plugin, search for the plugin you chose, then select Install Now and Activate. Review its current listing for requirements and compatibility first.
  2. Connect the intended search form. A standard WordPress form may be detected automatically by some plugins; a custom form may need the plugin’s documented input attribute, form attribute, or shortcode.
  3. Choose which content types should appear, such as posts, pages, or products if the plugin supports them. Adjust the result count, placeholder, no-results message, and template or styling options available in that plugin.
  4. Test the search on the site, not just in the dashboard. Try a query with matches and one without, navigate results by keyboard, check the mobile layout, and confirm results are visible in the theme’s actual form placement. If results are missing, check whether the form is connected and whether theme styling is hiding the result panel.

Live suggestions and search relevance are separate concerns. For example, SearchWP Live Ajax Search can use the SearchWP engine when it is installed, but it also uses native WordPress search without it; the additional engine is not mandatory for that plugin’s live behavior.

Build a custom search with the REST API

A custom front end can send a request to a REST endpoint and render the returned JSON in a results area. WordPress documents REST routes as endpoints representing resources such as posts and pages. For a custom route, register it on rest_api_init with register_rest_route(), use a unique namespace and version, define accepted arguments, and provide a permission callback appropriate to the data. WordPress emphasizes that permission callbacks are important for protecting private data. See Routes and Endpoints and the custom endpoint guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep the endpoint’s query inputs validated and shape its response to include only the fields the interface needs. Public content is generally available through the REST API; private, password-protected, and otherwise restricted content requires authentication or explicit configuration. Do not assume that hiding a result in the browser protects the underlying content.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Build with admin-ajax instead

The alternative WordPress pattern sends a request to wp-admin/admin-ajax.php with an action argument that identifies the handler. The handler returns a response for JavaScript to use when updating the page. WordPress says PHP should provide the correct AJAX URL rather than hard-coding it, because installations can vary. For state-changing requests, its guidance describes sending a nonce. A WordPress nonce can be reused during its validity period, however, so it is not a true one-time token and does not replace authorization checks. See the AJAX Plugin Handbook.

Security and accessibility checks

  • Restrict results to appropriate content. Validate query arguments on the server and enforce access rules there, especially for custom REST routes or any search involving non-public content.
  • Render returned text safely. Treat the query and returned content as data, not trusted HTML. Use safe output handling in the server response and browser rendering.
  • Test the real interaction. Check keyboard navigation, visible focus, result announcements, and mobile behavior. A plugin listing that mentions keyboard controls or ARIA markup is a reason to test those behaviors, not proof of full accessibility conformance.
  • Check form and theme compatibility. Confirm the plugin attached to the form you intend to use and that the theme does not obscure or hide the results.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.