How to Use Multiple Search Forms in WordPress


Do you want to use multiple search forms in WordPress?

Adding multiple search forms to your site helps your visitors find what they’re looking for quickly and improves the user experience.

In this article, we are going to show you how you can add multiple search forms to your WordPress site.

How to Use Multiple Search Forms in WordPress

Why Use Multiple Search Forms in WordPress?

WordPress search forms help your visitors find the content they are looking for. Better content discoverability allows users to spend more time on your website, which helps increase your page views and lower your bounce rate.

Also, when a user spends more time on your site, they are more likely to join your mailing list, purchase a product, or subscribe.

By using multiple search forms on your site, you make it easy for your visitors to search different areas of your website and find a search form at any time.

Example of multiple search forms

Additionally, you can customize these search forms so that they show different results based on location. For example, you can have a sitewide search bar in your header and create a separate product search bar so visitors can search for a product in your online store.

That being said, let’s show how to create multiple search forms in WordPress step by step.

Create a new WordPress search algorithm with a WordPress plugin

The easiest way to add multiple search forms to your WordPress website is to use the SearchWP connect. It is one of the best search plugins for WordPress used by over 30,000 sites.

SearchWP

It’s very easy to use, gives you full control over your WordPress search results, and allows you to use several different search forms on your site.

Configuring SearchWP

The 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.

When activating, you need to go to Settings » WPSearch then click on the ‘License’ menu option.

Enter the SearchWP license

Here you need to enter your license key in the “License” box and click on the “Activate” button. You can find this information under your account on the SearchWP website.

After that, you need to click on the “Motors” menu option.

Set SearchWP default engine

This brings up a screen where you need to set your search engine parameters. Think of it like creating your own Google search algorithm specifically designed for your WordPress site and content.

You must create a site-wide search engine before you can create multiple custom search forms that display different results.

To adjust the search engine settings, simply click on ‘Posts’, ‘Pages’, ‘Library’ or other drop-down lists of custom post types available.

Then you can adjust the “weight multiplier” up or down to change how your search engine will rank this type of content.

If you want to value the page title and content more than the excerpt, just move the sliders accordingly.

Change SearchWP search algorithm cursors

Once you’re done, make sure to click the “Save Engines” button.

Now is the time to create several different search forms that you can add to various places on your site.

Create several different search forms in WordPress

SearchWP is a very flexible search plugin and makes it easy to create different types of search forms.

Here are some of the most common types of custom search forms you can create.

Creating Custom Post Type Search Forms

Custom post type search forms are a great way to help your visitors find the most relevant content. For example, we use custom post types here at WPBeginner for our Glossary and Offers pages, so they’re separate from the rest of our content.

This type of search form is also common on review websites, where you want to separate your product review posts from the rest of your site content.

Using SearchWP, you can create individual search forms that only search for content within that specific post type.

Custom post type search form

For more details, see our guide on creating an advanced search form in WordPress for custom post types.

Creating Category Search Forms in WordPress

Category search forms allow your visitors to search your website by specific categories. If you have a lot of content, it can help your visitors find what they’re looking for quickly.

Instead of searching through all of your articles, you give your visitors control over the exact type of content they are looking for.

Category search form

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

Creating Custom Pages and Post Search Forms in WordPress

Your default search forms will show all of your pages, posts, and custom post types in search results. However, there may be times when you want to prevent certain pages and posts from being displayed.

For example, if you run an online store, you might want to hide your checkout page, cart page, thank you page, and account page.

Or those with membership websites may want to hide your premium content and other members-only pages.

Some users might even want to block all WordPress pages from appearing in search.

To learn more, see our step-by-step guide on how to exclude pages from WordPress search results.

Add multiple search forms to your WordPress site

Now that you’ve created several search forms, it’s time to add them to your WordPress site.

You can add search forms wherever you want, even in the middle of a page or post. The most common places to add search forms are in your WordPress menu, sidebars, and footers.

Let’s see how to add your search forms in different areas.

Add a Search Form to WordPress Menus

Almost all popular WordPress blogs have a simple search form or search bar in the WordPress navigation menu because it is highly visible and easy to find.

Navigation menu search form

Since this location is so common, many visitors are used to seeing a search bar there and will check here first.

For more details, see our step-by-step guide on how to add a search bar to WordPress menus.

Adding Search Forms to WordPress Sidebars

Another common place for your search forms is your sidebar or footer.

When you create a new search algorithm with SearchWP, it automatically replaces the default WordPress search, so you can easily add a search bar to your sidebar that displays these improved results.

To do this, simply go to Appearance » Widgets to display the block-based widget editor.

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

On the Astra theme, the sidebar widget area is called “Main Sidebar”, but yours may have a different name depending on your theme.

Simply click on the “More” add block icon below the sidebar where you want to add your widget.

Add a new block widget

Then type “Search” in the search bar and click on the “Search” block icon.

This will automatically insert a search form into your sidebar.

Add a search block

You can add a title and edit the text in the search field.

When you’re done, click the “Update” button to bring your search form online.

Save search widget

Now you can visit your site to see your improved search form.

You can add the search block to any widget area of ​​your site. To learn more, see our guide on how to add and use widgets in WordPress.

Example of a search form in the sidebar

You can also create a live Ajax search form, similar to the drop-down autocomplete feature common to search engines like Google.

For more details, see our guide on how to add live Ajax search to your WordPress site.

Adding search forms to WordPress posts and pages

Next, you might want to add a custom search form to specific posts and pages. For example, we have a custom search form on our deals page that only searches for specific coupons and deals.

You can also use it for your help desk, knowledge base, FAQs, documentation, etc.

Search form in sample page

This type of search form can be very useful for your visitors because it only searches for a very specific type of content.

For more details, see our guide on how to add a search form to a WordPress post with a shortcode.

We hope this article helped you learn how to use multiple search forms in WordPress. You can also check out our guide on how to get a free email domain, and our expert picks of the best GoDaddy alternatives that are cheaper and more reliable.

If you liked this article, subscribe to our Youtube channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Use Multiple Search Forms in WordPress first appeared on WPBeginner.



Leave a Comment

Your email address will not be published.