SearchWP Blog

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

How to add search by category in WordPress Thumbnail

Are you trying to add search by category in WordPress sites?

This feature is particularly useful for websites with lots of content, such as blogs or online stores. It lets users search within a specific category, making it easier for them to find blog posts, products, or any information they need.

In this article, we’ll show you how to add search by category in WordPress, helping you make your content more accessible and interactive to your audience.

Key Takeaways:

  • Understand how the search by category feature can benefit your online business. 
  • Learn how to add search by category in WordPress sites using SearchWP. 
  • Find out more advanced ways to level up your website search experience.

Why Add Search By Category In Your WordPress Site?

If you have a website with lots of content covering many topics, you’ll benefit from adding a search by category form. It’ll help your visitors find what they are looking for easily and quickly. 

For instance, if you’re running an online store for pet food. You may have different articles with the same keyword: “Organic diet” for different kinds of pets. 

By enabling a category-based search, you are not only helping users find their desired content but also introducing them to new articles that catch their interest. This approach can lead to increased engagement, higher conversion rates, and significant growth for your business.

You can add a search by category form to various types of websites, including blogs, online stores, eLearning platforms, and membership sites.

How To Add Search By Category In WordPress (For Beginners)

WordPress search includes categories and subcategories by default. However, it fails to let your users search through individual categories to narrow their search results.

This is where SearchWP comes in. It’s the best WordPress search plugin used by more than 60,000 businesses worldwide to add advanced search features to their websites. 

Using SearchWP, you can add the search by category feature to WordPress without expert technical knowledge. It lets you add a dropdown menu of categories for users to select from when performing a search. All without writing a single line of code.

Here are a few additional features of SearchWP: 

  • Keyword Stemming: SearchWP automatically includes variations of your search terms, such as “running” and “runner” when you search for “run.” You can adjust the settings to control this feature, ensuring a customized search experience. 
  • Search Behavior Analysis: With SearchWP, you can keep a pulse on what your visitors are looking for by monitoring and analyzing search trends on your website. This feature provides valuable insights into user preferences and behaviors, helping you refine content strategy and improve user engagement.
  • Filter Out Irrelevant Results: Improve the quality of your search results with SearchWP’s ability to exclude non-relevant content or categories. This functionality allows you to streamline the search process, ensuring that users find precisely what they need quickly and efficiently.

Now, let’s see how to add search by category in WordPress step by step.

Step 1: Install & Activate SearchWP

Firstly, you need to pick the SearchWP package that suits your needs, as each package comes with different perks. 

After completing the purchase, download the plugin file by navigating to the Downloads tab on your Accounts page.

How To Add Search by Category To WordPress: Activate SearchWP Step 1

Remember to copy your license key from the same section; you will need this key to activate your SearchWP plugin later.

How To Add Search by Category To WordPress: Activate SearchWP Step 2

Proceed to install and activate SearchWP just like any typical WordPress plugin.

When activated, you will be greeted by a welcome wizard. Click the “Start Onboarding Wizard” button for assistance with the initial setup.

If you choose to skip the wizard and prefer setting up manually, go directly to SearchWP > Add License Key.

How To Add Search by Category To WordPress: Activate SearchWP Step 3

Insert the license key you copied earlier into the designated field on your SearchWP Account Dashboard, and click ‘Verify Key’ to proceed with activation.

How To Add Search by Category To WordPress: Activate SearchWP Step 4

After your license key is confirmed, your licensing details will be displayed, indicating the successful activation of your plugin.

How To Add Search by Category To WordPress: Activate SearchWP Step 5

Step 2: Customize Your WordPress Search Algorithm

SearchWP automatically starts indexing the content on your site upon activation. However, you can take complete control over the search engine. To customize the algorithm manually, visit SearchWP > Algorithm.

How To Add Search by Category To WordPress: Setup SearchWP Engine

The default configuration indexes Posts, Pages, and Media files. You can choose which sources you’d like by clicking on the “Source & Settings” button. 

Bonus tip: you can use dedicated Engines for different types of content (or conditions) by leveraging the Supplemental Engines

How To Add Search by Category To WordPress: Setup Search Engine 4

Then, select the sources you’d like to make searchable. Click “Done” to apply changes. 

How To Add Search by Category To WordPress: Setup Search Engine 4

You can determine how much each attribute contributes by adjusting the Application Attribute Relevance. 

Move the slider next to each attribute to adjust the weight. Sliding it to the right increases its importance in search results while sliding it to the left reduces its impact. This helps you fine-tune how search results are prioritized on your site.

How To Add Search by Category To WordPress: Setup Search Engine 5

If you wish to ignore any attribute, you can simply do that by clicking on the “Add/Remove Attributes” button. 

How To Add Search by Category To WordPress: Setup Search Engine 6

Uncheck the ones you’d like to remove, and click “Done” to update the settings. 

How To Add Search by Category To WordPress: Setup Search Engine 7

When you are satisfied with the configuration, click “Save” to apply the changes. Our Engine setup is complete. 

How To Add Search by Category To WordPress: Setup Search Engine 8

The index rebuilds periodically to stay up to date with the changes. However, if you see a notice saying, “The index needs to be rebuilt,” you should click the “Rebuild Index” button to force a full manual indexing. 

How To Add Search by Category To WordPress: Setup Search Engine 9

Step 3: Create A Search By Category Form In WordPress

Now that the stage is set. Let’s create a search form to add search by category in WordPress. With SearchWP, you can easily create a search form with only a few clicks.

Navigate to SearchWP > Search Forms and click on the “Add New” button.

How To Add Search by Category To WordPress: Create Search Form Step 1

Give your search form a memorable name that will help you easily recognize the search form later. 

How To Add Search by Category To WordPress: Create Search Form Step 2

Now, to add search by category in WordPress, select “Category Search” from the Layout Theme. 

How To Add Search by Category To WordPress: Create Search Form Step 3

Make sure the correct Engine is selected. If you have created multiple search engines, it’ll show in the dropdown. 

How To Add Search by Category To WordPress: Create Search Form Step 4

You can choose either the default WordPress Results page or the SearchWP Results page. The benefit of choosing SearchWP is that you’ll be able to make advanced changes to the Search Results page

How To Add Search by Category To WordPress: Create Search Form Step 6

Now, add the types of content you want to search for in the “Type of search” field. The sources you selected in the Algorithm (from the previous step) will appear here. 

How To Add Search by Category To WordPress: Create Search Form Step 6

This is the most critical part of this tutorial, you need to select categories that you want to include in the search by category form in the “Select Category.” Only the ones you pick will appear in the dropdown. 

Please note: you will only see categories that are currently in use. If a category is not listed, it typically means there is no content associated with it.

How To Add Search by Category To WordPress: Create Search Form Step 7

Finally, click “Save” to create a search by category form in WordPress. 

How To Add Search by Category To WordPress: Create Search Form Step 8

Step 4: Embed The Search By Category Form In WordPress

There are multiple ways to add the search by category form on your website. Click the “Embed” button next to the “Save” to see all options. 

How To Add Search by Category To WordPress: Embed Search Form Step 0

In the popup modal, you’ll see multiple ways to add the search by category form to your website. Follow the one that suits you best. 

How To Add Search by Category To WordPress: Embed Search Form Step 01

Let’s see an example of how you can add a search by category form in WordPress using Gutenberg Block. 

Open the page where you want to add the search form in Edit mode. Then, find and select the “Search Form” block among other Gutenberg Blocks. 

How To Add Search by Category To WordPress: Embed Search Form Step 1

Now, click “Select a Form” to choose your newly created search by category form. 

How To Add Search by Category To WordPress: Embed Search Form Step 2

Choose the search form you just created using SearchWP.

How To Add Search by Category To WordPress: Embed Search Form Step 3

Finally, click “Publish/Update”, depending on your scenario, and that’s it!

How To Add Search by Category To WordPress: Embed Search Form Step 4

Open the published page to start using your search by category form in WordPress! 

How To Add Search by Category To WordPress: Embed Search Form Step 5

Pro Tips To Make WordPress Search More Powerful

You can add the following features to make searching on your website even better. All of them can be easily achieved using SearchWP, and you don’t require any coding knowledge either. 

Show Related Content: You can show content that matches what users are already reading. This helps make their experience better by showing them more articles or posts they might like, which means they might stay on your site longer. This could lead to more views and fewer people leaving quickly.

Add Live Search: Change how users interact with your website through live search. Live Search lets your visitors see results instantly as they type their search query. It helps them find what they need faster and makes searching intuitive.

Set Up Custom Redirects: Help users get to the right place faster with custom redirects. This means if someone searches for something specific, you can send them straight to the best page, like a special deal or a popular article. This is super helpful for advertising or displaying certain posts.

Keep Private Content Safe: You can keep special content safe for only certain people, like subscribers or members. This feature helps restrict who can see and search for private content, keeping them exclusive to your designated audience. 

Conclusion

If you add search by category in WordPress sites, it can significantly improve your business. We hope you were able to implement this feature easily on your website. Now, your visitors will be able to search within specific categories without being overwhelmed. 

Get SearchWP now to add advanced search features to your website easily!

author avatar
Saif Khan

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