Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Add Live Ajax Search to Your WordPress Site (The Easy Way)

Do you want to add live Ajax search to your WordPress site?

Instant search shows results as the visitor is typing into the search bar, similar to how Google works. This makes it easier for visitors to find pages, posts, products, and more.

In this article, we’ll show you how to add live Ajax search to your WordPress site.

How to add live Ajax search to your WordPress site (the easy way)

Why Add Live Ajax Search to WordPress?

Live Ajax search, also called instant search, improves the default WordPress search experience by adding a dropdown and autocomplete feature that’s common in search engines like Google.

Here’s an example of live Ajax search in action:

Google search live example

Live search guesses what users are searching for as they type, which helps them find relevant content faster. This is a huge improvement from the default WordPress search, where the visitor needs to click a button to perform the search and get their results.

With Ajax live search, you can show relevant results without even reloading the page. This makes them a great choice for online stores, as it allows visitors to instantly see lots of products that match their search query. In this way, instant search can help you create a smarter product search.

By helping users find what they’re looking for quickly, live search can keep people on your site for longer, which will increase pageviews and reduce bounce rate.

That being said, let’s take a look at how you can add live Ajax search to WordPress.

Adding Ajax Search to WordPress with a WordPress Plugin

The easiest way to add Ajax live search to WordPress is using the free SearchWP Live Ajax Lite Search plugin.

It enables instant search automatically and works perfectly with any WordPress theme.

First thing you need to do is install and activate the plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, the default WordPress search form will automatically use the Ajax live search feature. If you visit your site and start typing into the search bar, then you’ll see instant search in action.

A live Ajax search created with SearchWP

Displaying Ajax Live Search on Your WordPress Site

After activating the plugin, every search bar on your site will use live Ajax search automatically, including any custom WordPress search forms you’ve created.

Most WordPress themes have a built-in search bar, but you may also want to add a search bar to other areas of your WordPress website.

Adding Live Ajax Search to WordPress Sidebar

One of the most popular areas to add a search bar is the WordPress sidebar.

Live widget search example

This allows visitors to perform a search no matter where they are on your site.

To add the search widget to WordPress, simply go to Appearance » Widgets.

Customize widget blocks

This page shows all the different widget-ready areas of your WordPress theme. The options you see may vary, but most themes will have either a Sidebar, Right Sidebar, Left Sidebar, or similar section.

Simply click to expand the area where you want to add the live Ajax search bar. Then, click on the ‘+’ icon.

Add sidebar widget block

In the popup that appears, type in ‘SearchWP’ and then click the ‘SearchWP Live Search’ icon when it appears.

This will automatically add the live Ajax search widget to the sidebar or similar section.

Add SearchWP live search widget

You can add an optional heading to the search bar by typing into the ‘Title’ field.

When you’re finished, click the ‘Update’ button to save your changes and make the Ajax search bar live on your WordPress blog or website.

Customize and save live search widget

Now if you visit your site, you’ll see a live Ajax search bar in the sidebar or similar section.

You can follow the same process to add the search bar to any other widget-ready area.

To add a search bar to your navigation menu instead, see our guide on how to add a search bar to your WordPress menu.

Adding Live Search to the WordPress Sidebar Using Full-Site Editor

If you’re using a block-based theme such as ThemeIsle Hestia Pro or Twenty Twenty-Three, then the process of adding a search bar to the sidebar is slightly different.

Go to Themes » Editor in the WordPress dashboard to open the full-site editor.

Opening the WordPress full-site editor (FSE)

To add the search bar to your theme, go ahead and click on the ‘+’ icon.

In the panel that appears, type in ‘Search’

Adding a search field to your website using FSE

When the right block shows up, drag it to the sidebar or similar section.

To customize the block title or placeholder text, simply type the new messaging into the search block.

Adding live ajax search using the full-site editor (FSE)

When you’re happy with how the block looks, click on ‘Save’ to make the search bar live.

Adding Live Ajax Search to WordPress Pages

You may also want to add a live Ajax search box to specific pages of your website. For example, you might add a bar to your custom archive page so visitors can easily search through your content.

To do this, you’ll need to open the post or page where you want to add the search bar. For this example, we’ll show you how to add live search to a WordPress page.

First, go to Pages » All Pages and then click on the page you want to edit.

Open up WordPress page

Once the page is open, click the ‘+’ icon on the page editor screen.

This will bring up the blocks menu.

Add new page block

Here, type ‘Search’ into the box and then click on the ‘Search’ icon to add it to your page.

WordPress will automatically place the search bar for you.

Select search block

By default, the box has a ‘Search’ heading. You can change this by typing into the label field, or you can delete the heading text completely.

You can also type in an optional placeholder, which is the text that WordPress will show before visitors start typing their search query.

When you’re happy with how the search bar is setup, click on the ‘Update’ button.

Save live search block on page

Now, your visitors can use the live search bar to quickly find what they’re looking for.

You can use the same process to add a search bar to any post or page.

Live search page example

Customizing Instant WordPress Search Results

SearchWP Live Ajax Search integrates with the built-in WordPress search. However, this default search is quite limited and isn’t very good at getting accurate results.

This is where SearchWP comes in.

It’s the best WordPress search plugin on the market used by over 30,000 websites.

This plugin lets visitors search content that WordPress ignores by default, including custom fields, PDF documents, text files, WooCommerce products, and more.

By using SearchWP Live Ajax Search along with the premium SearchWP plugin, you can completely customize your website’s instant search without writing any code.

SearchWP Custom Engines

SearchWP also has advanced analytics and statistics that lets you see what your visitors are searching for.

You can use this insight to fine-tune how your site’s search is setup, and identify the most popular content on your website. This can help you come up with content that visitors are interested in, and searching for.

The SearchWP metrics and statistics page

For more information, see our on how to improve WordPress search with SearchWP.

We hope this article helped you learn how to add live Ajax search to your WordPress site. You may also want to see our guide on how to track website visitors and must have WordPress plugins for business websites.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions


  1. Congratulations, you have the opportunity to be the first commenter on this article.
    Have a question or suggestion? Please leave a comment to start the discussion.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.