Do you want to use multiple search forms in WordPress?
Adding multiple search forms to your site helps your visitors quickly find what they’re looking for and improves user experience.
In this article, we’ll show you how you can add multiple search forms to your WordPress site.
Why Use Multiple Search Forms in WordPress?
WordPress search forms help your visitors find the content they’re looking for. Better content discoverability leads to users spending more time on your website which helps increase your pageviews and reduce your bounce rate.
Also when a user spends more time on your site, they’re more likely to join your email list, purchase a product, or become a subscriber.
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.
Plus, you can customize these search forms so that they show different results depending on the 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 you 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 by using the SearchWP plugin. It’s one of the best search plugins for WordPress used by over 30,000 sites.
It’s very easy to use, gives you complete control over your WordPress search results, and lets you use multiple different search forms on your site.
Setting Up 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.
Upon activation, you need to go to Settings » SearchWP and then click on the ‘License’ menu option.
Here, you need to enter your license key into the ‘License’ box and click the ‘Activate’ button. You can find this information under your account on the SearchWP website.
After that, you need to click on the ‘Engines’ menu option.
This brings up a screen where you need to set your search engine settings. Think of it like creating your very own Google search algorithm built specifically for your WordPress site and content.
You need to create a sitewide search engine before you can create multiple custom search forms that show different results.
To adjust the search engine settings, simply click on ‘Posts’, ‘Pages’, ‘Library’, or other custom post type drop downs that are available.
Then, you can adjust the ‘Weight Multiplier’ up or down to change how your search engine will rank that type of content.
If you want to value the title and page content more than the excerpt, then simply move the sliders accordingly.
Once you’re done, make sure to click the ‘Save Engines’ button.
Now, it’s time to create multiple different search forms you can add to various locations across your site.
Create Multiple Different Search Forms in WordPress
SearchWP is a very flexible search plugin and makes it easy to create a variety of 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 deals 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 the content on your site.
Using SearchWP, you can create individual search forms that only search for content within that specific post type.
For more details, see our guide on how to create advanced search form in WordPress for custom post types.
Creating Category Search Forms in WordPress
Search by category forms let your visitors search your website by specific categories. If you have a lot of content, then this can help your visitors find what they’re looking for quickly.
Instead of searching through all your articles, you’re giving your visitors control over the exact kind of content they’re looking for.
For more details, see our guide on how to search by category in WordPress.
Creating Custom Page and Post Search Forms in WordPress
Your default search forms will show all of your pages, posts, and custom post types in the search results. However, there are times when you might want to stop certain pages and posts from appearing.
For example, if you run an online store, then you might want to hide your checkout page, cart page, thank you page, and account page.
Or those who have membership websites might want to hide your premium content and other members-only pages.
Some users might even want to prevent all WordPress pages from appearing in search.
To learn more, see our step by step guide on how to exclude pages from the WordPress search results.
Add Multiple Search Forms to Your WordPress Site
Now that you’ve created multiple search forms, it’s time to add them to your WordPress site.
You can add search forms wherever you like, 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 take a look at how to add your search forms in different areas.
Adding a Search Form to WordPress Menus
Nearly every popular WordPress blog has a simple search form or search bar in the WordPress navigation menu since it’s very noticeable and easy to find.
Since this location is so common, many visitors are used to seeing a search bar in this location 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 shows these improved results.
To do this, simply go to Appearance » Widgets to bring up the blocks 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 the ‘Plus’ add block icon underneath the sidebar where you want to add your widget.
Then, type ‘Search’ into the search bar and click the ‘Search’ block icon.
This will automatically insert a search form into your sidebar.
You can add a title and change the text inside the search box.
When you’re finished, click the ‘Update’ button to make your search form live.
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.
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 may 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 this for your help desk, knowledge base, FAQs, documentation, and more.
This type of search form can be very helpful for your visitors since it only searches for a very specific kind of content.
For more details, see our guide on how to add a search form in a WordPress post with a shortcode.
We hope this article helped you learn how to use multiple search forms in WordPress. You may also want to see 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, then please 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.
from WPBeginner https://ift.tt/P5q0oDd
via IFTTT
No comments:
Post a Comment