SearchWP Blog

WordPress Tutorials, Tips, and Resources to Help Grow Your Business

How to add multiple search forms to WordPress

Over the years, we’ve noticed that a single search form for your website might not be enough, especially if you have many blog posts or products.

Imagine being able to offer your visitors specialized search options. For instance, you can create a form to search specifically within your blog posts, another for product listings if you run an online store, or a dedicated search just for your knowledge base.

By using multiple search forms on your site, you can narrow your search results to help your visitors find what they’re looking for faster.

In this article, we’ll show you how to add multiple search forms to your WordPress site in a few minutes, with no coding required.

Why Use Multiple Search Forms on Your Site

There are several reasons why using multiple search forms on your site can be helpful.

First, if your site has more than one search form, then the chance that visitors will notice and use one of them increases.

how to add multiple search forms to your WordPress site

It will improve your content’s discoverability and encourage visitors to spend more time on your site.

The longer they stay, the more likely they will sign up for your newsletter, purchase a product, or click on an affiliate link.

Secondly, you can customize search forms to meet your needs and place them in different areas of your website.

For example, if you’re an online store owner, you can create a search form limited to a specific product category and put it into a showcase blog post.

search form for products

This way, you can motivate your customers to search for your products and boost your sales.

On the other hand, if you’re a blogger, you can create and add separate search forms for pages and blog posts to your site.

It’ll help you clean up search results on your site and make it easier for your audience to find the right content for them.

Ready to add multiple search forms to your site? Let’s talk about how to do this below.

How to Add Multiple Search Forms to Your Site

The easiest way to add multiple search forms to your site is to use a plugin like SearchWP. It is the best WordPress plugin on the market that allows you to fully customize your site’s search.

SearchWP

Over 50,000 site owners already use it to improve their search and deliver more relevant search results to their visitors.

Using this plugin, you can add and use multiple different search forms even if you’re not a tech-savvy person.

Plus, with SearchWP, you can make custom fields, tags, categories, and many other valuable posts attributes searchable on your site.

Now, let’s see how you can use it to add different search forms to your site.

Step 1: Install and Activate SearchWP

To get started, you’ll need to get your copy of SearchWP by visiting the website and signing up for an account.

Next, you’ll need to sign in to your SearchWP account and download the plugin.

To do that, simply navigate to the ‘Downloads’ tab within the dashboard. Then, you can click the Download SearchWP button and save the plugin files on your computer.

Download SearchWP plugin from account area

After downloading, copy your plugin license key in the bottom left corner on the same tab.

The next step is to upload the SearchWP ZIP file to your site and install the plugin.

If you need help with that, you can check out the how to install a WordPress plugin step-by-step guide.

Next, you will see the SearchWP welcome screen and setup wizard. Go ahead and click the ‘Start Onboarding Wizard’ button and follow the onscreen instructions.

Onboarding wizard SearchWP

Now, you’re ready to move on to the next step and create additional search engines.

Step 2: Customize Your Search Engines

To get started, you can navigate to SearchWP » Algorithm from the WordPress dashboard. You can manage your search engines, customize them, and add new ones on this page.

From here, simply click the ‘Sources & Settings’ button.

Edit or add new search engines in WordPress

Next, you’ll see a new window with the default sources for the search engine, which include posts, pages, and media.

Go ahead and select which sources the search engine should consider when finding content or products on your site. For example, you can limit search to posts or pages.

Default search sources

Don’t forget to click the ‘Done’ button when you’re finished.

Next, you can add different attributes to each source in the search engine.

Attributes are the fields you want to search for any source, such as title, content, excerpt, slug, custom fields, taxonomy, and author.

Simply click the ‘Add/Remove Attributes’ button to continue.

Add attribute for post

Next, you will see a new window open where you can manage the search attributes and add custom fields and taxonomies as attributes.

For example, let’s say you have an ACF custom field for ‘Ingredients’ on a food blog, which you’d like to include when searching blog posts.

Similarly, if you have multiple categories and tags on your site, then you can also make them searchable by selecting them from the ‘Taxonomies’ dropdown menu.

ACF field in SearchWP

When you’ve added attributes, click the ‘Done’ button.

Besides that, you can also change the relevance weights assigned to each attribute for different post types by moving the slider. The further right the slider, the more weight that particular Attribute will be given in the search algorithm.

SearchWP will automatically assign weights for the default attributes like title and content. This will work for most websites in general, but you can always change the weights according to your requirements.

Move the slider to assign weights

When you’ve finished adjusting the relevance weights, simply scroll to the top.

After that, click the Save button to store your changes. 

Save engine settings

You’ve just changed the settings of the Default search engine, which is associated with every existing search form on your site.

Next, let’s see how to add more search engines to your WordPress site.

Step 3: Create an Additional Search Engine

If you want to add multiple search forms with different sets of search settings, then you’ll need to create additional search engines.

To do that, simply head to SearchWP » Algorithm from the WordPress dashboard and click the Add New button.

Add new engine

Next, you’ll see the Sources window for the new engine. It will be called ‘Supplemental engine’ by default, but you can change the name under the Engine Label field.

After that, you can select which sources the new engine will use for the searching process. For example, we’ll just select ‘Categories’ as a source for this search engine.

Change new engine settings

When you’re finished, simply click the ‘Done’ button.

From here, you can adjust the weights of the attributes by moving the slider and also edit the attributes for your source. Simply click the ‘Add/Remove Attributes’ button to continue.

Edit attributes for new engine

A new popup window will now open.

Here you can choose attributes for your source and add any custom field to the search process. After selecting the attributes, simply click the ‘Done’ button.

Change attribute settings for categories

Once the new engine is added, you will need to scroll to the top and click the ‘Save’ button.

After that, you’ll also need to click the ‘Rebuild Index’ button.

Save and rebuild index

Now, you have 2 search engines which are configured separately. You can repeat this process for create as many engines as you want in SearchWP.

The best part is that it allows you to link the search engines to specific search forms on your site. This way, you can create individual search forms with a unique set of settings and place them anywhere on your site.

Let’s take a look at how to create a search form using SearchWP.

How to Create Multiple Search Forms in WordPress

Using SearchWP, you can create various custom search forms to meet your needs.

First, you’ll need to head to SearchWP » Search Forms from the WordPress dashboard and click the ‘Add New’ button.

How to make WordPress search media files: Create Search Form Step 1

Next, you can choose a theme for your search form and also edit the name of the search form at the top.

SearchWP shows a live preview of how the layout will look like, so you can select the best option.

How To Create A WordPress Search Form For Custom Post Types: Create Custom Post Type Search Form Step 2

After that, you’ll need to scroll down to the Custom Styling section.

From here, click the Engine dropdown menu and select the search engine that you’d like to link with the search form.

Select search engine for search form

If you scroll down, then you will see more options to customize the appearance of your search form.

When you’re done, simply click the ‘Save’ button at the top.

Save the search form

For more information, check out our step-by-step tutorial on how to create a WordPress search form for custom post types.

Now, you can repeat this process to create multiple search forms for your website.

Next, you’ll need to embed the search form on your site. Let’s look at some common places where you can show search forms.

1. Add a Search Form to Your Navigational Menu

The navigation menu is one of the best places to put a search form on your site.

Since this is the most visible part of your site, visitors are less likely to miss it.

By placing the form in the header, you can be sure that they won’t encounter any problems with searching for content on your site.

View search in FSE

For more details, check out our step-by-step guide on how to add a search bar to the WordPress.

2. Add a Search Form to Your Sidebar

The sidebar is another excellent place to put a search form on your site. That’s a specific area where you can display information other than your main content.

By placing a search form in your site’s sidebar, you help visitors notice it and encourage them to perform a search.

put a search form to the sidebar

3. Add a Search Form Inside Posts and Pages

Adding a search bar to your posts or pages is a great way to help visitors explore your site.

For example, if you’re an online store owner, then you can add it to the showcase article.

This way, your customers can immediately search for products without being distracted from browsing the showcase.

If you are a blogger, then by adding a search form to your post, you can suggest your readers see more information related to the article’s topic.

put a search form inside the post

For more details, see our guide on how to add a WordPress search bar with a shortcode in a few simple steps.

Bonus: What Type of Custom Search Forms Can You Create?

After you’ve created search engines and multiple search forms, let’s take a look at different use cases for creating search forms in WordPress.

1. Create a Custom Post Type Search Form

Custom post types are super popular among WordPress users. You can use them to publish content beyond regular posts or pages.

For example, it might be reviews, recipes, special deals, real estate listings, or something else.

The best way to help your visitors find custom posts is to add a separate search form limited to them.

Here’s an example of such a form on the WPBeginner site that allows you to search for coupons:

custom search form

2. Create a Category Search Form

Adding a category search form to your site will allow your visitors to choose by which category they want to search.

This way, they can get more relevant search results and find what they’re looking for faster.

search by category form

For more details, see our guide on how to search by category in WordPress.

3. Create a Custom Page and Post Search Form

By default, WordPress performs a search among all the posts and pages that match the search query you have on your site.

But what if you don’t want some of them to appear in the search results?

For example, you may have posts with confidential information, paid content, or pages that shouldn’t appear in search results (like the checkout page, sitemap, contacts, and others).

The best way to solve this problem is to add a custom page and post search form.

This way, you can exclude specific content from search results so that it doesn’t get in the way of your visitors.

For more details, check out our detailed tutorial on how to exclude pages from site search results in WordPress.

We hope this article helped you learn about how to add multiple search forms to your WordPress site. You may also want to see our guide on how to add authors in WordPress search results and how to change the search results order in WordPress.

Ready to create a better and more personalized WordPress search experience? Get started with SearchWP today! 

author avatar
Aazim Akhtar

Create a Better WordPress Search Experience Today

Never lose visitors to unhelpful search results again. SearchWP makes creating your own smart WordPress search fast and easy.

Get SearchWP Now
Multiple Search Engines Icon