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?

Adding instant search to WordPress improves the default site search and makes it easier for your visitors to find the pages and posts they’re looking for.

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

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 the drop down 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.

By helping users find what they’re looking for quickly, live search can get them to stay on your site 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 your WordPress blog or website.

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

Now, every search bar on your site will use live Ajax search automatically.

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 makes it easy for visitors to do a search no matter where they are on your site.

To add the search widget to WordPress, simply go to Appearance » Widgets to bring up the blocks based widget editor.

Customize widget blocks

Each widget area of your WordPress theme will have a separate tab in the block editor.

On our test site, our sidebar widget area is called ‘Right Sidebar,’ but yours may have a different name depending on your theme.

Simply click the ‘+’ icon underneath the sidebar or similiar section.

Add sidebar widget block

Then, type ‘SearchWP’ into the search bar and click the ‘SearchWP Live Search’ icon.

This will automatically add the live Ajax search widget to your sidebar.

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 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 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 navigate to the post or page that you want to edit. For this example, we’ll show you how to add the live search bar 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

Next, 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 not very good at finding the relevant content.

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 custom your 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.

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.